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.83 by root, Fri Jan 20 15:40:39 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 *
1159rxvt_term::pty_ev_events (int events = EVENT_UNDEF) 1171rxvt_term::pty_ev_events (int events = EVENT_UNDEF)
1160 CODE: 1172 CODE:
1161 RETVAL = THIS->pty_ev.events; 1173 RETVAL = THIS->pty_ev.events;
1162 if (events != EVENT_UNDEF) 1174 if (events != EVENT_UNDEF)
1163 THIS->pty_ev.set (events); 1175 THIS->pty_ev.set (events);
1176 OUTPUT:
1177 RETVAL
1178
1179int
1180rxvt_term::pty_fd ()
1181 CODE:
1182 RETVAL = THIS->pty->pty;
1164 OUTPUT: 1183 OUTPUT:
1165 RETVAL 1184 RETVAL
1166 1185
1167Window 1186Window
1168rxvt_term::parent () 1187rxvt_term::parent ()
1519 if (items == 3) 1538 if (items == 3)
1520 { 1539 {
1521 rc.row = SvIV (ST (1)); 1540 rc.row = SvIV (ST (1));
1522 rc.col = SvIV (ST (2)); 1541 rc.col = SvIV (ST (2));
1523 1542
1524 if (ix == 2 && rc.col == 0) 1543 if (ix == 2)
1525 { 1544 {
1545 if (rc.col == 0)
1546 {
1547 // col == 0 means end of previous line
1526 rc.row--; 1548 rc.row--;
1527 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 }
1528 } 1557 }
1529 1558
1530 clamp_it (rc.col, 0, THIS->ncol); 1559 clamp_it (rc.col, 0, THIS->ncol);
1531 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); 1560 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
1532 1561
1579void 1608void
1580rxvt_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)
1581 1610
1582void 1611void
1583rxvt_term::scr_bell () 1612rxvt_term::scr_bell ()
1613
1614void
1615rxvt_term::scr_change_screen (int screen)
1584 1616
1585void 1617void
1586rxvt_term::scr_add_lines (SV *string) 1618rxvt_term::scr_add_lines (SV *string)
1587 CODE: 1619 CODE:
1588{ 1620{
1738XUnmapWindow (rxvt_term *term, Window window) 1770XUnmapWindow (rxvt_term *term, Window window)
1739 C_ARGS: term->display->display, window 1771 C_ARGS: term->display->display, window
1740 1772
1741void 1773void
1742XMoveResizeWindow (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)
1743 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}
1744 1785
1745void 1786void
1746rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) 1787rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
1747 PPCODE: 1788 PPCODE:
1748{ 1789{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines