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.43 by root, Sun Jan 8 08:49:20 2006 UTC vs.
Revision 1.46 by root, Mon Jan 9 01:36:56 2006 UTC

431 perl = 0; 431 perl = 0;
432 } 432 }
433 } 433 }
434} 434}
435 435
436static void
437ungrab (rxvt_term *THIS)
438{
439 if (THIS->perl.grabtime)
440 {
441 XUngrabKeyboard (THIS->display->display, THIS->perl.grabtime);
442 XUngrabPointer (THIS->display->display, THIS->perl.grabtime);
443 THIS->perl.grabtime = 0;
444 }
445}
446
436bool 447bool
437rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) 448rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
438{ 449{
439 if (!perl) 450 if (!perl)
440 return false; 451 return false;
582 PUTBACK; 593 PUTBACK;
583 FREETMPS; 594 FREETMPS;
584 LEAVE; 595 LEAVE;
585 596
586 if (SvTRUE (ERRSV)) 597 if (SvTRUE (ERRSV))
598 {
587 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); 599 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV));
600 ungrab (term); // better lose the grab than the session
601 }
588 602
589 if (htype == HOOK_DESTROY) 603 if (htype == HOOK_DESTROY)
590 { 604 {
591 clearSVptr ((SV *)term->perl.self); 605 clearSVptr ((SV *)term->perl.self);
592 SvREFCNT_dec ((SV *)term->perl.self); 606 SvREFCNT_dec ((SV *)term->perl.self);
693void 707void
694fatal (const char *msg) 708fatal (const char *msg)
695 CODE: 709 CODE:
696 rxvt_fatal ("%s", msg); 710 rxvt_fatal ("%s", msg);
697 711
712SV *
713untaint (SV *sv)
714 CODE:
715 RETVAL = newSVsv (sv);
716 SvTAINTED_off (RETVAL);
717 OUTPUT:
718 RETVAL
719
698NV 720NV
699NOW () 721NOW ()
700 CODE: 722 CODE:
701 RETVAL = NOW; 723 RETVAL = NOW;
702 OUTPUT: 724 OUTPUT:
782} 804}
783 OUTPUT: 805 OUTPUT:
784 RETVAL 806 RETVAL
785 807
786void 808void
787rxvt_term::allow_events_async (U32 eventtime = THIS->perl.grabtime) 809rxvt_term::allow_events_async ()
788 CODE: 810 CODE:
789 XAllowEvents (THIS->display->display, AsyncBoth, eventtime); 811 XAllowEvents (THIS->display->display, AsyncBoth, THIS->perl.grabtime);
790 812
791void 813void
792rxvt_term::allow_events_sync (U32 eventtime = THIS->perl.grabtime) 814rxvt_term::allow_events_sync ()
793 CODE: 815 CODE:
794 XAllowEvents (THIS->display->display, SyncBoth, eventtime); 816 XAllowEvents (THIS->display->display, SyncBoth, THIS->perl.grabtime);
795 817
796void 818void
797rxvt_term::allow_events_replay (U32 eventtime = THIS->perl.grabtime) 819rxvt_term::allow_events_replay ()
798 CODE: 820 CODE:
799 XAllowEvents (THIS->display->display, ReplayPointer, eventtime); 821 XAllowEvents (THIS->display->display, ReplayPointer, THIS->perl.grabtime);
800 XAllowEvents (THIS->display->display, ReplayKeyboard, eventtime); 822 XAllowEvents (THIS->display->display, ReplayKeyboard, THIS->perl.grabtime);
801 823
802void 824void
803rxvt_term::ungrab (U32 eventtime = THIS->perl.grabtime) 825rxvt_term::ungrab ()
804 CODE: 826 CODE:
805 THIS->perl.grabtime = 0; 827 ungrab (THIS);
806 XUngrabKeyboard (THIS->display->display, eventtime);
807 XUngrabPointer (THIS->display->display, eventtime);
808 828
809int 829int
810rxvt_term::strwidth (SV *str) 830rxvt_term::strwidth (SV *str)
811 CODE: 831 CODE:
812{ 832{
1216} 1236}
1217 OUTPUT: 1237 OUTPUT:
1218 RETVAL 1238 RETVAL
1219 1239
1220void 1240void
1221rxvt_term::cur (...) 1241rxvt_term::screen_cur (...)
1222 PROTOTYPE: $;$$ 1242 PROTOTYPE: $;$$
1223 ALIAS: 1243 ALIAS:
1224 screen_cur = 0 1244 screen_cur = 0
1225 selection_beg = 1 1245 selection_beg = 1
1226 selection_end = 2 1246 selection_end = 2
1255void 1275void
1256rxvt_term::selection (SV *newtext = 0) 1276rxvt_term::selection (SV *newtext = 0)
1257 PPCODE: 1277 PPCODE:
1258{ 1278{
1259 if (GIMME_V != G_VOID) 1279 if (GIMME_V != G_VOID)
1280 XPUSHs (THIS->selection.text
1260 XPUSHs (taint (sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)))); 1281 ? taint (sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)))
1282 : &PL_sv_undef);
1261 1283
1262 if (newtext) 1284 if (newtext)
1263 { 1285 {
1264 free (THIS->selection.text); 1286 free (THIS->selection.text);
1265 1287

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines