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.81 by root, Fri Jan 20 13:32:29 2006 UTC vs.
Revision 1.89 by root, Sun Jan 22 11:57:06 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;
920 if (items < 1 || !SvROK (ST (0)) || SvTYPE (SvRV (ST (0))) != SVt_PVAV) 928 if (items < 1 || !SvROK (ST (0)) || SvTYPE (SvRV (ST (0))) != SVt_PVAV)
921 croak ("first argument to urxvt::term->_new must be arrayref"); 929 croak ("first argument to urxvt::term->_new must be arrayref");
922 930
923 rxvt_term *term = new rxvt_term; 931 rxvt_term *term = new rxvt_term;
924 932
925 term->argv = new stringvec; 933 stringvec *argv = new stringvec;
926 term->envv = new stringvec; 934 stringvec *envv = new stringvec;
927 935
928 for (int i = 1; i < items; i++) 936 for (int i = 1; i < items; i++)
929 term->argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); 937 argv->push_back (strdup (SvPVbyte_nolen (ST (i))));
930 938
931 AV *envv = (AV *)SvRV (ST (0)); 939 AV *env = (AV *)SvRV (ST (0));
932 for (int i = AvFILL (envv) + 1; i--; ) 940 for (int i = AvFILL (env) + 1; i--; )
933 term->envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (envv, i, 1)))); 941 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
934 942
935 term->envv->push_back (0); 943 envv->push_back (0);
936 944
937 bool success; 945 bool success;
938 946
939 try 947 try
940 { 948 {
941 success = term->init (term->argv->size (), term->argv->begin ()); 949 success = term->init (argv, envv);
942 } 950 }
943 catch (const class rxvt_failure_exception &e) 951 catch (const class rxvt_failure_exception &e)
944 { 952 {
945 success = false; 953 success = false;
946 } 954 }
1109rxvt_term::ModLevel3Mask () 1117rxvt_term::ModLevel3Mask ()
1110 ALIAS: 1118 ALIAS:
1111 ModLevel3Mask = 0 1119 ModLevel3Mask = 0
1112 ModMetaMask = 1 1120 ModMetaMask = 1
1113 ModNumLockMask = 2 1121 ModNumLockMask = 2
1122 current_screen = 3
1123 hidden_cursor = 4
1114 CODE: 1124 CODE:
1115 switch (ix) 1125 switch (ix)
1116 { 1126 {
1117 case 0: RETVAL = THIS->ModLevel3Mask; break; 1127 case 0: RETVAL = THIS->ModLevel3Mask; break;
1118 case 1: RETVAL = THIS->ModMetaMask; break; 1128 case 1: RETVAL = THIS->ModMetaMask; break;
1119 case 2: RETVAL = THIS->ModNumLockMask; break; 1129 case 2: RETVAL = THIS->ModNumLockMask; break;
1130 case 3: RETVAL = THIS->current_screen; break;
1131 case 4: RETVAL = THIS->hidden_cursor; break;
1120 } 1132 }
1121 OUTPUT: 1133 OUTPUT:
1122 RETVAL 1134 RETVAL
1123 1135
1124char * 1136char *
1204} 1216}
1205 OUTPUT: 1217 OUTPUT:
1206 RETVAL 1218 RETVAL
1207 1219
1208void 1220void
1221rxvt_term::focus_in ()
1222
1223void
1224rxvt_term::focus_out ()
1225
1226void
1209rxvt_term::want_refresh () 1227rxvt_term::want_refresh ()
1210 CODE: 1228 CODE:
1211 THIS->want_refresh = 1; 1229 THIS->want_refresh = 1;
1212 1230
1213void 1231void
1235 { 1253 {
1236 wchar_t *wstr = sv2wcs (new_text); 1254 wchar_t *wstr = sv2wcs (new_text);
1237 1255
1238 int len = min (wcslen (wstr) - start_ofs, max_len); 1256 int len = min (wcslen (wstr) - start_ofs, max_len);
1239 1257
1240 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1258 if (start_col < 0 || start_col + len > THIS->ncol)
1241 { 1259 {
1242 free (wstr); 1260 free (wstr);
1243 croak ("new_text extends beyond horizontal margins"); 1261 croak ("new_text extends beyond horizontal margins");
1244 } 1262 }
1245 1263
1279 croak ("new_rend must be arrayref"); 1297 croak ("new_rend must be arrayref");
1280 1298
1281 AV *av = (AV *)SvRV (new_rend); 1299 AV *av = (AV *)SvRV (new_rend);
1282 int len = min (AvFILL (av) + 1 - start_ofs, max_len); 1300 int len = min (AvFILL (av) + 1 - start_ofs, max_len);
1283 1301
1284 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1302 if (start_col < 0 || start_col + len > THIS->ncol)
1285 croak ("new_rend array extends beyond horizontal margins"); 1303 croak ("new_rend array extends beyond horizontal margins");
1286 1304
1287 for (int col = start_col; col < start_col + len; col++) 1305 for (int col = start_col; col < start_col + len; col++)
1288 { 1306 {
1289 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask; 1307 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask;
1513 if (items == 3) 1531 if (items == 3)
1514 { 1532 {
1515 rc.row = SvIV (ST (1)); 1533 rc.row = SvIV (ST (1));
1516 rc.col = SvIV (ST (2)); 1534 rc.col = SvIV (ST (2));
1517 1535
1518 if (ix == 2 && rc.col == 0) 1536 if (ix == 2)
1519 { 1537 {
1538 if (rc.col == 0)
1539 {
1540 // col == 0 means end of previous line
1520 rc.row--; 1541 rc.row--;
1521 rc.col = THIS->ncol; 1542 rc.col = THIS->ncol;
1543 }
1544 else if (IN_RANGE_EXC (rc.row, THIS->top_row, THIS->nrow)
1545 && rc.col > ROW(rc.row).l)
1546 {
1547 // col >= length means while line and add newline
1548 rc.col = THIS->ncol;
1549 }
1522 } 1550 }
1523 1551
1524 clamp_it (rc.col, 0, THIS->ncol); 1552 clamp_it (rc.col, 0, THIS->ncol);
1525 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); 1553 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
1526 1554
1573void 1601void
1574rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) 1602rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid)
1575 1603
1576void 1604void
1577rxvt_term::scr_bell () 1605rxvt_term::scr_bell ()
1606
1607void
1608rxvt_term::scr_change_screen (int screen)
1578 1609
1579void 1610void
1580rxvt_term::scr_add_lines (SV *string) 1611rxvt_term::scr_add_lines (SV *string)
1581 CODE: 1612 CODE:
1582{ 1613{
1732XUnmapWindow (rxvt_term *term, Window window) 1763XUnmapWindow (rxvt_term *term, Window window)
1733 C_ARGS: term->display->display, window 1764 C_ARGS: term->display->display, window
1734 1765
1735void 1766void
1736XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) 1767XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height)
1737 C_ARGS: term->display->display, (Window)window, x, y, width, height 1768 C_ARGS: term->display->display, window, x, y, width, height
1769
1770void
1771rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0)
1772 CODE:
1773{
1774 XWindowAttributes attr;
1775 XGetWindowAttributes (THIS->display->display, window, &attr);
1776 XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events);
1777}
1778
1779void
1780rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
1781 PPCODE:
1782{
1783 int dx, dy;
1784 Window child;
1785
1786 if (XTranslateCoordinates (THIS->display->display, src, dst, x, y, &dx, &dy, &child))
1787 {
1788 EXTEND (SP, 3);
1789 PUSHs (newSViv (dx));
1790 PUSHs (newSViv (dy));
1791 PUSHs (newSVuv (child));
1792 }
1793}
1738 1794
1739############################################################################# 1795#############################################################################
1740# urxvt::overlay 1796# urxvt::overlay
1741############################################################################# 1797#############################################################################
1742 1798

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines