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.147 by sf-exg, Tue Dec 6 11:29:52 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 *
902 for (int i = 0; i <= AvFILL (arg); i++) 927 for (int i = 0; i <= AvFILL (arg); i++)
903 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); 928 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1))));
904 929
905 for (int i = AvFILL (env) + 1; i--; ) 930 for (int i = AvFILL (env) + 1; i--; )
906 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); 931 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
907
908 envv->push_back (0);
909 932
910 try 933 try
911 { 934 {
912 term->init (argv, envv); 935 term->init (argv, envv);
913 } 936 }
953 976
954void 977void
955rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) 978rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
956 CODE: 979 CODE:
957 XUngrabKey (THIS->dpy, keycode, modifiers, window); 980 XUngrabKey (THIS->dpy, keycode, modifiers, window);
958
959void
960rxvt_term::XUngrabKeyboard (Time eventtime)
961 CODE:
962 XUngrabKeyboard (THIS->dpy, eventtime);
963 981
964bool 982bool
965rxvt_term::grab (Time eventtime, int sync = 0) 983rxvt_term::grab (Time eventtime, int sync = 0)
966 CODE: 984 CODE:
967{ 985{
1241} 1259}
1242 OUTPUT: 1260 OUTPUT:
1243 RETVAL 1261 RETVAL
1244 1262
1245void 1263void
1264rxvt_term::set_urgency (bool enable)
1265
1266void
1246rxvt_term::focus_in () 1267rxvt_term::focus_in ()
1247 1268
1248void 1269void
1249rxvt_term::focus_out () 1270rxvt_term::focus_out ()
1250 1271
1481# include "rsinc.h" 1502# include "rsinc.h"
1482# undef def 1503# undef def
1483# undef reserve 1504# undef reserve
1484 }; 1505 };
1485 1506
1486 rs = rslist + ARRAY_LENGTH(rslist); 1507 rs = rslist + ecb_array_length (rslist);
1487 1508
1488 if (*name) 1509 if (*name)
1489 { 1510 {
1490 do { 1511 do {
1491 if (rs-- == rslist) 1512 if (rs-- == rslist)
1563 CODE: 1584 CODE:
1564 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1585 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1565 THIS->keyboard->register_done (); 1586 THIS->keyboard->register_done ();
1566 OUTPUT: 1587 OUTPUT:
1567 RETVAL 1588 RETVAL
1589
1590void
1591rxvt_term::register_command (int keysym, unsigned int state, SV *str)
1592 CODE:
1593 wchar_t *wstr = sv2wcs (str);
1594 THIS->keyboard->register_user_translation (keysym, state, wstr);
1595 free (wstr);
1568 1596
1569void 1597void
1570rxvt_term::screen_cur (...) 1598rxvt_term::screen_cur (...)
1571 PROTOTYPE: $;$$ 1599 PROTOTYPE: $;$$
1572 ALIAS: 1600 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines