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.138 by root, Mon Feb 21 08:10:10 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:
870 881
871 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) 882 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
872 if ((*t)->perl.self) 883 if ((*t)->perl.self)
873 PUSHs (sv_2mortal (newSVterm (*t))); 884 PUSHs (sv_2mortal (newSVterm (*t)));
874} 885}
886
887IV
888_new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb)
889 CODE:
890 rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term);
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));
894 RETVAL = (IV)req;
895 OUTPUT:
896 RETVAL
897
898void
899_delete_selection_request (IV req_)
900 CODE:
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
914 delete req;
875 915
876MODULE = urxvt PACKAGE = urxvt::term 916MODULE = urxvt PACKAGE = urxvt::term
877 917
878SV * 918SV *
879_new (AV *env, AV *arg) 919_new (AV *env, AV *arg)
938 978
939void 979void
940rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) 980rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
941 CODE: 981 CODE:
942 XUngrabKey (THIS->dpy, keycode, modifiers, window); 982 XUngrabKey (THIS->dpy, keycode, modifiers, window);
943
944void
945rxvt_term::XUngrabKeyboard (Time eventtime)
946 CODE:
947 XUngrabKeyboard (THIS->dpy, eventtime);
948 983
949bool 984bool
950rxvt_term::grab (Time eventtime, int sync = 0) 985rxvt_term::grab (Time eventtime, int sync = 0)
951 CODE: 986 CODE:
952{ 987{
1187 RETVAL 1222 RETVAL
1188 1223
1189Window 1224Window
1190rxvt_term::parent () 1225rxvt_term::parent ()
1191 CODE: 1226 CODE:
1192 RETVAL = THIS->parent [0]; 1227 RETVAL = THIS->parent;
1193 OUTPUT: 1228 OUTPUT:
1194 RETVAL 1229 RETVAL
1195 1230
1196Window 1231Window
1197rxvt_term::vt () 1232rxvt_term::vt ()
1224 if (newval <= 0) 1259 if (newval <= 0)
1225 THIS->scr_changeview (max (newval, THIS->top_row)); 1260 THIS->scr_changeview (max (newval, THIS->top_row));
1226} 1261}
1227 OUTPUT: 1262 OUTPUT:
1228 RETVAL 1263 RETVAL
1264
1265void
1266rxvt_term::set_urgency (bool enable)
1229 1267
1230void 1268void
1231rxvt_term::focus_in () 1269rxvt_term::focus_in ()
1232 1270
1233void 1271void
1466# include "rsinc.h" 1504# include "rsinc.h"
1467# undef def 1505# undef def
1468# undef reserve 1506# undef reserve
1469 }; 1507 };
1470 1508
1471 rs = rslist + ARRAY_LENGTH(rslist); 1509 rs = rslist + ecb_array_length (rslist);
1472 1510
1473 if (*name) 1511 if (*name)
1474 { 1512 {
1475 do { 1513 do {
1476 if (rs-- == rslist) 1514 if (rs-- == rslist)
1548 CODE: 1586 CODE:
1549 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1587 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1550 THIS->keyboard->register_done (); 1588 THIS->keyboard->register_done ();
1551 OUTPUT: 1589 OUTPUT:
1552 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);
1553 1598
1554void 1599void
1555rxvt_term::screen_cur (...) 1600rxvt_term::screen_cur (...)
1556 PROTOTYPE: $;$$ 1601 PROTOTYPE: $;$$
1557 ALIAS: 1602 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines