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.112 by root, Thu Dec 14 17:40:03 2006 UTC vs.
Revision 1.115 by ayin, Wed Oct 31 09:55:24 2007 UTC

73 73
74 return sv; 74 return sv;
75} 75}
76 76
77static SV * 77static SV *
78new_ref (HV *hv, const char *klass)
79{
80 return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1));
81}
82
83static SV *
84newSVptr (void *ptr, const char *klass) 78newSVptr (void *ptr, const char *klass)
85{ 79{
86 HV *hv = newHV (); 80 HV *hv = newHV ();
87 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0); 81 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0);
88 return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1)); 82 return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1));
388 382
389 // pre-handling of some events 383 // pre-handling of some events
390 if (htype == HOOK_REFRESH_END) 384 if (htype == HOOK_REFRESH_END)
391 { 385 {
392 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); 386 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
393 387
394 for (int i = 0; i <= AvFILL (av); i++) 388 for (int i = 0; i <= AvFILL (av); i++)
395 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 389 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
396 } 390 }
397 391
398 swap (perl_environ, environ); 392 swap (perl_environ, environ);
597 591
598 // post-handling of some events 592 // post-handling of some events
599 if (htype == HOOK_REFRESH_BEGIN) 593 if (htype == HOOK_REFRESH_BEGIN)
600 { 594 {
601 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); 595 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
602 596
603 for (int i = AvFILL (av); i >= 0; i--) 597 for (int i = AvFILL (av); i >= 0; i--)
604 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 598 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
605 } 599 }
606 else if (htype == HOOK_DESTROY) 600 else if (htype == HOOK_DESTROY)
607 { 601 {
608 clearSVptr ((SV *)term->perl.self); 602 clearSVptr ((SV *)term->perl.self);
609 SvREFCNT_dec ((SV *)term->perl.self); 603 SvREFCNT_dec ((SV *)term->perl.self);
610 604
611 // don't allow further calls 605 // don't allow further calls
612 term->perl.self = 0; 606 term->perl.self = 0;
613 } 607 }
614 608
615 swap (perl_environ, environ); 609 swap (perl_environ, environ);
1401SV * 1395SV *
1402rxvt_term::special_decode (SV *text) 1396rxvt_term::special_decode (SV *text)
1403 CODE: 1397 CODE:
1404{ 1398{
1405 wchar_t *wstr = sv2wcs (text); 1399 wchar_t *wstr = sv2wcs (text);
1406 int wlen = wcslen (wstr);
1407 int dlen = 0; 1400 int dlen = 0;
1408 1401
1409 // find length 1402 // find length
1410 for (wchar_t *s = wstr; *s; s++) 1403 for (wchar_t *s = wstr; *s; s++)
1411 if (*s == NOCHAR) 1404 if (*s == NOCHAR)
1474 1467
1475const char * 1468const char *
1476rxvt_term::x_resource (const char *name) 1469rxvt_term::x_resource (const char *name)
1477 1470
1478bool 1471bool
1479rxvt_term::option (U32 optval, int set = -1) 1472rxvt_term::option (U8 optval, int set = -1)
1480 CODE: 1473 CODE:
1481{ 1474{
1482 RETVAL = THIS->options & optval; 1475 RETVAL = THIS->option (optval);
1483 1476
1484 if (set >= 0) 1477 if (set >= 0)
1485 { 1478 {
1486 if (set)
1487 THIS->options |= optval; 1479 THIS->set_option (optval, set);
1488 else
1489 THIS->options &= ~optval;
1490 1480
1491 if (THIS->check_ev.is_active ()) // avoid doing this before START 1481 if (THIS->check_ev.is_active ()) // avoid doing this before START
1492 switch (optval) 1482 switch (optval)
1493 { 1483 {
1494 case Opt_skipBuiltinGlyphs: 1484 case Opt_skipBuiltinGlyphs:
1682 Atom *props = XListProperties (THIS->dpy, window, &count); 1672 Atom *props = XListProperties (THIS->dpy, window, &count);
1683 1673
1684 EXTEND (SP, count); 1674 EXTEND (SP, count);
1685 while (count--) 1675 while (count--)
1686 PUSHs (newSVuv ((U32)props [count])); 1676 PUSHs (newSVuv ((U32)props [count]));
1687 1677
1688 XFree (props); 1678 XFree (props);
1689} 1679}
1690 1680
1691void 1681void
1692rxvt_term::XGetWindowProperty (Window window, Atom property) 1682rxvt_term::XGetWindowProperty (Window window, Atom property)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines