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.137 by root, Mon Feb 21 07:41:03 2011 UTC vs.
Revision 1.141 by sf-exg, Mon May 30 18:39:03 2011 UTC

341 " unshift @INC, '" LIBDIR "';" 341 " unshift @INC, '" LIBDIR "';"
342 "}" 342 "}"
343 "" 343 ""
344 "use urxvt;" 344 "use urxvt;"
345 }; 345 };
346 int argc = ARRAY_LENGTH(args); 346 int argc = ecb_array_length (args);
347 char **argv = args; 347 char **argv = args;
348 348
349 PERL_SYS_INIT3 (&argc, &argv, &environ); 349 PERL_SYS_INIT3 (&argc, &argv, &environ);
350 perl = perl_alloc (); 350 perl = perl_alloc ();
351 perl_construct (perl); 351 perl_construct (perl);
413 ENTER; 413 ENTER;
414 SAVETMPS; 414 SAVETMPS;
415 415
416 PUSHMARK (SP); 416 PUSHMARK (SP);
417 417
418 EXTEND (SP, 2);
418 XPUSHs (sv_2mortal (newSVterm (term))); 419 PUSHs (sv_2mortal (newSVterm (term)));
419 XPUSHs (sv_2mortal (newSViv (htype))); 420 PUSHs (sv_2mortal (newSViv (htype)));
420 421
421 for (;;) { 422 for (;;) {
422 data_type dt = (data_type)va_arg (ap, int); 423 data_type dt = (data_type)va_arg (ap, int);
423 424
424 switch (dt) 425 switch (dt)
581 FREETMPS; 582 FREETMPS;
582 LEAVE; 583 LEAVE;
583 584
584 if (SvTRUE (ERRSV)) 585 if (SvTRUE (ERRSV))
585 { 586 {
586 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); 587 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPVbyte_nolen (ERRSV));
587 ungrab (term); // better lose the grab than the session 588 ungrab (term); // better lose the grab than the session
588 } 589 }
589 590
590 event_consumed = !!count; 591 event_consumed = !!count;
591 } 592 }
608 // don't allow further calls 609 // don't allow further calls
609 term->perl.self = 0; 610 term->perl.self = 0;
610 } 611 }
611 612
612 return event_consumed; 613 return event_consumed;
614}
615
616void
617rxvt_perl_interp::selection_finish (rxvt_selection *sel, char *data, unsigned int len)
618{
619 localise_env set_environ (perl_environ);
620
621 ENTER;
622 SAVETMPS;
623
624 dSP;
625 XPUSHs (sv_2mortal (newSVpvn (data, len)));
626 call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL);
627
628 if (SvTRUE (ERRSV))
629 rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV));
630
631 FREETMPS;
632 LEAVE;
613} 633}
614 634
615///////////////////////////////////////////////////////////////////////////// 635/////////////////////////////////////////////////////////////////////////////
616 636
617MODULE = urxvt PACKAGE = urxvt 637MODULE = urxvt PACKAGE = urxvt
768 const_iv (XIMDontChange), 788 const_iv (XIMDontChange),
769# endif 789# endif
770# endif 790# endif
771 }; 791 };
772 792
773 for (civ = const_iv + ARRAY_LENGTH(const_iv); civ-- > const_iv; ) 793 for (civ = const_iv + ecb_array_length (const_iv); civ-- > const_iv; )
774 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 794 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
775} 795}
776 796
777void 797void
778warn (const char *msg) 798warn (const char *msg)
850 870
851 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) 871 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
852 if ((*t)->perl.self) 872 if ((*t)->perl.self)
853 PUSHs (sv_2mortal (newSVterm (*t))); 873 PUSHs (sv_2mortal (newSVterm (*t)));
854} 874}
875
876IV
877_new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb)
878 CODE:
879 rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term);
880 req->cb_sv = newSVsv (cb);
881 RETVAL = (IV)req;
882 OUTPUT:
883 RETVAL
884
885void
886_delete_selection_request (IV req_)
887 CODE:
888 rxvt_selection *req = (rxvt_selection *)req_;
889 delete req;
855 890
856MODULE = urxvt PACKAGE = urxvt::term 891MODULE = urxvt PACKAGE = urxvt::term
857 892
858SV * 893SV *
859_new (AV *env, AV *arg) 894_new (AV *env, AV *arg)
1167 RETVAL 1202 RETVAL
1168 1203
1169Window 1204Window
1170rxvt_term::parent () 1205rxvt_term::parent ()
1171 CODE: 1206 CODE:
1172 RETVAL = THIS->parent [0]; 1207 RETVAL = THIS->parent;
1173 OUTPUT: 1208 OUTPUT:
1174 RETVAL 1209 RETVAL
1175 1210
1176Window 1211Window
1177rxvt_term::vt () 1212rxvt_term::vt ()
1446# include "rsinc.h" 1481# include "rsinc.h"
1447# undef def 1482# undef def
1448# undef reserve 1483# undef reserve
1449 }; 1484 };
1450 1485
1451 rs = rslist + ARRAY_LENGTH(rslist); 1486 rs = rslist + ecb_array_length (rslist);
1452 1487
1453 if (*name) 1488 if (*name)
1454 { 1489 {
1455 do { 1490 do {
1456 if (rs-- == rslist) 1491 if (rs-- == rslist)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines