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.135 by sf-exg, Sat Dec 18 18:17:38 2010 UTC vs.
Revision 1.139 by root, Thu Mar 24 17:34:29 2011 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-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.
302 THIS->refresh_check (); 302 THIS->refresh_check ();
303} 303}
304 304
305///////////////////////////////////////////////////////////////////////////// 305/////////////////////////////////////////////////////////////////////////////
306 306
307#define IOM_CLASS "urxvt"
308#define IOM_WARN rxvt_warn
309#include "iom_perl.h" 307#include "iom_perl.h"
310 308
311///////////////////////////////////////////////////////////////////////////// 309/////////////////////////////////////////////////////////////////////////////
312 310
313struct rxvt_perl_interp rxvt_perl; 311struct rxvt_perl_interp rxvt_perl;
415 ENTER; 413 ENTER;
416 SAVETMPS; 414 SAVETMPS;
417 415
418 PUSHMARK (SP); 416 PUSHMARK (SP);
419 417
418 EXTEND (SP, 2);
420 XPUSHs (sv_2mortal (newSVterm (term))); 419 PUSHs (sv_2mortal (newSVterm (term)));
421 XPUSHs (sv_2mortal (newSViv (htype))); 420 PUSHs (sv_2mortal (newSViv (htype)));
422 421
423 for (;;) { 422 for (;;) {
424 data_type dt = (data_type)va_arg (ap, int); 423 data_type dt = (data_type)va_arg (ap, int);
425 424
426 switch (dt) 425 switch (dt)
583 FREETMPS; 582 FREETMPS;
584 LEAVE; 583 LEAVE;
585 584
586 if (SvTRUE (ERRSV)) 585 if (SvTRUE (ERRSV))
587 { 586 {
588 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));
589 ungrab (term); // better lose the grab than the session 588 ungrab (term); // better lose the grab than the session
590 } 589 }
591 590
592 event_consumed = !!count; 591 event_consumed = !!count;
593 } 592 }
610 // don't allow further calls 609 // don't allow further calls
611 term->perl.self = 0; 610 term->perl.self = 0;
612 } 611 }
613 612
614 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;
615} 633}
616 634
617///////////////////////////////////////////////////////////////////////////// 635/////////////////////////////////////////////////////////////////////////////
618 636
619MODULE = urxvt PACKAGE = urxvt 637MODULE = urxvt PACKAGE = urxvt
853 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++)
854 if ((*t)->perl.self) 872 if ((*t)->perl.self)
855 PUSHs (sv_2mortal (newSVterm (*t))); 873 PUSHs (sv_2mortal (newSVterm (*t)));
856} 874}
857 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;
890
858MODULE = urxvt PACKAGE = urxvt::term 891MODULE = urxvt PACKAGE = urxvt::term
859 892
860SV * 893SV *
861_new (AV *env, AV *arg) 894_new (AV *env, AV *arg)
862 CODE: 895 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines