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.140 by sf-exg, Thu Apr 7 12:19:41 2011 UTC vs.
Revision 1.145 by sf-exg, Fri Dec 2 09:03:43 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);
367 if (perl) 367 if (perl)
368 { 368 {
369 // runs outside of perls ENV 369 // runs outside of perls ENV
370 term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); 370 term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term");
371 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); 371 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0);
372 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0);
372 } 373 }
373} 374}
374 375
375static void 376static void
376ungrab (rxvt_term *THIS) 377ungrab (rxvt_term *THIS)
396 { 397 {
397 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); 398 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
398 399
399 for (int i = 0; i <= AvFILL (av); i++) 400 for (int i = 0; i <= AvFILL (av); i++)
400 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 401 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
402 }
403 else if (htype == HOOK_DESTROY)
404 {
405 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0));
406
407 for (int i = AvFILL (av); i >= 0; i--)
408 {
409 rxvt_selection *req = (rxvt_selection *)SvIV (*av_fetch (av, i, 0));
410 delete req;
411 }
401 } 412 }
402 413
403 bool event_consumed; 414 bool event_consumed;
404 415
405 if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always 416 if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always
788 const_iv (XIMDontChange), 799 const_iv (XIMDontChange),
789# endif 800# endif
790# endif 801# endif
791 }; 802 };
792 803
793 for (civ = const_iv + ARRAY_LENGTH(const_iv); civ-- > const_iv; ) 804 for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--)
794 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 805 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
795} 806}
796 807
797void 808void
798warn (const char *msg) 809warn (const char *msg)
799 CODE: 810 CODE:
876IV 887IV
877_new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb) 888_new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb)
878 CODE: 889 CODE:
879 rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term); 890 rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term);
880 req->cb_sv = newSVsv (cb); 891 req->cb_sv = newSVsv (cb);
892 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0));
893 av_push (av, newSViv ((IV)req));
881 RETVAL = (IV)req; 894 RETVAL = (IV)req;
882 OUTPUT: 895 OUTPUT:
883 RETVAL 896 RETVAL
884 897
885void 898void
886_delete_selection_request (IV req_) 899_delete_selection_request (IV req_)
887 CODE: 900 CODE:
888 rxvt_selection *req = (rxvt_selection *)req_; 901 rxvt_selection *req = (rxvt_selection *)req_;
902 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)req->term->perl.self), "_selection", 10, 0));
903 int i;
904
905 for (i = AvFILL (av); i >= 0; i--)
906 if (SvIV (*av_fetch (av, i, 1)) == req_)
907 break;
908
909 for (; i < AvFILL (av); i++)
910 av_store (av, i, SvREFCNT_inc (*av_fetch (av, i + 1, 0)));
911
912 av_pop (av);
913
889 delete req; 914 delete req;
890 915
891MODULE = urxvt PACKAGE = urxvt::term 916MODULE = urxvt PACKAGE = urxvt::term
892 917
893SV * 918SV *
953 978
954void 979void
955rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) 980rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
956 CODE: 981 CODE:
957 XUngrabKey (THIS->dpy, keycode, modifiers, window); 982 XUngrabKey (THIS->dpy, keycode, modifiers, window);
958
959void
960rxvt_term::XUngrabKeyboard (Time eventtime)
961 CODE:
962 XUngrabKeyboard (THIS->dpy, eventtime);
963 983
964bool 984bool
965rxvt_term::grab (Time eventtime, int sync = 0) 985rxvt_term::grab (Time eventtime, int sync = 0)
966 CODE: 986 CODE:
967{ 987{
1481# include "rsinc.h" 1501# include "rsinc.h"
1482# undef def 1502# undef def
1483# undef reserve 1503# undef reserve
1484 }; 1504 };
1485 1505
1486 rs = rslist + ARRAY_LENGTH(rslist); 1506 rs = rslist + ecb_array_length (rslist);
1487 1507
1488 if (*name) 1508 if (*name)
1489 { 1509 {
1490 do { 1510 do {
1491 if (rs-- == rslist) 1511 if (rs-- == rslist)
1563 CODE: 1583 CODE:
1564 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1584 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1565 THIS->keyboard->register_done (); 1585 THIS->keyboard->register_done ();
1566 OUTPUT: 1586 OUTPUT:
1567 RETVAL 1587 RETVAL
1588
1589void
1590rxvt_term::register_command (int keysym, unsigned int state, SV *str)
1591 CODE:
1592 wchar_t *wstr = sv2wcs (str);
1593 THIS->keyboard->register_user_translation (keysym, state, wstr);
1594 free (wstr);
1568 1595
1569void 1596void
1570rxvt_term::screen_cur (...) 1597rxvt_term::screen_cur (...)
1571 PROTOTYPE: $;$$ 1598 PROTOTYPE: $;$$
1572 ALIAS: 1599 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines