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.146 by sf-exg, Mon Dec 5 12:52:57 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{
1241} 1261}
1242 OUTPUT: 1262 OUTPUT:
1243 RETVAL 1263 RETVAL
1244 1264
1245void 1265void
1266rxvt_term::set_urgency (bool enable)
1267
1268void
1246rxvt_term::focus_in () 1269rxvt_term::focus_in ()
1247 1270
1248void 1271void
1249rxvt_term::focus_out () 1272rxvt_term::focus_out ()
1250 1273
1481# include "rsinc.h" 1504# include "rsinc.h"
1482# undef def 1505# undef def
1483# undef reserve 1506# undef reserve
1484 }; 1507 };
1485 1508
1486 rs = rslist + ARRAY_LENGTH(rslist); 1509 rs = rslist + ecb_array_length (rslist);
1487 1510
1488 if (*name) 1511 if (*name)
1489 { 1512 {
1490 do { 1513 do {
1491 if (rs-- == rslist) 1514 if (rs-- == rslist)
1563 CODE: 1586 CODE:
1564 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1587 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1565 THIS->keyboard->register_done (); 1588 THIS->keyboard->register_done ();
1566 OUTPUT: 1589 OUTPUT:
1567 RETVAL 1590 RETVAL
1591
1592void
1593rxvt_term::register_command (int keysym, unsigned int state, SV *str)
1594 CODE:
1595 wchar_t *wstr = sv2wcs (str);
1596 THIS->keyboard->register_user_translation (keysym, state, wstr);
1597 free (wstr);
1568 1598
1569void 1599void
1570rxvt_term::screen_cur (...) 1600rxvt_term::screen_cur (...)
1571 PROTOTYPE: $;$$ 1601 PROTOTYPE: $;$$
1572 ALIAS: 1602 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines