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.85 by root, Fri Jan 20 22:05:41 2006 UTC

596 setuv (root, xe->xmotion.root); 596 setuv (root, xe->xmotion.root);
597 setuv (subwindow, xe->xmotion.subwindow); 597 setuv (subwindow, xe->xmotion.subwindow);
598 setuv (time, xe->xmotion.time); 598 setuv (time, xe->xmotion.time);
599 setiv (x, xe->xmotion.x); 599 setiv (x, xe->xmotion.x);
600 setiv (y, xe->xmotion.y); 600 setiv (y, xe->xmotion.y);
601 setiv (row, xe->xmotion.y / term->fheight); 601 setiv (row, xe->xmotion.y / term->fheight + term->view_start);
602 setiv (col, xe->xmotion.x / term->fwidth); 602 setiv (col, xe->xmotion.x / term->fwidth);
603 setiv (x_root, xe->xmotion.x_root); 603 setiv (x_root, xe->xmotion.x_root);
604 setiv (y_root, xe->xmotion.y_root); 604 setiv (y_root, xe->xmotion.y_root);
605 setuv (state, xe->xmotion.state); 605 setuv (state, xe->xmotion.state);
606 606
640 break; 640 break;
641 } 641 }
642 642
643 break; 643 break;
644 644
645 case PropertyNotify:
646 setuv (window, xe->xproperty.window);
647 setuv (atom, xe->xproperty.atom);
648 setuv (time, xe->xproperty.time);
649 setiv (state, xe->xproperty.state);
650 break;
651
645 case ClientMessage: 652 case ClientMessage:
646 setuv (window, xe->xclient.window); 653 setuv (window, xe->xclient.window);
647 setuv (message_type, xe->xclient.message_type); 654 setuv (message_type, xe->xclient.message_type);
648 setuv (format, xe->xclient.format); 655 setuv (format, xe->xclient.format);
649 setuv (l0, xe->xclient.data.l[0]); 656 setuv (l0, xe->xclient.data.l[0]);
650 setuv (l1, xe->xclient.data.l[1]); 657 setuv (l1, xe->xclient.data.l[1]);
651 setuv (l2, xe->xclient.data.l[2]); 658 setuv (l2, xe->xclient.data.l[2]);
652 setuv (l3, xe->xclient.data.l[3]); 659 setuv (l3, xe->xclient.data.l[3]);
653 setuv (l4, xe->xclient.data.l[4]); 660 setuv (l4, xe->xclient.data.l[4]);
661 break;
654 } 662 }
655 663
656 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 664 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
657 } 665 }
658 break; 666 break;
1204} 1212}
1205 OUTPUT: 1213 OUTPUT:
1206 RETVAL 1214 RETVAL
1207 1215
1208void 1216void
1217rxvt_term::focus_in ()
1218
1219void
1220rxvt_term::focus_out ()
1221
1222void
1209rxvt_term::want_refresh () 1223rxvt_term::want_refresh ()
1210 CODE: 1224 CODE:
1211 THIS->want_refresh = 1; 1225 THIS->want_refresh = 1;
1212 1226
1213void 1227void
1235 { 1249 {
1236 wchar_t *wstr = sv2wcs (new_text); 1250 wchar_t *wstr = sv2wcs (new_text);
1237 1251
1238 int len = min (wcslen (wstr) - start_ofs, max_len); 1252 int len = min (wcslen (wstr) - start_ofs, max_len);
1239 1253
1240 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1254 if (start_col < 0 || start_col + len > THIS->ncol)
1241 { 1255 {
1242 free (wstr); 1256 free (wstr);
1243 croak ("new_text extends beyond horizontal margins"); 1257 croak ("new_text extends beyond horizontal margins");
1244 } 1258 }
1245 1259
1279 croak ("new_rend must be arrayref"); 1293 croak ("new_rend must be arrayref");
1280 1294
1281 AV *av = (AV *)SvRV (new_rend); 1295 AV *av = (AV *)SvRV (new_rend);
1282 int len = min (AvFILL (av) + 1 - start_ofs, max_len); 1296 int len = min (AvFILL (av) + 1 - start_ofs, max_len);
1283 1297
1284 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1298 if (start_col < 0 || start_col + len > THIS->ncol)
1285 croak ("new_rend array extends beyond horizontal margins"); 1299 croak ("new_rend array extends beyond horizontal margins");
1286 1300
1287 for (int col = start_col; col < start_col + len; col++) 1301 for (int col = start_col; col < start_col + len; col++)
1288 { 1302 {
1289 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask; 1303 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask;
1650 Atom type; 1664 Atom type;
1651 int format; 1665 int format;
1652 unsigned long nitems; 1666 unsigned long nitems;
1653 unsigned long bytes_after; 1667 unsigned long bytes_after;
1654 unsigned char *prop; 1668 unsigned char *prop;
1669
1655 XGetWindowProperty (THIS->display->display, window, property, 1670 XGetWindowProperty (THIS->display->display, window, property,
1656 0, 1<<30, 0, AnyPropertyType, 1671 0, 1<<24, 0, AnyPropertyType,
1657 &type, &format, &nitems, &bytes_after, &prop); 1672 &type, &format, &nitems, &bytes_after, &prop);
1673
1658 if (type != None) 1674 if (type != None)
1659 { 1675 {
1676 int elemsize = format == 16 ? sizeof (short)
1677 : format == 32 ? sizeof (long)
1678 : 1;
1679
1660 EXTEND (SP, 3); 1680 EXTEND (SP, 3);
1661 PUSHs (newSVuv ((U32)type)); 1681 PUSHs (newSVuv ((U32)type));
1662 PUSHs (newSViv (format)); 1682 PUSHs (newSViv (format));
1663 PUSHs (newSVpvn ((char *)prop, nitems * format / 8)); 1683 PUSHs (newSVpvn ((char *)prop, nitems * elemsize));
1664 XFree (prop); 1684 XFree (prop);
1665 } 1685 }
1666} 1686}
1667 1687
1668void 1688void
1670 CODE: 1690 CODE:
1671{ 1691{
1672 STRLEN len; 1692 STRLEN len;
1673 char *data_ = SvPVbyte (data, len); 1693 char *data_ = SvPVbyte (data, len);
1674 1694
1695 int elemsize = format == 16 ? sizeof (short)
1696 : format == 32 ? sizeof (long)
1697 : 1;
1698
1675 XChangeProperty (THIS->display->display, window, property, 1699 XChangeProperty (THIS->display->display, window, property,
1676 type, format, PropModeReplace, 1700 type, format, PropModeReplace,
1677 (unsigned char *)data, len * 8 / format); 1701 (unsigned char *)data_, len / elemsize);
1702 XSync (THIS->display->display, 0);
1678} 1703}
1704
1705Atom
1706XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
1707 C_ARGS: term->display->display, atom_name, only_if_exists
1708
1709char *
1710XGetAtomName (rxvt_term *term, Atom atom)
1711 C_ARGS: term->display->display, atom
1712 CLEANUP:
1713 XFree (RETVAL);
1679 1714
1680void 1715void
1681XDeleteProperty (rxvt_term *term, Window window, Atom property) 1716XDeleteProperty (rxvt_term *term, Window window, Atom property)
1682 C_ARGS: term->display->display, window, property 1717 C_ARGS: term->display->display, window, property
1683 1718
1685rxvt_term::DefaultRootWindow () 1720rxvt_term::DefaultRootWindow ()
1686 CODE: 1721 CODE:
1687 RETVAL = THIS->display->root; 1722 RETVAL = THIS->display->root;
1688 OUTPUT: 1723 OUTPUT:
1689 RETVAL 1724 RETVAL
1725
1726#if 0
1690 1727
1691Window 1728Window
1692XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) 1729XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height)
1693 C_ARGS: term->display->display, (Window)parent, 1730 C_ARGS: term->display->display, (Window)parent,
1694 x, y, width, height, 0, 1731 x, y, width, height, 0,
1695 term->pix_colors_focused[Color_border], 1732 term->pix_colors_focused[Color_border],
1696 term->pix_colors_focused[Color_border] 1733 term->pix_colors_focused[Color_border]
1697 1734
1735#endif
1736
1698void 1737void
1699XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) 1738XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0)
1700 C_ARGS: term->display->display, window, parent, x, y 1739 C_ARGS: term->display->display, window, parent, x, y
1701 1740
1702void 1741void
1707XUnmapWindow (rxvt_term *term, Window window) 1746XUnmapWindow (rxvt_term *term, Window window)
1708 C_ARGS: term->display->display, window 1747 C_ARGS: term->display->display, window
1709 1748
1710void 1749void
1711XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) 1750XMoveResizeWindow (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 1751 C_ARGS: term->display->display, window, x, y, width, height
1752
1753void
1754rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0)
1755 CODE:
1756{
1757 XWindowAttributes attr;
1758 XGetWindowAttributes (THIS->display->display, window, &attr);
1759 XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events);
1760}
1761
1762void
1763rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
1764 PPCODE:
1765{
1766 int dx, dy;
1767 Window child;
1768
1769 if (XTranslateCoordinates (THIS->display->display, src, dst, x, y, &dx, &dy, &child))
1770 {
1771 EXTEND (SP, 3);
1772 PUSHs (newSViv (dx));
1773 PUSHs (newSViv (dy));
1774 PUSHs (newSVuv (child));
1775 }
1776}
1713 1777
1714############################################################################# 1778#############################################################################
1715# urxvt::overlay 1779# urxvt::overlay
1716############################################################################# 1780#############################################################################
1717 1781

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines