ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.98 by root, Mon Feb 6 05:40:15 2006 UTC vs.
Revision 1.158 by root, Sun Jun 3 18:04:44 2012 UTC

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,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 "iom.h" 37#include "ev_cpp.h"
37#include "rxvt.h" 38#include "rxvt.h"
38#include "keyboard.h" 39#include "keyboard.h"
39#include "rxvtutil.h" 40#include "rxvtutil.h"
40#include "rxvtperl.h" 41#include "rxvtperl.h"
41 42
42#include "perlxsi.c" 43#include "perlxsi.c"
43 44
44#ifdef HAVE_SCROLLBARS
45# define GRAB_CURSOR THIS->leftptr_cursor 45#define GRAB_CURSOR THIS->scrollBar.leftptr_cursor
46#else
47# define GRAB_CURSOR None
48#endif
49 46
50#undef LINENO 47#undef LINENO
51#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) 48#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows)
52#undef ROW 49#undef ROW
53#define ROW(n) THIS->row_buf [LINENO (n)] 50#define ROW(n) THIS->row_buf [LINENO (n)]
54 51
55typedef int CHAINED UNUSED; 52/////////////////////////////////////////////////////////////////////////////
53
54typedef char * octet_string;
55typedef char * utf8_string;
56
57typedef GdkPixbuf * urxvt__pixbuf;
58typedef rxvt_img * urxvt__img;
59
60/////////////////////////////////////////////////////////////////////////////
61
62static void
63parse_color (rxvt_screen *s, rxvt_color &c, SV *sv)
64{
65 //TODO: support component stuff
66 c.set (s, SvPVbyte_nolen (sv));
67}
56 68
57///////////////////////////////////////////////////////////////////////////// 69/////////////////////////////////////////////////////////////////////////////
58 70
59static wchar_t * 71static wchar_t *
60sv2wcs (SV *sv) 72sv2wcs (SV *sv)
75 87
76 return sv; 88 return sv;
77} 89}
78 90
79static SV * 91static SV *
80new_ref (HV *hv, const char *klass)
81{
82 return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1));
83}
84
85static SV *
86newSVptr (void *ptr, const char *klass) 92newSVptr (void *ptr, const char *klass)
87{ 93{
88 HV *hv = newHV (); 94 HV *hv = newHV ();
89 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0); 95 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0);
90 return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1)); 96 return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1));
117#define newSVterm(term) SvREFCNT_inc ((SV *)(term)->perl.self) 123#define newSVterm(term) SvREFCNT_inc ((SV *)(term)->perl.self)
118#define SvTERM(sv) (rxvt_term *)SvPTR ((sv), "urxvt::term") 124#define SvTERM(sv) (rxvt_term *)SvPTR ((sv), "urxvt::term")
119 125
120///////////////////////////////////////////////////////////////////////////// 126/////////////////////////////////////////////////////////////////////////////
121 127
122#define SvWATCHER(sv) (perl_watcher *)SvPTR (sv, "urxvt::watcher")
123
124struct perl_watcher
125{
126 SV *cbsv;
127 HV *self;
128
129 perl_watcher ()
130 : cbsv (0)
131 {
132 }
133
134 ~perl_watcher ()
135 {
136 SvREFCNT_dec (cbsv);
137 }
138
139 void cb (SV *cb)
140 {
141 SvREFCNT_dec (cbsv);
142 cbsv = newSVsv (cb);
143 }
144
145 void invoke (const char *type, SV *self, int arg = -1);
146};
147
148void
149perl_watcher::invoke (const char *type, SV *self, int arg)
150{
151 dSP;
152
153 ENTER;
154 SAVETMPS;
155
156 PUSHMARK (SP);
157
158 XPUSHs (sv_2mortal (self));
159
160 if (arg >= 0)
161 XPUSHs (sv_2mortal (newSViv (arg)));
162
163 PUTBACK;
164 call_sv (cbsv, G_VOID | G_EVAL | G_DISCARD);
165 SPAGAIN;
166
167 PUTBACK;
168 FREETMPS;
169 LEAVE;
170
171 if (SvTRUE (ERRSV))
172 rxvt_warn ("%s callback evaluation error: %s", type, SvPV_nolen (ERRSV));
173}
174
175#define newSVtimer(timer) new_ref ((timer)->self, "urxvt::timer")
176#define SvTIMER(sv) (timer *)(perl_watcher *)SvPTR ((sv), "urxvt::timer")
177
178struct timer : perl_watcher, time_watcher
179{
180 tstamp interval;
181
182 timer ()
183 : time_watcher (this, &timer::execute)
184 {
185 }
186
187 void execute (time_watcher &w)
188 {
189 if (interval)
190 start (at + interval);
191
192 invoke ("urxvt::timer", newSVtimer (this));
193 }
194};
195
196#define newSViow(iow) new_ref ((iow)->self, "urxvt::iow")
197#define SvIOW(sv) (iow *)(perl_watcher *)SvPTR ((sv), "urxvt::iow")
198
199struct iow : perl_watcher, io_watcher
200{
201 iow ()
202 : io_watcher (this, &iow::execute)
203 {
204 }
205
206 void execute (io_watcher &w, short revents)
207 {
208 invoke ("urxvt::iow", newSViow (this), revents);
209 }
210};
211
212#define newSViw(iw) new_ref ((iw)->self, "urxvt::iw")
213#define SvIW(sv) (iw *)(perl_watcher *)SvPTR ((sv), "urxvt::iw")
214
215struct iw : perl_watcher, idle_watcher
216{
217 iw ()
218 : idle_watcher (this, &iw::execute)
219 {
220 }
221
222 void execute (idle_watcher &w)
223 {
224 invoke ("urxvt::iw", newSViw (this));
225 }
226};
227
228#define newSVpw(pw) new_ref ((pw)->self, "urxvt::pw")
229#define SvPW(sv) (pw *)(perl_watcher *)SvPTR ((sv), "urxvt::pw")
230
231struct pw : perl_watcher, child_watcher
232{
233 pw ()
234 : child_watcher (this, &pw::execute)
235 {
236 }
237
238 void execute (child_watcher &w, int status)
239 {
240 invoke ("urxvt::pw", newSVpw (this), status);
241 }
242};
243
244/////////////////////////////////////////////////////////////////////////////
245
246#define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") 128#define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay")
247 129
248class overlay { 130class overlay : overlay_base
131{
249 rxvt_term *THIS; 132 rxvt_term *THIS;
250 AV *overlay_av; 133 AV *overlay_av;
251 int x, y, w, h;
252 int border; 134 int border;
253 text_t **text;
254 rend_t **rend;
255 135
256public: 136public:
257 HV *self; 137 HV *self;
258 138
259 overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border); 139 overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border);
266 146
267 void set (int x, int y, SV *str, SV *rend); 147 void set (int x, int y, SV *str, SV *rend);
268}; 148};
269 149
270overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) 150overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border)
271: THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), overlay_av (0) 151: THIS(THIS), border(border == 2), overlay_av (0)
272{ 152{
153 x = x_;
154 y = y_;
155 w = w_;
156 h = h_;
157
158 if (w < 0) w = 0;
159 if (h < 0) h = 0;
160
273 if (border == 2) 161 if (border == 2)
274 { 162 {
275 w += 2; 163 w += 2;
276 h += 2; 164 h += 2;
277 } 165 }
343 *hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0) 231 *hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0)
344 )); 232 ));
345 av_push (overlay_av, newSViv ((long)this)); 233 av_push (overlay_av, newSViv ((long)this));
346 234
347 THIS->want_refresh = 1; 235 THIS->want_refresh = 1;
236 THIS->refresh_check ();
348} 237}
349 238
350void 239void
351overlay::hide () 240overlay::hide ()
352{ 241{
355 244
356 int i; 245 int i;
357 246
358 for (i = AvFILL (overlay_av); i >= 0; i--) 247 for (i = AvFILL (overlay_av); i >= 0; i--)
359 if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this) 248 if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this)
360 {
361 av_delete (overlay_av, i, G_DISCARD);
362 break; 249 break;
363 }
364 250
365 for (; i < AvFILL (overlay_av); i++) 251 for (; i < AvFILL (overlay_av); i++)
366 av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); 252 av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0)));
367 253
368 av_pop (overlay_av); 254 av_pop (overlay_av);
369 255
370 SvREFCNT_dec (overlay_av); 256 SvREFCNT_dec (overlay_av);
371 overlay_av = 0; 257 overlay_av = 0;
372 258
373 THIS->want_refresh = 1; 259 THIS->want_refresh = 1;
260 THIS->refresh_check ();
374} 261}
375 262
376void overlay::swap () 263void overlay::swap ()
377{ 264{
378 int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w)); 265 int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w));
379 int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h)); 266 int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h));
380 267
381 int ov_w = min (w, THIS->ncol - ov_x); 268 int ov_w = min (w, THIS->ncol - ov_x);
382 int ov_h = min (h, THIS->nrow - ov_y); 269 int ov_h = min (h, THIS->nrow - ov_y);
270
271 // hide cursor if it is within the overlay area
272 if (IN_RANGE_EXC (THIS->screen.cur.col - ov_x, 0, ov_w)
273 && IN_RANGE_EXC (THIS->screen.cur.row - ov_y, 0, ov_h))
274 THIS->screen.flags &= ~Screen_VisibleCursor;
383 275
384 for (int y = ov_h; y--; ) 276 for (int y = ov_h; y--; )
385 { 277 {
386 text_t *t1 = text [y]; 278 text_t *t1 = text [y];
387 rend_t *r1 = rend [y]; 279 rend_t *r1 = rend [y];
423 for (int col = min (AvFILL (av) + 1, w - x - border); col--; ) 315 for (int col = min (AvFILL (av) + 1, w - x - border); col--; )
424 this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); 316 this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1));
425 } 317 }
426 318
427 THIS->want_refresh = 1; 319 THIS->want_refresh = 1;
320 THIS->refresh_check ();
428} 321}
429 322
323/////////////////////////////////////////////////////////////////////////////
324
325#include "iom_perl.h"
430 326
431///////////////////////////////////////////////////////////////////////////// 327/////////////////////////////////////////////////////////////////////////////
432 328
433struct rxvt_perl_interp rxvt_perl; 329struct rxvt_perl_interp rxvt_perl;
434 330
438{ 334{
439 if (perl) 335 if (perl)
440 { 336 {
441 perl_destruct (perl); 337 perl_destruct (perl);
442 perl_free (perl); 338 perl_free (perl);
339 PERL_SYS_TERM ();
443 } 340 }
444} 341}
445 342
446void 343void
447rxvt_perl_interp::init (rxvt_term *term) 344rxvt_perl_interp::init (rxvt_term *term)
448{ 345{
449 if (!perl) 346 if (!perl)
450 { 347 {
451 rxvt_push_locale (""); // perl init destroys current locale 348 rxvt_push_locale (""); // perl init destroys current locale
452 349
350 {
453 perl_environ = rxvt_environ; 351 perl_environ = rxvt_environ;
454 swap (perl_environ, environ); 352 localise_env set_environ (perl_environ);
455 353
456 char *argv[] = { 354 char *args[] = {
457 "", 355 "",
458 "-e" 356 "-e"
459 "BEGIN {" 357 "BEGIN {"
460 " urxvt->bootstrap;" 358 " urxvt->bootstrap;"
461 " unshift @INC, '" LIBDIR "';" 359 " unshift @INC, '" LIBDIR "';"
462 "}" 360 "}"
463 "" 361 ""
464 "use urxvt;" 362 "use urxvt;"
465 }; 363 };
364 int argc = ecb_array_length (args);
365 char **argv = args;
466 366
367 PERL_SYS_INIT3 (&argc, &argv, &environ);
467 perl = perl_alloc (); 368 perl = perl_alloc ();
468 perl_construct (perl); 369 perl_construct (perl);
469 370
470 if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) 371 if (perl_parse (perl, xs_init, argc, argv, (char **)NULL)
471 || perl_run (perl)) 372 || perl_run (perl))
472 { 373 {
473 rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); 374 rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n");
474 375
475 perl_destruct (perl); 376 perl_destruct (perl);
476 perl_free (perl); 377 perl_free (perl);
477 perl = 0; 378 perl = 0;
478 } 379 }
479 380 }
480 swap (perl_environ, environ);
481 381
482 rxvt_pop_locale (); 382 rxvt_pop_locale ();
483 } 383 }
484 384
485 if (perl) 385 if (perl)
486 { 386 {
487 // runs outside of perls ENV 387 // runs outside of perls ENV
488 term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); 388 term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term");
489 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); 389 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0);
390 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0);
490 } 391 }
491} 392}
492 393
493static void 394static void
494ungrab (rxvt_term *THIS) 395ungrab (rxvt_term *THIS)
505rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) 406rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
506{ 407{
507 if (!perl || !term->perl.self) 408 if (!perl || !term->perl.self)
508 return false; 409 return false;
509 410
411 localise_env set_environ (perl_environ);
412
510 // pre-handling of some events 413 // pre-handling of some events
511 if (htype == HOOK_REFRESH_END) 414 if (htype == HOOK_REFRESH_END)
512 { 415 {
513 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); 416 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
514 417
515 for (int i = 0; i <= AvFILL (av); i++) 418 for (int i = 0; i <= AvFILL (av); i++)
516 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 419 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
517 } 420 }
421 else if (htype == HOOK_DESTROY)
422 {
423 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0));
518 424
519 swap (perl_environ, environ); 425 for (int i = AvFILL (av); i >= 0; i--)
426 {
427 rxvt_selection *req = (rxvt_selection *)SvIV (*av_fetch (av, i, 0));
428 delete req;
429 }
430 }
520 431
521 bool event_consumed; 432 bool event_consumed;
522 433
523 if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always 434 if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always
524 || term->perl.should_invoke [htype]) 435 || term->perl.should_invoke [htype])
525 try
526 { 436 {
527 dSP; 437 dSP;
528 va_list ap; 438 va_list ap;
529 439
530 va_start (ap, htype); 440 va_start (ap, htype);
531 441
532 ENTER; 442 ENTER;
533 SAVETMPS; 443 SAVETMPS;
534 444
535 PUSHMARK (SP); 445 PUSHMARK (SP);
536 446
447 EXTEND (SP, 2);
537 XPUSHs (sv_2mortal (newSVterm (term))); 448 PUSHs (sv_2mortal (newSVterm (term)));
538 XPUSHs (sv_2mortal (newSViv (htype))); 449 PUSHs (sv_2mortal (newSViv (htype)));
539 450
540 for (;;) { 451 for (;;) {
541 data_type dt = (data_type)va_arg (ap, int); 452 data_type dt = (data_type)va_arg (ap, int);
542 453
543 switch (dt) 454 switch (dt)
544 { 455 {
545 case DT_INT: 456 case DT_INT:
546 XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); 457 XPUSHs (sv_2mortal (newSViv (va_arg (ap, int))));
547 break; 458 break;
548 459
549 case DT_LONG: 460 case DT_LONG:
550 XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); 461 XPUSHs (sv_2mortal (newSViv (va_arg (ap, long))));
551 break; 462 break;
552 463
553 case DT_STR: 464 case DT_STR:
554 XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); 465 XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0)));
555 break; 466 break;
556 467
557 case DT_STR_LEN: 468 case DT_STR_LEN:
558 { 469 {
559 char *str = va_arg (ap, char *); 470 char *str = va_arg (ap, char *);
560 int len = va_arg (ap, int); 471 int len = va_arg (ap, int);
561 472
562 XPUSHs (sv_2mortal (newSVpvn (str, len))); 473 XPUSHs (sv_2mortal (newSVpvn (str, len)));
563 } 474 }
564 break; 475 break;
565 476
566 case DT_WCS_LEN: 477 case DT_WCS_LEN:
567 { 478 {
568 wchar_t *wstr = va_arg (ap, wchar_t *); 479 wchar_t *wstr = va_arg (ap, wchar_t *);
569 int wlen = va_arg (ap, int); 480 int wlen = va_arg (ap, int);
570 481
571 XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); 482 XPUSHs (sv_2mortal (wcs2sv (wstr, wlen)));
572 } 483 }
573 break; 484 break;
574 485
575 case DT_LCS_LEN: 486 case DT_LCS_LEN:
576 { 487 {
577 long *lstr = va_arg (ap, long *); 488 long *lstr = va_arg (ap, long *);
578 int llen = va_arg (ap, int); 489 int llen = va_arg (ap, int);
579 490
580 XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long)))); 491 XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long))));
581 } 492 }
582 break; 493 break;
583 494
584 case DT_XEVENT: 495 case DT_XEVENT:
585 { 496 {
586 XEvent *xe = va_arg (ap, XEvent *); 497 XEvent *xe = va_arg (ap, XEvent *);
587 HV *hv = newHV (); 498 HV *hv = newHV ();
588 499
589# define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) 500# define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0)
590# define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) 501# define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0)
591# define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) 502# define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0)
592# undef set 503# undef set
593 504
594 setiv (type, xe->type); 505 setiv (type, xe->type);
595 setiv (send_event, xe->xany.send_event); 506 setiv (send_event, xe->xany.send_event);
596 setiv (serial, xe->xany.serial); 507 setiv (serial, xe->xany.serial);
597 508
598 switch (xe->type) 509 switch (xe->type)
599 { 510 {
600 case KeyPress: 511 case KeyPress:
601 case KeyRelease: 512 case KeyRelease:
602 case ButtonPress: 513 case ButtonPress:
603 case ButtonRelease: 514 case ButtonRelease:
604 case MotionNotify: 515 case MotionNotify:
605 setuv (window, xe->xmotion.window); 516 setuv (window, xe->xmotion.window);
606 setuv (root, xe->xmotion.root); 517 setuv (root, xe->xmotion.root);
607 setuv (subwindow, xe->xmotion.subwindow); 518 setuv (subwindow, xe->xmotion.subwindow);
608 setuv (time, xe->xmotion.time); 519 setuv (time, xe->xmotion.time);
609 setiv (x, xe->xmotion.x); 520 setiv (x, xe->xmotion.x);
610 setiv (y, xe->xmotion.y); 521 setiv (y, xe->xmotion.y);
611 setiv (row, xe->xmotion.y / term->fheight + term->view_start); 522 setiv (row, xe->xmotion.y / term->fheight + term->view_start);
612 setiv (col, xe->xmotion.x / term->fwidth); 523 setiv (col, xe->xmotion.x / term->fwidth);
613 setiv (x_root, xe->xmotion.x_root); 524 setiv (x_root, xe->xmotion.x_root);
614 setiv (y_root, xe->xmotion.y_root); 525 setiv (y_root, xe->xmotion.y_root);
615 setuv (state, xe->xmotion.state); 526 setuv (state, xe->xmotion.state);
616 527
617 switch (xe->type) 528 switch (xe->type)
618 { 529 {
619 case KeyPress: 530 case KeyPress:
620 case KeyRelease: 531 case KeyRelease:
621 setuv (keycode, xe->xkey.keycode); 532 setuv (keycode, xe->xkey.keycode);
622 break; 533 break;
623 534
624 case ButtonPress: 535 case ButtonPress:
625 case ButtonRelease: 536 case ButtonRelease:
626 setuv (button, xe->xbutton.button); 537 setuv (button, xe->xbutton.button);
627 break; 538 break;
628 539
629 case MotionNotify: 540 case MotionNotify:
630 setiv (is_hint, xe->xmotion.is_hint); 541 setiv (is_hint, xe->xmotion.is_hint);
631 break; 542 break;
632 } 543 }
633 544
634 break; 545 break;
635 546
636 case MapNotify: 547 case MapNotify:
637 case UnmapNotify: 548 case UnmapNotify:
638 case ConfigureNotify: 549 case ConfigureNotify:
639 setuv (event, xe->xconfigure.event); 550 setuv (event, xe->xconfigure.event);
640 setuv (window, xe->xconfigure.window); 551 setuv (window, xe->xconfigure.window);
641 552
642 switch (xe->type) 553 switch (xe->type)
643 { 554 {
644 case ConfigureNotify: 555 case ConfigureNotify:
645 setiv (x, xe->xconfigure.x); 556 setiv (x, xe->xconfigure.x);
646 setiv (y, xe->xconfigure.y); 557 setiv (y, xe->xconfigure.y);
647 setiv (width, xe->xconfigure.width); 558 setiv (width, xe->xconfigure.width);
648 setiv (height, xe->xconfigure.height); 559 setiv (height, xe->xconfigure.height);
649 setuv (above, xe->xconfigure.above); 560 setuv (above, xe->xconfigure.above);
650 break; 561 break;
651 } 562 }
652 563
653 break; 564 break;
654 565
655 case PropertyNotify: 566 case PropertyNotify:
656 setuv (window, xe->xproperty.window); 567 setuv (window, xe->xproperty.window);
657 setuv (atom, xe->xproperty.atom); 568 setuv (atom, xe->xproperty.atom);
658 setuv (time, xe->xproperty.time); 569 setuv (time, xe->xproperty.time);
659 setiv (state, xe->xproperty.state); 570 setiv (state, xe->xproperty.state);
660 break; 571 break;
661 572
662 case ClientMessage: 573 case ClientMessage:
663 setuv (window, xe->xclient.window); 574 setuv (window, xe->xclient.window);
664 setuv (message_type, xe->xclient.message_type); 575 setuv (message_type, xe->xclient.message_type);
665 setuv (format, xe->xclient.format); 576 setuv (format, xe->xclient.format);
666 setuv (l0, xe->xclient.data.l[0]); 577 setuv (l0, xe->xclient.data.l[0]);
667 setuv (l1, xe->xclient.data.l[1]); 578 setuv (l1, xe->xclient.data.l[1]);
668 setuv (l2, xe->xclient.data.l[2]); 579 setuv (l2, xe->xclient.data.l[2]);
669 setuv (l3, xe->xclient.data.l[3]); 580 setuv (l3, xe->xclient.data.l[3]);
670 setuv (l4, xe->xclient.data.l[4]); 581 setuv (l4, xe->xclient.data.l[4]);
671 break; 582 break;
672 } 583 }
673 584
674 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 585 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
675 } 586 }
676 break; 587 break;
677 588
678 case DT_END: 589 case DT_END:
679 goto call; 590 goto call;
680 591
681 default: 592 default:
682 rxvt_fatal ("FATAL: unable to pass data type %d\n", dt); 593 rxvt_fatal ("FATAL: unable to pass data type %d\n", dt);
683 } 594 }
595 }
596
597 call:
598 va_end (ap);
599
600 PUTBACK;
601 int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL);
602 SPAGAIN;
603
604 if (count)
605 {
606 SV *status = POPs;
607 count = SvTRUE (status);
684 } 608 }
685 609
686 call:
687 va_end (ap);
688
689 PUTBACK; 610 PUTBACK;
690 int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL);
691 SPAGAIN;
692
693 if (count)
694 {
695 SV *status = POPs;
696 count = SvTRUE (status);
697 }
698
699 PUTBACK;
700 FREETMPS; 611 FREETMPS;
701 LEAVE; 612 LEAVE;
702 613
703 if (SvTRUE (ERRSV)) 614 if (SvTRUE (ERRSV))
704 { 615 {
705 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); 616 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPVbyte_nolen (ERRSV));
706 ungrab (term); // better lose the grab than the session 617 ungrab (term); // better lose the grab than the session
707 } 618 }
708 619
709 event_consumed = !!count; 620 event_consumed = !!count;
710 } 621 }
711 catch (...)
712 {
713 swap (perl_environ, environ);
714 throw;
715 }
716 else 622 else
717 event_consumed = false; 623 event_consumed = false;
718 624
719 // post-handling of some events 625 // post-handling of some events
720 if (htype == HOOK_REFRESH_BEGIN) 626 if (htype == HOOK_REFRESH_BEGIN)
721 { 627 {
722 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); 628 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
723 629
724 for (int i = AvFILL (av); i >= 0; i--) 630 for (int i = AvFILL (av); i >= 0; i--)
725 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 631 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
726 } 632 }
727 else if (htype == HOOK_DESTROY) 633 else if (htype == HOOK_DESTROY)
728 { 634 {
729 clearSVptr ((SV *)term->perl.self); 635 clearSVptr ((SV *)term->perl.self);
730 SvREFCNT_dec ((SV *)term->perl.self); 636 SvREFCNT_dec ((SV *)term->perl.self);
731 637
732 // don't allow further calls 638 // don't allow further calls
733 term->perl.self = 0; 639 term->perl.self = 0;
734 } 640 }
735 641
736 swap (perl_environ, environ);
737
738 return event_consumed; 642 return event_consumed;
643}
644
645void
646rxvt_perl_interp::selection_finish (rxvt_selection *sel, char *data, unsigned int len)
647{
648 localise_env set_environ (perl_environ);
649
650 ENTER;
651 SAVETMPS;
652
653 dSP;
654 XPUSHs (sv_2mortal (newSVpvn (data, len)));
655 call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL);
656
657 if (SvTRUE (ERRSV))
658 rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV));
659
660 FREETMPS;
661 LEAVE;
739} 662}
740 663
741///////////////////////////////////////////////////////////////////////////// 664/////////////////////////////////////////////////////////////////////////////
742 665
743MODULE = urxvt PACKAGE = urxvt 666MODULE = urxvt PACKAGE = urxvt
755# define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); 678# define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0));
756# include "hookinc.h" 679# include "hookinc.h"
757# undef def 680# undef def
758 681
759 HV *option = get_hv ("urxvt::OPTION", 1); 682 HV *option = get_hv ("urxvt::OPTION", 1);
760# define def(name,val) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); 683# define def(name) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0);
761# define nodef(name) 684# define nodef(name)
762# include "optinc.h" 685# include "optinc.h"
763# undef nodef 686# undef nodef
764# undef def 687# undef def
765 688
767 static const struct { 690 static const struct {
768 const char *name; 691 const char *name;
769 IV iv; 692 IV iv;
770 } *civ, const_iv[] = { 693 } *civ, const_iv[] = {
771# define const_iv(name) { # name, (IV)name } 694# define const_iv(name) { # name, (IV)name }
695 const_iv (NUM_RESOURCES),
772 const_iv (DEFAULT_RSTYLE), 696 const_iv (DEFAULT_RSTYLE),
773 const_iv (OVERLAY_RSTYLE), 697 const_iv (OVERLAY_RSTYLE),
698 const_iv (Color_Bits),
699 const_iv (RS_bgShift), const_iv (RS_bgMask),
700 const_iv (RS_fgShift), const_iv (RS_fgMask),
701 const_iv (RS_Careful),
702 const_iv (RS_fontCount),
703 const_iv (RS_fontShift),
704 const_iv (RS_fontMask),
705 const_iv (RS_baseattrMask),
706 const_iv (RS_attrMask),
707 const_iv (RS_redraw),
708 const_iv (RS_Sel),
774 const_iv (RS_Bold), 709 const_iv (RS_Bold),
775 const_iv (RS_Italic), 710 const_iv (RS_Italic),
776 const_iv (RS_Blink), 711 const_iv (RS_Blink),
777 const_iv (RS_RVid), 712 const_iv (RS_RVid),
778 const_iv (RS_Uline), 713 const_iv (RS_Uline),
791 const_iv (Button3Mask), 726 const_iv (Button3Mask),
792 const_iv (Button4Mask), 727 const_iv (Button4Mask),
793 const_iv (Button5Mask), 728 const_iv (Button5Mask),
794 const_iv (AnyModifier), 729 const_iv (AnyModifier),
795 730
796 const_iv (EVENT_NONE), 731 const_iv (NoSymbol),
797 const_iv (EVENT_READ), 732 const_iv (GrabModeSync),
798 const_iv (EVENT_WRITE), 733 const_iv (GrabModeAsync),
799 734
800 const_iv (NoEventMask), 735 const_iv (NoEventMask),
801 const_iv (KeyPressMask), 736 const_iv (KeyPressMask),
802 const_iv (KeyReleaseMask), 737 const_iv (KeyReleaseMask),
803 const_iv (ButtonPressMask), 738 const_iv (ButtonPressMask),
865 const_iv (XIMSecondary), 800 const_iv (XIMSecondary),
866 const_iv (XIMTertiary), 801 const_iv (XIMTertiary),
867 const_iv (XIMVisibleToForward), 802 const_iv (XIMVisibleToForward),
868 const_iv (XIMVisibleToBackword), 803 const_iv (XIMVisibleToBackword),
869 const_iv (XIMVisibleToCenter), 804 const_iv (XIMVisibleToCenter),
805#if HAVE_XRENDER
806 const_iv (PictStandardARGB32),
807 const_iv (PictStandardRGB24),
808 const_iv (PictStandardA8),
809 const_iv (PictStandardA4),
810 const_iv (PictStandardA1),
811#endif
870# if 0 812# if 0
871 const_iv (XIMForwardChar), 813 const_iv (XIMForwardChar),
872 const_iv (XIMBackwardChar), 814 const_iv (XIMBackwardChar),
873 const_iv (XIMForwardWord), 815 const_iv (XIMForwardWord),
874 const_iv (XIMBackwardWord), 816 const_iv (XIMBackwardWord),
882 const_iv (XIMDontChange), 824 const_iv (XIMDontChange),
883# endif 825# endif
884# endif 826# endif
885 }; 827 };
886 828
887 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 829 for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--)
888 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 830 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
889} 831}
890 832
891void 833void
892warn (const char *msg) 834warn (const char *msg)
893 CODE: 835 CODE:
902_exit (int status) 844_exit (int status)
903 845
904NV 846NV
905NOW () 847NOW ()
906 CODE: 848 CODE:
907 RETVAL = NOW; 849 RETVAL = ev::now ();
908 OUTPUT: 850 OUTPUT:
909 RETVAL 851 RETVAL
910 852
911int 853int
912GET_BASEFG (int rend) 854GET_BASEFG (int rend)
937 RETVAL 879 RETVAL
938 880
939int 881int
940GET_CUSTOM (int rend) 882GET_CUSTOM (int rend)
941 CODE: 883 CODE:
942 RETVAL = (rend && RS_customMask) >> RS_customShift; 884 RETVAL = (rend & RS_customMask) >> RS_customShift;
943 OUTPUT: 885 OUTPUT:
944 RETVAL 886 RETVAL
945 887
946int 888int
947SET_CUSTOM (int rend, int new_value) 889SET_CUSTOM (int rend, int new_value)
965 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) 907 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
966 if ((*t)->perl.self) 908 if ((*t)->perl.self)
967 PUSHs (sv_2mortal (newSVterm (*t))); 909 PUSHs (sv_2mortal (newSVterm (*t)));
968} 910}
969 911
912IV
913_new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb)
914 CODE:
915 rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term);
916 req->cb_sv = newSVsv (cb);
917 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0));
918 av_push (av, newSViv ((IV)req));
919 RETVAL = (IV)req;
920 OUTPUT:
921 RETVAL
922
923void
924_delete_selection_request (IV req_)
925 CODE:
926 rxvt_selection *req = (rxvt_selection *)req_;
927 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)req->term->perl.self), "_selection", 10, 0));
928 int i;
929
930 for (i = AvFILL (av); i >= 0; i--)
931 if (SvIV (*av_fetch (av, i, 1)) == req_)
932 break;
933
934 for (; i < AvFILL (av); i++)
935 av_store (av, i, SvREFCNT_inc (*av_fetch (av, i + 1, 0)));
936
937 av_pop (av);
938
939 delete req;
940
970MODULE = urxvt PACKAGE = urxvt::term 941MODULE = urxvt PACKAGE = urxvt::term
971 942
972SV * 943SV *
973_new (AV *env, AV *arg) 944_new (AV *env, AV *arg)
974 CODE: 945 CODE:
975{ 946{
976 rxvt_term *term = new rxvt_term; 947 rxvt_term *term = new rxvt_term;
977 948
978 stringvec *argv = new stringvec; 949 stringvec *argv = new stringvec;
979 stringvec *envv = new stringvec;
980
981 for (int i = 0; i <= AvFILL (arg); i++) 950 for (int i = 0; i <= AvFILL (arg); i++)
982 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); 951 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1))));
983 952
953 stringvec *envv = new stringvec;
984 for (int i = AvFILL (env) + 1; i--; ) 954 for (int i = AvFILL (env) + 1; i--; )
985 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); 955 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
986 956
987 envv->push_back (0);
988
989 bool success;
990
991 try 957 try
992 { 958 {
993 success = term->init (argv, envv); 959 term->init (argv, envv);
994 } 960 }
995 catch (const class rxvt_failure_exception &e) 961 catch (const class rxvt_failure_exception &e)
996 {
997 success = false;
998 }
999
1000 if (!success)
1001 { 962 {
1002 term->destroy (); 963 term->destroy ();
1003 croak ("error while initializing new terminal instance"); 964 croak ("error while initializing new terminal instance");
1004 } 965 }
1005 966
1015void 976void
1016rxvt_term::set_should_invoke (int htype, int inc) 977rxvt_term::set_should_invoke (int htype, int inc)
1017 CODE: 978 CODE:
1018 THIS->perl.should_invoke [htype] += inc; 979 THIS->perl.should_invoke [htype] += inc;
1019 980
1020void 981int
1021rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) 982rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
1022 CODE: 983 CODE:
1023 XGrabButton (THIS->dpy, button, modifiers, window, 1, 984 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
1024 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, 985 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1025 GrabModeSync, GrabModeSync, None, GRAB_CURSOR); 986 GrabModeSync, GrabModeSync, None, GRAB_CURSOR);
987 OUTPUT: RETVAL
1026 988
1027void 989int
1028rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) 990rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt)
1029 CODE: 991 CODE:
1030 XUngrabButton (THIS->dpy, button, modifiers, window); 992 RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window);
993 OUTPUT: RETVAL
1031 994
1032#if 0
1033
1034void 995void
1035XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 996rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \
1036 C_ARGS: 997 int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync)
1037 THIS->dpy, keycode, modifiers, window, 1, 998 CODE:
1038 GrabModeSync, GrabModeSync 999 XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode);
1039 1000
1040void 1001void
1041XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1002rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
1003 CODE:
1042 C_ARGS: THIS->dpy, keycode, modifiers, window 1004 XUngrabKey (THIS->dpy, keycode, modifiers, window);
1043
1044#endif
1045 1005
1046bool 1006bool
1047rxvt_term::grab (Time eventtime, int sync = 0) 1007rxvt_term::grab (Time eventtime, int sync = 0)
1048 CODE: 1008 CODE:
1049{ 1009{
1084rxvt_term::ungrab () 1044rxvt_term::ungrab ()
1085 CODE: 1045 CODE:
1086 ungrab (THIS); 1046 ungrab (THIS);
1087 1047
1088int 1048int
1049rxvt_term::XStringToKeysym (char *string)
1050 CODE:
1051 RETVAL = XStringToKeysym (string);
1052 OUTPUT: RETVAL
1053
1054char *
1055rxvt_term::XKeysymToString (int sym)
1056 CODE:
1057 RETVAL = XKeysymToString (sym);
1058 OUTPUT: RETVAL
1059
1060int
1061rxvt_term::XKeysymToKeycode (int sym)
1062 CODE:
1063 RETVAL = XKeysymToKeycode (THIS->dpy, sym);
1064 OUTPUT: RETVAL
1065
1066int
1067rxvt_term::XKeycodeToKeysym (int code, int index)
1068 CODE:
1069 RETVAL = XKeycodeToKeysym (THIS->dpy, code, index);
1070 OUTPUT: RETVAL
1071
1072int
1089rxvt_term::strwidth (SV *str) 1073rxvt_term::strwidth (SV *str)
1090 CODE: 1074 CODE:
1091{ 1075{
1092 wchar_t *wstr = sv2wcs (str); 1076 wchar_t *wstr = sv2wcs (str);
1093 1077
1094 rxvt_push_locale (THIS->locale); 1078 rxvt_push_locale (THIS->locale);
1095 RETVAL = wcswidth (wstr, wcslen (wstr)); 1079 RETVAL = 0;
1080 for (wchar_t *wc = wstr; *wc; wc++)
1081 {
1082 int w = WCWIDTH (*wc);
1083
1084 if (w)
1085 RETVAL += max (w, 1);
1086 }
1096 rxvt_pop_locale (); 1087 rxvt_pop_locale ();
1097 1088
1098 free (wstr); 1089 free (wstr);
1099} 1090}
1100 OUTPUT: 1091 OUTPUT:
1135 OUTPUT: 1126 OUTPUT:
1136 RETVAL 1127 RETVAL
1137 1128
1138#define TERM_OFFSET(sym) offsetof (TermWin_t, sym) 1129#define TERM_OFFSET(sym) offsetof (TermWin_t, sym)
1139 1130
1140#define TERM_OFFSET_width TERM_OFFSET(width) 1131#define TERM_OFFSET_width TERM_OFFSET(width)
1141#define TERM_OFFSET_height TERM_OFFSET(height) 1132#define TERM_OFFSET_height TERM_OFFSET(height)
1142#define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) 1133#define TERM_OFFSET_fwidth TERM_OFFSET(fwidth)
1143#define TERM_OFFSET_fheight TERM_OFFSET(fheight) 1134#define TERM_OFFSET_fheight TERM_OFFSET(fheight)
1144#define TERM_OFFSET_fbase TERM_OFFSET(fbase) 1135#define TERM_OFFSET_fbase TERM_OFFSET(fbase)
1145#define TERM_OFFSET_nrow TERM_OFFSET(nrow) 1136#define TERM_OFFSET_nrow TERM_OFFSET(nrow)
1146#define TERM_OFFSET_ncol TERM_OFFSET(ncol) 1137#define TERM_OFFSET_ncol TERM_OFFSET(ncol)
1147#define TERM_OFFSET_focus TERM_OFFSET(focus) 1138#define TERM_OFFSET_focus TERM_OFFSET(focus)
1148#define TERM_OFFSET_mapped TERM_OFFSET(mapped) 1139#define TERM_OFFSET_mapped TERM_OFFSET(mapped)
1149#define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth) 1140#define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth)
1150#define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth) 1141#define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth)
1151#define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace) 1142#define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace)
1143#define TERM_OFFSET_letterSpace TERM_OFFSET(letterSpace)
1152#define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) 1144#define TERM_OFFSET_saveLines TERM_OFFSET(saveLines)
1153#define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) 1145#define TERM_OFFSET_total_rows TERM_OFFSET(total_rows)
1154#define TERM_OFFSET_top_row TERM_OFFSET(top_row) 1146#define TERM_OFFSET_top_row TERM_OFFSET(top_row)
1155 1147
1156int 1148int
1157rxvt_term::width () 1149rxvt_term::width ()
1158 ALIAS: 1150 ALIAS:
1159 width = TERM_OFFSET_width 1151 width = TERM_OFFSET_width
1160 height = TERM_OFFSET_height 1152 height = TERM_OFFSET_height
1161 fwidth = TERM_OFFSET_fwidth 1153 fwidth = TERM_OFFSET_fwidth
1162 fheight = TERM_OFFSET_fheight 1154 fheight = TERM_OFFSET_fheight
1163 fbase = TERM_OFFSET_fbase 1155 fbase = TERM_OFFSET_fbase
1164 nrow = TERM_OFFSET_nrow 1156 nrow = TERM_OFFSET_nrow
1165 ncol = TERM_OFFSET_ncol 1157 ncol = TERM_OFFSET_ncol
1166 focus = TERM_OFFSET_focus 1158 focus = TERM_OFFSET_focus
1167 mapped = TERM_OFFSET_mapped 1159 mapped = TERM_OFFSET_mapped
1168 int_bwidth = TERM_OFFSET_int_bwidth 1160 int_bwidth = TERM_OFFSET_int_bwidth
1169 ext_bwidth = TERM_OFFSET_ext_bwidth 1161 ext_bwidth = TERM_OFFSET_ext_bwidth
1170 lineSpace = TERM_OFFSET_lineSpace 1162 lineSpace = TERM_OFFSET_lineSpace
1163 letterSpace = TERM_OFFSET_letterSpace
1171 saveLines = TERM_OFFSET_saveLines 1164 saveLines = TERM_OFFSET_saveLines
1172 total_rows = TERM_OFFSET_total_rows 1165 total_rows = TERM_OFFSET_total_rows
1173 top_row = TERM_OFFSET_top_row 1166 top_row = TERM_OFFSET_top_row
1174 CODE: 1167 CODE:
1175 RETVAL = *(int *)((char *)THIS + ix); 1168 RETVAL = *(int *)((char *)THIS + ix);
1176 OUTPUT: 1169 OUTPUT:
1177 RETVAL 1170 RETVAL
1178 1171
1189 { 1182 {
1190 case 0: RETVAL = THIS->ModLevel3Mask; break; 1183 case 0: RETVAL = THIS->ModLevel3Mask; break;
1191 case 1: RETVAL = THIS->ModMetaMask; break; 1184 case 1: RETVAL = THIS->ModMetaMask; break;
1192 case 2: RETVAL = THIS->ModNumLockMask; break; 1185 case 2: RETVAL = THIS->ModNumLockMask; break;
1193 case 3: RETVAL = THIS->current_screen; break; 1186 case 3: RETVAL = THIS->current_screen; break;
1187#ifdef CURSOR_BLINK
1194 case 4: RETVAL = THIS->hidden_cursor; break; 1188 case 4: RETVAL = THIS->hidden_cursor; break;
1189#endif
1195 } 1190 }
1196 OUTPUT: 1191 OUTPUT:
1197 RETVAL 1192 RETVAL
1198 1193
1199char * 1194char *
1209 } 1204 }
1210 OUTPUT: 1205 OUTPUT:
1211 RETVAL 1206 RETVAL
1212 1207
1213SV * 1208SV *
1214rxvt_term::_env () 1209rxvt_term::envv ()
1210 ALIAS:
1211 argv = 1
1215 CODE: 1212 PPCODE:
1216{ 1213{
1217 if (THIS->envv) 1214 stringvec *vec = ix ? THIS->argv : THIS->envv;
1218 {
1219 AV *av = newAV ();
1220 1215
1216 EXTEND (SP, vec->size ());
1217
1221 for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) 1218 for (char **i = vec->begin (); i != vec->end (); ++i)
1222 if (*i) 1219 if (*i)
1223 av_push (av, newSVpv (*i, 0)); 1220 PUSHs (sv_2mortal (newSVpv (*i, 0)));
1224
1225 RETVAL = newRV_noinc ((SV *)av);
1226 }
1227 else
1228 RETVAL = &PL_sv_undef;
1229} 1221}
1230 OUTPUT:
1231 RETVAL
1232 1222
1233int 1223int
1234rxvt_term::pty_ev_events (int events = EVENT_UNDEF) 1224rxvt_term::pty_ev_events (int events = ev::UNDEF)
1235 CODE: 1225 CODE:
1236 RETVAL = THIS->pty_ev.events; 1226 RETVAL = THIS->pty_ev.events;
1237 if (events != EVENT_UNDEF) 1227 if (events != ev::UNDEF)
1238 THIS->pty_ev.set (events); 1228 THIS->pty_ev.set (events);
1239 OUTPUT: 1229 OUTPUT:
1240 RETVAL 1230 RETVAL
1241 1231
1242int 1232int
1247 RETVAL 1237 RETVAL
1248 1238
1249Window 1239Window
1250rxvt_term::parent () 1240rxvt_term::parent ()
1251 CODE: 1241 CODE:
1252 RETVAL = THIS->parent [0]; 1242 RETVAL = THIS->parent;
1253 OUTPUT: 1243 OUTPUT:
1254 RETVAL 1244 RETVAL
1255 1245
1256Window 1246Window
1257rxvt_term::vt () 1247rxvt_term::vt ()
1284 if (newval <= 0) 1274 if (newval <= 0)
1285 THIS->scr_changeview (max (newval, THIS->top_row)); 1275 THIS->scr_changeview (max (newval, THIS->top_row));
1286} 1276}
1287 OUTPUT: 1277 OUTPUT:
1288 RETVAL 1278 RETVAL
1279
1280void
1281rxvt_term::set_urgency (bool enable)
1289 1282
1290void 1283void
1291rxvt_term::focus_in () 1284rxvt_term::focus_in ()
1292 1285
1293void 1286void
1321 1314
1322void 1315void
1323rxvt_term::want_refresh () 1316rxvt_term::want_refresh ()
1324 CODE: 1317 CODE:
1325 THIS->want_refresh = 1; 1318 THIS->want_refresh = 1;
1319 THIS->refresh_check ();
1326 1320
1327void 1321void
1328rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) 1322rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS)
1329 PPCODE: 1323 PPCODE:
1330{ 1324{
1485SV * 1479SV *
1486rxvt_term::special_decode (SV *text) 1480rxvt_term::special_decode (SV *text)
1487 CODE: 1481 CODE:
1488{ 1482{
1489 wchar_t *wstr = sv2wcs (text); 1483 wchar_t *wstr = sv2wcs (text);
1490 int wlen = wcslen (wstr);
1491 int dlen = 0; 1484 int dlen = 0;
1492 1485
1493 // find length 1486 // find length
1494 for (wchar_t *s = wstr; *s; s++) 1487 for (wchar_t *s = wstr; *s; s++)
1495 if (*s == NOCHAR) 1488 if (*s == NOCHAR)
1526# include "rsinc.h" 1519# include "rsinc.h"
1527# undef def 1520# undef def
1528# undef reserve 1521# undef reserve
1529 }; 1522 };
1530 1523
1531 rs = rslist + sizeof (rslist) / sizeof (rslist [0]); 1524 rs = rslist + ecb_array_length (rslist);
1532 1525
1526 if (*name)
1533 do { 1527 {
1528 do {
1534 if (rs-- == rslist) 1529 if (rs-- == rslist)
1535 croak ("no such resource '%s', requested", name); 1530 croak ("no such resource '%s', requested", name);
1536 } while (strcmp (name, rs->name)); 1531 } while (strcmp (name, rs->name));
1537 1532
1538 index += rs->value; 1533 index += rs->value;
1534 }
1535 else
1536 {
1537 --rs;
1538 name = "";
1539 }
1539 1540
1540 if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) 1541 if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES))
1541 croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); 1542 croak ("requested out-of-bound resource %s+%d,", name, index - rs->value);
1542 1543
1543 if (GIMME_V != G_VOID) 1544 if (GIMME_V != G_VOID)
1558 1559
1559const char * 1560const char *
1560rxvt_term::x_resource (const char *name) 1561rxvt_term::x_resource (const char *name)
1561 1562
1562bool 1563bool
1563rxvt_term::option (U32 optval, int set = -1) 1564rxvt_term::option (U8 optval, int set = -1)
1564 CODE: 1565 CODE:
1565{ 1566{
1566 RETVAL = THIS->options & optval; 1567 RETVAL = THIS->option (optval);
1567 1568
1568 if (set >= 0) 1569 if (set >= 0)
1569 { 1570 {
1570 if (set)
1571 THIS->options |= optval; 1571 THIS->set_option (optval, set);
1572 else
1573 THIS->options &= ~optval;
1574 1572
1575 if (THIS->check_ev.is_active ()) // avoid doing this before START 1573 if (THIS->init_done) // avoid doing this before START
1576 switch (optval) 1574 switch (optval)
1577 { 1575 {
1578 case Opt_skipBuiltinGlyphs: 1576 case Opt_skipBuiltinGlyphs:
1579 THIS->set_fonts (); 1577 THIS->set_fonts ();
1580 THIS->scr_remap_chars (); 1578 THIS->scr_remap_chars ();
1581 THIS->scr_touch (true); 1579 THIS->scr_touch (true);
1582 THIS->want_refresh = 1; 1580 THIS->want_refresh = 1;
1581 THIS->refresh_check ();
1583 break; 1582 break;
1583#ifdef CURSOR_BLINK
1584 case Opt_cursorBlink:
1585 THIS->cursor_blink_reset ();
1586 break;
1587#endif
1584 1588
1585 case Opt_cursorUnderline: 1589 case Opt_cursorUnderline:
1586 THIS->want_refresh = 1; 1590 THIS->want_refresh = 1;
1591 THIS->refresh_check ();
1587 break; 1592 break;
1588 1593
1589# case Opt_scrollBar_floating: 1594# case Opt_scrollBar_floating:
1590# case Opt_scrollBar_right: 1595# case Opt_scrollBar_right:
1591# THIS->resize_all_windows (THIS->width, THIS->height, 1); 1596# THIS->resize_all_windows (THIS->width, THIS->height, 1);
1601 CODE: 1606 CODE:
1602 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1607 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1603 THIS->keyboard->register_done (); 1608 THIS->keyboard->register_done ();
1604 OUTPUT: 1609 OUTPUT:
1605 RETVAL 1610 RETVAL
1611
1612void
1613rxvt_term::register_command (int keysym, unsigned int state, SV *str)
1614 CODE:
1615 wchar_t *wstr = sv2wcs (str);
1616 THIS->keyboard->register_user_translation (keysym, state, wstr);
1617 free (wstr);
1606 1618
1607void 1619void
1608rxvt_term::screen_cur (...) 1620rxvt_term::screen_cur (...)
1609 PROTOTYPE: $;$$ 1621 PROTOTYPE: $;$$
1610 ALIAS: 1622 ALIAS:
1624 EXTEND (SP, 2); 1636 EXTEND (SP, 2);
1625 PUSHs (sv_2mortal (newSViv (rc.row))); 1637 PUSHs (sv_2mortal (newSViv (rc.row)));
1626 PUSHs (sv_2mortal (newSViv (rc.col))); 1638 PUSHs (sv_2mortal (newSViv (rc.col)));
1627 } 1639 }
1628 1640
1629 if (items == 3) 1641 if (items >= 3)
1630 { 1642 {
1631 rc.row = SvIV (ST (1)); 1643 rc.row = SvIV (ST (1));
1632 rc.col = SvIV (ST (2)); 1644 rc.col = SvIV (ST (2));
1633 1645
1634 if (ix == 2) 1646 if (ix == 2)
1649 1661
1650 clamp_it (rc.col, 0, THIS->ncol); 1662 clamp_it (rc.col, 0, THIS->ncol);
1651 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); 1663 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
1652 1664
1653 if (ix) 1665 if (ix)
1666 {
1667 THIS->selection.screen = THIS->current_screen;
1668
1654 THIS->want_refresh = 1; 1669 THIS->want_refresh = 1;
1670 THIS->refresh_check ();
1655 } 1671 }
1672 }
1656} 1673}
1657 1674
1658char 1675int
1659rxvt_term::cur_charset () 1676rxvt_term::selection_screen (int screen = -1)
1660 CODE: 1677 CODE:
1661 RETVAL = THIS->charsets [THIS->screen.charset]; 1678 RETVAL = THIS->selection.screen;
1662 OUTPUT: 1679 if (screen >= 0)
1680 THIS->selection.screen = screen;
1681 OUTPUT:
1663 RETVAL 1682 RETVAL
1664 1683
1665void 1684void
1666rxvt_term::selection_clear () 1685rxvt_term::selection_clear (bool clipboard = false)
1667 1686
1668void 1687void
1669rxvt_term::selection_make (Time eventtime, bool rect = false) 1688rxvt_term::selection_make (Time eventtime, bool rect = false)
1670 CODE: 1689 CODE:
1671 THIS->selection.op = SELECTION_CONT; 1690 THIS->selection.op = SELECTION_CONT;
1672 THIS->selection.rect = rect; 1691 THIS->selection.rect = rect;
1673 THIS->selection_make (eventtime); 1692 THIS->selection_make (eventtime);
1674 1693
1675int 1694int
1676rxvt_term::selection_grab (Time eventtime) 1695rxvt_term::selection_grab (Time eventtime, bool clipboard = false)
1677 1696
1678void 1697void
1679rxvt_term::selection (SV *newtext = 0) 1698rxvt_term::selection (SV *newtext = 0, bool clipboard = false)
1680 PPCODE: 1699 PPCODE:
1681{ 1700{
1701 wchar_t * &text = clipboard ? THIS->selection.clip_text : THIS->selection.text;
1702 unsigned int &len = clipboard ? THIS->selection.clip_len : THIS->selection.len;
1703
1682 if (GIMME_V != G_VOID) 1704 if (GIMME_V != G_VOID)
1683 XPUSHs (THIS->selection.text 1705 XPUSHs (text
1684 ? sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)) 1706 ? sv_2mortal (wcs2sv (text, len))
1685 : &PL_sv_undef); 1707 : &PL_sv_undef);
1686 1708
1687 if (newtext) 1709 if (newtext)
1688 { 1710 {
1689 free (THIS->selection.text); 1711 free (text);
1690 1712
1691 THIS->selection.text = sv2wcs (newtext); 1713 text = sv2wcs (newtext);
1692 THIS->selection.len = wcslen (THIS->selection.text); 1714 len = wcslen (text);
1693 } 1715 }
1694} 1716}
1717
1718char
1719rxvt_term::cur_charset ()
1720 CODE:
1721 RETVAL = THIS->charsets [THIS->screen.charset];
1722 OUTPUT:
1723 RETVAL
1695 1724
1696void 1725void
1697rxvt_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) 1726rxvt_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)
1698 1727
1699void 1728void
1721 char *str = SvPVbyte (octets, len); 1750 char *str = SvPVbyte (octets, len);
1722 C_ARGS: 1751 C_ARGS:
1723 str, len 1752 str, len
1724 1753
1725void 1754void
1755rxvt_term::tt_paste (SV *octets)
1756 INIT:
1757 STRLEN len;
1758 char *str = SvPVbyte (octets, len);
1759 C_ARGS:
1760 str, len
1761
1762void
1726rxvt_term::cmd_parse (SV *octets) 1763rxvt_term::cmd_parse (SV *octets)
1727 CODE: 1764 CODE:
1728{ 1765{
1729 STRLEN len; 1766 STRLEN len;
1730 char *str = SvPVbyte (octets, len); 1767 char *str = SvPVbyte (octets, len);
1766 Atom *props = XListProperties (THIS->dpy, window, &count); 1803 Atom *props = XListProperties (THIS->dpy, window, &count);
1767 1804
1768 EXTEND (SP, count); 1805 EXTEND (SP, count);
1769 while (count--) 1806 while (count--)
1770 PUSHs (newSVuv ((U32)props [count])); 1807 PUSHs (newSVuv ((U32)props [count]));
1771 1808
1772 XFree (props); 1809 XFree (props);
1773} 1810}
1774 1811
1775void 1812void
1776rxvt_term::XGetWindowProperty (Window window, Atom property) 1813rxvt_term::XGetWindowProperty (Window window, Atom property)
1799 XFree (prop); 1836 XFree (prop);
1800 } 1837 }
1801} 1838}
1802 1839
1803void 1840void
1804rxvt_term::XChangeWindowProperty (Window window, Atom property, Atom type, int format, SV *data) 1841rxvt_term::XChangeProperty (Window window, Atom property, Atom type, int format, SV *data)
1805 CODE: 1842 CODE:
1806{ 1843{
1807 STRLEN len; 1844 STRLEN len;
1808 char *data_ = SvPVbyte (data, len); 1845 char *data_ = SvPVbyte (data, len);
1809 1846
1812 : 1; 1849 : 1;
1813 1850
1814 XChangeProperty (THIS->dpy, window, property, 1851 XChangeProperty (THIS->dpy, window, property,
1815 type, format, PropModeReplace, 1852 type, format, PropModeReplace,
1816 (unsigned char *)data_, len / elemsize); 1853 (unsigned char *)data_, len / elemsize);
1817 XSync (THIS->dpy, 0);
1818} 1854}
1819 1855
1820Atom 1856Atom
1821XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) 1857XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
1822 C_ARGS: term->dpy, atom_name, only_if_exists 1858 C_ARGS: term->dpy, atom_name, only_if_exists
1889 PUSHs (newSVuv (child)); 1925 PUSHs (newSVuv (child));
1890 } 1926 }
1891} 1927}
1892 1928
1893############################################################################# 1929#############################################################################
1930# fancy bg bloatstuff (TODO: should be moved up somewhere)
1931
1932#ifdef ENABLE_TRANSPARENCY
1933
1934# rxvt_img *
1935# rxvt_term::new_root_img ()
1936# CODE:
1937# RETVAL = rxvt_img::new_from_root (THIS);
1938# OUTPUT:
1939# RETVAL
1940
1941#endif
1942
1943#if HAVE_PIXBUF
1944
1945#endif
1946
1947#############################################################################
1894# urxvt::overlay 1948# urxvt::overlay
1895############################################################################# 1949#############################################################################
1896 1950
1897MODULE = urxvt PACKAGE = urxvt::overlay 1951MODULE = urxvt PACKAGE = urxvt::overlay
1898 1952
1906overlay::hide () 1960overlay::hide ()
1907 1961
1908void 1962void
1909overlay::DESTROY () 1963overlay::DESTROY ()
1910 1964
1911############################################################################# 1965INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g |
1912# urxvt::watcher
1913#############################################################################
1914 1966
1915MODULE = urxvt PACKAGE = urxvt::watcher
1916
1917CHAINED
1918perl_watcher::cb (SV *cb)
1919 CODE:
1920 THIS->cb (cb);
1921 OUTPUT:
1922 RETVAL
1923
1924#############################################################################
1925# urxvt::timer
1926#############################################################################
1927
1928MODULE = urxvt PACKAGE = urxvt::timer
1929
1930SV *
1931timer::new ()
1932 CODE:
1933 timer *w = new timer;
1934 w->start (NOW);
1935 RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::timer");
1936 w->self = (HV *)SvRV (RETVAL);
1937 OUTPUT:
1938 RETVAL
1939
1940NV
1941timer::at ()
1942 CODE:
1943 RETVAL = THIS->at;
1944 OUTPUT:
1945 RETVAL
1946
1947CHAINED
1948timer::interval (NV interval)
1949 CODE:
1950 THIS->interval = interval;
1951 OUTPUT:
1952 RETVAL
1953
1954CHAINED
1955timer::set (NV tstamp)
1956 CODE:
1957 THIS->set (tstamp);
1958 OUTPUT:
1959 RETVAL
1960
1961CHAINED
1962timer::start (NV tstamp = THIS->at)
1963 CODE:
1964 THIS->start (tstamp);
1965 OUTPUT:
1966 RETVAL
1967
1968CHAINED
1969timer::after (NV delay)
1970 CODE:
1971 THIS->start (NOW + delay);
1972 OUTPUT:
1973 RETVAL
1974
1975CHAINED
1976timer::stop ()
1977 CODE:
1978 THIS->stop ();
1979 OUTPUT:
1980 RETVAL
1981
1982void
1983timer::DESTROY ()
1984
1985#############################################################################
1986# urxvt::iow
1987#############################################################################
1988
1989MODULE = urxvt PACKAGE = urxvt::iow 1967MODULE = urxvt PACKAGE = urxvt::pixbuf PREFIX = gdk_pixbuf_
1990 1968
1991SV * 1969#if HAVE_PIXBUF
1992iow::new ()
1993 CODE:
1994 iow *w = new iow;
1995 RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::iow");
1996 w->self = (HV *)SvRV (RETVAL);
1997 OUTPUT:
1998 RETVAL
1999 1970
2000CHAINED 1971urxvt::pixbuf gdk_pixbuf_new_from_file (SV *klass, octet_string filename)
2001iow::fd (int fd) 1972 C_ARGS: filename, 0
2002 CODE:
2003 THIS->fd = fd;
2004 OUTPUT:
2005 RETVAL
2006 1973
2007CHAINED
2008iow::events (short events)
2009 CODE:
2010 THIS->events = events;
2011 OUTPUT:
2012 RETVAL
2013
2014CHAINED
2015iow::start ()
2016 CODE:
2017 THIS->start ();
2018 OUTPUT:
2019 RETVAL
2020
2021CHAINED
2022iow::stop ()
2023 CODE:
2024 THIS->stop ();
2025 OUTPUT:
2026 RETVAL
2027
2028void 1974void
2029iow::DESTROY () 1975DESTROY (urxvt::pixbuf self)
1976 CODE:
1977 gdk_pixbuf_unref (self);
2030 1978
2031############################################################################# 1979#endif
2032# urxvt::iw
2033#############################################################################
2034 1980
2035MODULE = urxvt PACKAGE = urxvt::iw 1981MODULE = urxvt PACKAGE = urxvt::img
2036 1982
2037SV * 1983#if HAVE_IMG
2038iw::new ()
2039 CODE:
2040 iw *w = new iw;
2041 RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::iw");
2042 w->self = (HV *)SvRV (RETVAL);
2043 OUTPUT:
2044 RETVAL
2045 1984
2046CHAINED 1985# rxvt_img *new (rxvt_screen *screen, XRenderPictFormat *format, int width, int height)
2047iw::start () 1986# rxvt_img *rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap);
2048 CODE:
2049 THIS->start ();
2050 OUTPUT:
2051 RETVAL
2052 1987
2053CHAINED
2054iw::stop ()
2055 CODE:
2056 THIS->stop ();
2057 OUTPUT:
2058 RETVAL
2059
2060void 1988void
2061iw::DESTROY () 1989rxvt_img::fill (SV *c)
1990 INIT:
1991 rxvt_color rc;
1992 parse_color (THIS->s, rc, c);
1993 C_ARGS: rc
2062 1994
2063#############################################################################
2064# urxvt::pw
2065#############################################################################
2066
2067MODULE = urxvt PACKAGE = urxvt::pw
2068
2069SV *
2070pw::new ()
2071 CODE:
2072 pw *w = new pw;
2073 RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::pw");
2074 w->self = (HV *)SvRV (RETVAL);
2075 OUTPUT:
2076 RETVAL
2077
2078CHAINED
2079pw::start (int pid)
2080 CODE:
2081 THIS->start (pid);
2082 OUTPUT:
2083 RETVAL
2084
2085CHAINED
2086pw::stop ()
2087 CODE:
2088 THIS->stop ();
2089 OUTPUT:
2090 RETVAL
2091
2092void 1995void
2093pw::DESTROY () 1996rxvt_img::blur (int rh, int rv)
2094 1997
1998void
1999rxvt_img::brightness (double r, double g, double b, double a = 1.)
2095 2000
2001void
2002rxvt_img::contrast (double r, double g, double b, double a = 1.)
2003
2004rxvt_img *
2005rxvt_img::copy ()
2006
2007rxvt_img *
2008rxvt_img::scale (int new_width, int new_height)
2009
2010# rxvt_img *
2011# rxvt_img::transform (int new_width, int new_height, double matrix[16]);
2012
2013#endif
2014

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines