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.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:
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}
875 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;
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)
880 CODE: 920 CODE:
887 for (int i = 0; i <= AvFILL (arg); i++) 927 for (int i = 0; i <= AvFILL (arg); i++)
888 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); 928 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1))));
889 929
890 for (int i = AvFILL (env) + 1; i--; ) 930 for (int i = AvFILL (env) + 1; i--; )
891 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); 931 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
892
893 envv->push_back (0);
894 932
895 try 933 try
896 { 934 {
897 term->init (argv, envv); 935 term->init (argv, envv);
898 } 936 }
938 976
939void 977void
940rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) 978rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
941 CODE: 979 CODE:
942 XUngrabKey (THIS->dpy, keycode, modifiers, window); 980 XUngrabKey (THIS->dpy, keycode, modifiers, window);
943
944void
945rxvt_term::XUngrabKeyboard (Time eventtime)
946 CODE:
947 XUngrabKeyboard (THIS->dpy, eventtime);
948 981
949bool 982bool
950rxvt_term::grab (Time eventtime, int sync = 0) 983rxvt_term::grab (Time eventtime, int sync = 0)
951 CODE: 984 CODE:
952{ 985{
1187 RETVAL 1220 RETVAL
1188 1221
1189Window 1222Window
1190rxvt_term::parent () 1223rxvt_term::parent ()
1191 CODE: 1224 CODE:
1192 RETVAL = THIS->parent [0]; 1225 RETVAL = THIS->parent;
1193 OUTPUT: 1226 OUTPUT:
1194 RETVAL 1227 RETVAL
1195 1228
1196Window 1229Window
1197rxvt_term::vt () 1230rxvt_term::vt ()
1224 if (newval <= 0) 1257 if (newval <= 0)
1225 THIS->scr_changeview (max (newval, THIS->top_row)); 1258 THIS->scr_changeview (max (newval, THIS->top_row));
1226} 1259}
1227 OUTPUT: 1260 OUTPUT:
1228 RETVAL 1261 RETVAL
1262
1263void
1264rxvt_term::set_urgency (bool enable)
1229 1265
1230void 1266void
1231rxvt_term::focus_in () 1267rxvt_term::focus_in ()
1232 1268
1233void 1269void
1466# include "rsinc.h" 1502# include "rsinc.h"
1467# undef def 1503# undef def
1468# undef reserve 1504# undef reserve
1469 }; 1505 };
1470 1506
1471 rs = rslist + ARRAY_LENGTH(rslist); 1507 rs = rslist + ecb_array_length (rslist);
1472 1508
1473 if (*name) 1509 if (*name)
1474 { 1510 {
1475 do { 1511 do {
1476 if (rs-- == rslist) 1512 if (rs-- == rslist)
1548 CODE: 1584 CODE:
1549 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1585 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1550 THIS->keyboard->register_done (); 1586 THIS->keyboard->register_done ();
1551 OUTPUT: 1587 OUTPUT:
1552 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);
1553 1596
1554void 1597void
1555rxvt_term::screen_cur (...) 1598rxvt_term::screen_cur (...)
1556 PROTOTYPE: $;$$ 1599 PROTOTYPE: $;$$
1557 ALIAS: 1600 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines