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

50#undef LINENO 50#undef LINENO
51#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) 51#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows)
52#undef ROW 52#undef ROW
53#define ROW(n) THIS->row_buf [LINENO (n)] 53#define ROW(n) THIS->row_buf [LINENO (n)]
54 54
55typedef int CHAINED UNUSED;
56
57///////////////////////////////////////////////////////////////////////////// 55/////////////////////////////////////////////////////////////////////////////
58 56
59static wchar_t * 57static wchar_t *
60sv2wcs (SV *sv) 58sv2wcs (SV *sv)
61{ 59{
72 SV *sv = newSVpv (str, 0); 70 SV *sv = newSVpv (str, 0);
73 SvUTF8_on (sv); 71 SvUTF8_on (sv);
74 free (str); 72 free (str);
75 73
76 return sv; 74 return sv;
77}
78
79static SV *
80new_ref (HV *hv, const char *klass)
81{
82 return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1));
83} 75}
84 76
85static SV * 77static SV *
86newSVptr (void *ptr, const char *klass) 78newSVptr (void *ptr, const char *klass)
87{ 79{
304} 296}
305 297
306///////////////////////////////////////////////////////////////////////////// 298/////////////////////////////////////////////////////////////////////////////
307 299
308#define IOM_CLASS "urxvt" 300#define IOM_CLASS "urxvt"
301#define IOM_WARN rxvt_warn
309#include <iom_perl.h> 302#include <iom_perl.h>
310 303
311///////////////////////////////////////////////////////////////////////////// 304/////////////////////////////////////////////////////////////////////////////
312 305
313struct rxvt_perl_interp rxvt_perl; 306struct rxvt_perl_interp rxvt_perl;
389 382
390 // pre-handling of some events 383 // pre-handling of some events
391 if (htype == HOOK_REFRESH_END) 384 if (htype == HOOK_REFRESH_END)
392 { 385 {
393 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));
394 387
395 for (int i = 0; i <= AvFILL (av); i++) 388 for (int i = 0; i <= AvFILL (av); i++)
396 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 389 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
397 } 390 }
398 391
399 swap (perl_environ, environ); 392 swap (perl_environ, environ);
598 591
599 // post-handling of some events 592 // post-handling of some events
600 if (htype == HOOK_REFRESH_BEGIN) 593 if (htype == HOOK_REFRESH_BEGIN)
601 { 594 {
602 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));
603 596
604 for (int i = AvFILL (av); i >= 0; i--) 597 for (int i = AvFILL (av); i >= 0; i--)
605 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 598 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
606 } 599 }
607 else if (htype == HOOK_DESTROY) 600 else if (htype == HOOK_DESTROY)
608 { 601 {
609 clearSVptr ((SV *)term->perl.self); 602 clearSVptr ((SV *)term->perl.self);
610 SvREFCNT_dec ((SV *)term->perl.self); 603 SvREFCNT_dec ((SV *)term->perl.self);
611 604
612 // don't allow further calls 605 // don't allow further calls
613 term->perl.self = 0; 606 term->perl.self = 0;
614 } 607 }
615 608
616 swap (perl_environ, environ); 609 swap (perl_environ, environ);
674 const_iv (AnyModifier), 667 const_iv (AnyModifier),
675 668
676 const_iv (NoSymbol), 669 const_iv (NoSymbol),
677 const_iv (GrabModeSync), 670 const_iv (GrabModeSync),
678 const_iv (GrabModeAsync), 671 const_iv (GrabModeAsync),
679
680 const_iv (EVENT_NONE),
681 const_iv (EVENT_READ),
682 const_iv (EVENT_WRITE),
683 672
684 const_iv (NoEventMask), 673 const_iv (NoEventMask),
685 const_iv (KeyPressMask), 674 const_iv (KeyPressMask),
686 const_iv (KeyReleaseMask), 675 const_iv (KeyReleaseMask),
687 const_iv (ButtonPressMask), 676 const_iv (ButtonPressMask),
1406SV * 1395SV *
1407rxvt_term::special_decode (SV *text) 1396rxvt_term::special_decode (SV *text)
1408 CODE: 1397 CODE:
1409{ 1398{
1410 wchar_t *wstr = sv2wcs (text); 1399 wchar_t *wstr = sv2wcs (text);
1411 int wlen = wcslen (wstr);
1412 int dlen = 0; 1400 int dlen = 0;
1413 1401
1414 // find length 1402 // find length
1415 for (wchar_t *s = wstr; *s; s++) 1403 for (wchar_t *s = wstr; *s; s++)
1416 if (*s == NOCHAR) 1404 if (*s == NOCHAR)
1479 1467
1480const char * 1468const char *
1481rxvt_term::x_resource (const char *name) 1469rxvt_term::x_resource (const char *name)
1482 1470
1483bool 1471bool
1484rxvt_term::option (U32 optval, int set = -1) 1472rxvt_term::option (U8 optval, int set = -1)
1485 CODE: 1473 CODE:
1486{ 1474{
1487 RETVAL = THIS->options & optval; 1475 RETVAL = THIS->option (optval);
1488 1476
1489 if (set >= 0) 1477 if (set >= 0)
1490 { 1478 {
1491 if (set)
1492 THIS->options |= optval; 1479 THIS->set_option (optval, set);
1493 else
1494 THIS->options &= ~optval;
1495 1480
1496 if (THIS->check_ev.is_active ()) // avoid doing this before START 1481 if (THIS->check_ev.is_active ()) // avoid doing this before START
1497 switch (optval) 1482 switch (optval)
1498 { 1483 {
1499 case Opt_skipBuiltinGlyphs: 1484 case Opt_skipBuiltinGlyphs:
1687 Atom *props = XListProperties (THIS->dpy, window, &count); 1672 Atom *props = XListProperties (THIS->dpy, window, &count);
1688 1673
1689 EXTEND (SP, count); 1674 EXTEND (SP, count);
1690 while (count--) 1675 while (count--)
1691 PUSHs (newSVuv ((U32)props [count])); 1676 PUSHs (newSVuv ((U32)props [count]));
1692 1677
1693 XFree (props); 1678 XFree (props);
1694} 1679}
1695 1680
1696void 1681void
1697rxvt_term::XGetWindowProperty (Window window, Atom property) 1682rxvt_term::XGetWindowProperty (Window window, Atom property)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines