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.80 by root, Fri Jan 20 12:16:28 2006 UTC vs.
Revision 1.83 by root, Fri Jan 20 15:40:39 2006 UTC

1204} 1204}
1205 OUTPUT: 1205 OUTPUT:
1206 RETVAL 1206 RETVAL
1207 1207
1208void 1208void
1209rxvt_term::focus_in ()
1210
1211void
1212rxvt_term::focus_out ()
1213
1214void
1209rxvt_term::want_refresh () 1215rxvt_term::want_refresh ()
1210 CODE: 1216 CODE:
1211 THIS->want_refresh = 1; 1217 THIS->want_refresh = 1;
1212 1218
1213void 1219void
1235 { 1241 {
1236 wchar_t *wstr = sv2wcs (new_text); 1242 wchar_t *wstr = sv2wcs (new_text);
1237 1243
1238 int len = min (wcslen (wstr) - start_ofs, max_len); 1244 int len = min (wcslen (wstr) - start_ofs, max_len);
1239 1245
1240 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1246 if (start_col < 0 || start_col + len > THIS->ncol)
1241 { 1247 {
1242 free (wstr); 1248 free (wstr);
1243 croak ("new_text extends beyond horizontal margins"); 1249 croak ("new_text extends beyond horizontal margins");
1244 } 1250 }
1245 1251
1279 croak ("new_rend must be arrayref"); 1285 croak ("new_rend must be arrayref");
1280 1286
1281 AV *av = (AV *)SvRV (new_rend); 1287 AV *av = (AV *)SvRV (new_rend);
1282 int len = min (AvFILL (av) + 1 - start_ofs, max_len); 1288 int len = min (AvFILL (av) + 1 - start_ofs, max_len);
1283 1289
1284 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1290 if (start_col < 0 || start_col + len > THIS->ncol)
1285 croak ("new_rend array extends beyond horizontal margins"); 1291 croak ("new_rend array extends beyond horizontal margins");
1286 1292
1287 for (int col = start_col; col < start_col + len; col++) 1293 for (int col = start_col; col < start_col + len; col++)
1288 { 1294 {
1289 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask; 1295 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask;
1650 Atom type; 1656 Atom type;
1651 int format; 1657 int format;
1652 unsigned long nitems; 1658 unsigned long nitems;
1653 unsigned long bytes_after; 1659 unsigned long bytes_after;
1654 unsigned char *prop; 1660 unsigned char *prop;
1661
1655 XGetWindowProperty (THIS->display->display, window, property, 1662 XGetWindowProperty (THIS->display->display, window, property,
1656 0, 1<<30, 0, AnyPropertyType, 1663 0, 1<<24, 0, AnyPropertyType,
1657 &type, &format, &nitems, &bytes_after, &prop); 1664 &type, &format, &nitems, &bytes_after, &prop);
1665
1658 if (type != None) 1666 if (type != None)
1659 { 1667 {
1668 int elemsize = format == 16 ? sizeof (short)
1669 : format == 32 ? sizeof (long)
1670 : 1;
1671
1660 EXTEND (SP, 3); 1672 EXTEND (SP, 3);
1661 PUSHs (newSVuv ((U32)type)); 1673 PUSHs (newSVuv ((U32)type));
1662 PUSHs (newSViv (format)); 1674 PUSHs (newSViv (format));
1663 PUSHs (newSVpvn ((char *)prop, nitems * format / 8)); 1675 PUSHs (newSVpvn ((char *)prop, nitems * elemsize));
1664 XFree (prop); 1676 XFree (prop);
1665 } 1677 }
1666} 1678}
1667 1679
1668void 1680void
1670 CODE: 1682 CODE:
1671{ 1683{
1672 STRLEN len; 1684 STRLEN len;
1673 char *data_ = SvPVbyte (data, len); 1685 char *data_ = SvPVbyte (data, len);
1674 1686
1687 int elemsize = format == 16 ? sizeof (short)
1688 : format == 32 ? sizeof (long)
1689 : 1;
1690
1675 XChangeProperty (THIS->display->display, window, property, 1691 XChangeProperty (THIS->display->display, window, property,
1676 type, format, PropModeReplace, 1692 type, format, PropModeReplace,
1677 (unsigned char *)data, len * 8 / format); 1693 (unsigned char *)data_, len / elemsize);
1694 XSync (THIS->display->display, 0);
1678} 1695}
1696
1697Atom
1698XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
1699 C_ARGS: term->display->display, atom_name, only_if_exists
1700
1701char *
1702XGetAtomName (rxvt_term *term, Atom atom)
1703 C_ARGS: term->display->display, atom
1704 CLEANUP:
1705 XFree (RETVAL);
1679 1706
1680void 1707void
1681XDeleteProperty (rxvt_term *term, Window window, Atom property) 1708XDeleteProperty (rxvt_term *term, Window window, Atom property)
1682 C_ARGS: term->display->display, window, property 1709 C_ARGS: term->display->display, window, property
1683 1710
1685rxvt_term::DefaultRootWindow () 1712rxvt_term::DefaultRootWindow ()
1686 CODE: 1713 CODE:
1687 RETVAL = THIS->display->root; 1714 RETVAL = THIS->display->root;
1688 OUTPUT: 1715 OUTPUT:
1689 RETVAL 1716 RETVAL
1717
1718#if 0
1690 1719
1691Window 1720Window
1692XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) 1721XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height)
1693 C_ARGS: term->display->display, (Window)parent, 1722 C_ARGS: term->display->display, (Window)parent,
1694 x, y, width, height, 0, 1723 x, y, width, height, 0,
1695 term->pix_colors_focused[Color_border], 1724 term->pix_colors_focused[Color_border],
1696 term->pix_colors_focused[Color_border] 1725 term->pix_colors_focused[Color_border]
1697 1726
1727#endif
1728
1698void 1729void
1699XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) 1730XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0)
1700 C_ARGS: term->display->display, window, parent, x, y 1731 C_ARGS: term->display->display, window, parent, x, y
1701 1732
1702void 1733void
1708 C_ARGS: term->display->display, window 1739 C_ARGS: term->display->display, window
1709 1740
1710void 1741void
1711XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) 1742XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height)
1712 C_ARGS: term->display->display, (Window)window, x, y, width, height 1743 C_ARGS: term->display->display, (Window)window, x, y, width, height
1744
1745void
1746rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
1747 PPCODE:
1748{
1749 int dx, dy;
1750 Window child;
1751
1752 if (XTranslateCoordinates (THIS->display->display, src, dst, x, y, &dx, &dy, &child))
1753 {
1754 EXTEND (SP, 3);
1755 PUSHs (newSViv (dx));
1756 PUSHs (newSViv (dy));
1757 PUSHs (newSVuv (child));
1758 }
1759}
1713 1760
1714############################################################################# 1761#############################################################################
1715# urxvt::overlay 1762# urxvt::overlay
1716############################################################################# 1763#############################################################################
1717 1764

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines