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.82 by root, Fri Jan 20 14:41:07 2006 UTC vs.
Revision 1.90 by root, Sun Jan 22 20:39:47 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 *
1162 if (events != EVENT_UNDEF) 1174 if (events != EVENT_UNDEF)
1163 THIS->pty_ev.set (events); 1175 THIS->pty_ev.set (events);
1164 OUTPUT: 1176 OUTPUT:
1165 RETVAL 1177 RETVAL
1166 1178
1179int
1180rxvt_term::pty_fd ()
1181 CODE:
1182 RETVAL = THIS->pty->pty;
1183 OUTPUT:
1184 RETVAL
1185
1167Window 1186Window
1168rxvt_term::parent () 1187rxvt_term::parent ()
1169 CODE: 1188 CODE:
1170 RETVAL = THIS->parent [0]; 1189 RETVAL = THIS->parent [0];
1171 OUTPUT: 1190 OUTPUT:
1204} 1223}
1205 OUTPUT: 1224 OUTPUT:
1206 RETVAL 1225 RETVAL
1207 1226
1208void 1227void
1228rxvt_term::focus_in ()
1229
1230void
1231rxvt_term::focus_out ()
1232
1233void
1209rxvt_term::want_refresh () 1234rxvt_term::want_refresh ()
1210 CODE: 1235 CODE:
1211 THIS->want_refresh = 1; 1236 THIS->want_refresh = 1;
1212 1237
1213void 1238void
1235 { 1260 {
1236 wchar_t *wstr = sv2wcs (new_text); 1261 wchar_t *wstr = sv2wcs (new_text);
1237 1262
1238 int len = min (wcslen (wstr) - start_ofs, max_len); 1263 int len = min (wcslen (wstr) - start_ofs, max_len);
1239 1264
1240 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1265 if (start_col < 0 || start_col + len > THIS->ncol)
1241 { 1266 {
1242 free (wstr); 1267 free (wstr);
1243 croak ("new_text extends beyond horizontal margins"); 1268 croak ("new_text extends beyond horizontal margins");
1244 } 1269 }
1245 1270
1279 croak ("new_rend must be arrayref"); 1304 croak ("new_rend must be arrayref");
1280 1305
1281 AV *av = (AV *)SvRV (new_rend); 1306 AV *av = (AV *)SvRV (new_rend);
1282 int len = min (AvFILL (av) + 1 - start_ofs, max_len); 1307 int len = min (AvFILL (av) + 1 - start_ofs, max_len);
1283 1308
1284 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) 1309 if (start_col < 0 || start_col + len > THIS->ncol)
1285 croak ("new_rend array extends beyond horizontal margins"); 1310 croak ("new_rend array extends beyond horizontal margins");
1286 1311
1287 for (int col = start_col; col < start_col + len; col++) 1312 for (int col = start_col; col < start_col + len; col++)
1288 { 1313 {
1289 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask; 1314 rend_t r = SvIV (*av_fetch (av, start_ofs + col - start_col, 1)) & ~RS_fontMask;
1513 if (items == 3) 1538 if (items == 3)
1514 { 1539 {
1515 rc.row = SvIV (ST (1)); 1540 rc.row = SvIV (ST (1));
1516 rc.col = SvIV (ST (2)); 1541 rc.col = SvIV (ST (2));
1517 1542
1518 if (ix == 2 && rc.col == 0) 1543 if (ix == 2)
1519 { 1544 {
1545 if (rc.col == 0)
1546 {
1547 // col == 0 means end of previous line
1520 rc.row--; 1548 rc.row--;
1521 rc.col = THIS->ncol; 1549 rc.col = THIS->ncol;
1550 }
1551 else if (IN_RANGE_EXC (rc.row, THIS->top_row, THIS->nrow)
1552 && rc.col > ROW(rc.row).l)
1553 {
1554 // col >= length means while line and add newline
1555 rc.col = THIS->ncol;
1556 }
1522 } 1557 }
1523 1558
1524 clamp_it (rc.col, 0, THIS->ncol); 1559 clamp_it (rc.col, 0, THIS->ncol);
1525 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); 1560 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
1526 1561
1573void 1608void
1574rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) 1609rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid)
1575 1610
1576void 1611void
1577rxvt_term::scr_bell () 1612rxvt_term::scr_bell ()
1613
1614void
1615rxvt_term::scr_change_screen (int screen)
1578 1616
1579void 1617void
1580rxvt_term::scr_add_lines (SV *string) 1618rxvt_term::scr_add_lines (SV *string)
1581 CODE: 1619 CODE:
1582{ 1620{
1732XUnmapWindow (rxvt_term *term, Window window) 1770XUnmapWindow (rxvt_term *term, Window window)
1733 C_ARGS: term->display->display, window 1771 C_ARGS: term->display->display, window
1734 1772
1735void 1773void
1736XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) 1774XMoveResizeWindow (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 1775 C_ARGS: term->display->display, window, x, y, width, height
1776
1777void
1778rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0)
1779 CODE:
1780{
1781 XWindowAttributes attr;
1782 XGetWindowAttributes (THIS->display->display, window, &attr);
1783 XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events);
1784}
1738 1785
1739void 1786void
1740rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) 1787rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
1741 PPCODE: 1788 PPCODE:
1742{ 1789{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines