ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.49 by pcg, Sat Feb 21 22:14:00 2004 UTC vs.
Revision 1.50 by pcg, Sun Feb 22 08:09:37 2004 UTC

241 } 241 }
242#ifdef PRINTPIPE 242#ifdef PRINTPIPE
243 if (keysym == XK_Print) 243 if (keysym == XK_Print)
244 { 244 {
245 scr_printscreen (ctrl | shft); 245 scr_printscreen (ctrl | shft);
246 return;
247 }
248#endif
249#ifdef GREEK_SUPPORT
250 if (keysym == ks_greekmodeswith)
251 {
252 greek_mode = !greek_mode;
253 if (greek_mode)
254 {
255 xterm_seq (XTerm_title,
256 (greek_getmode () == GREEK_ELOT928
257 ? "[Greek: iso]" : "[Greek: ibm]"), CHAR_ST);
258 greek_reset ();
259 }
260 else
261 xterm_seq (XTerm_title, APL_NAME "-" VERSION, CHAR_ST);
262 return; 246 return;
263 } 247 }
264#endif 248#endif
265 249
266 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 250 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
638 for (ch = kbuf; ch < kbuf + len; ch++) 622 for (ch = kbuf; ch < kbuf + len; ch++)
639 *ch |= 0x80; 623 *ch |= 0x80;
640 meta = 0; 624 meta = 0;
641 } 625 }
642#endif 626#endif
643#ifdef GREEK_SUPPORT
644 if (greek_mode)
645 len = greek_xlat (kbuf, len);
646#endif
647 /* nil */ ; 627 /* nil */ ;
648 } 628 }
649 } 629 }
650 630
651 if (len <= 0) 631 if (len <= 0)
1424 } 1404 }
1425#ifdef MENUBAR 1405#ifdef MENUBAR
1426 if (menubar_visible () && isMenuBarWindow (ev.xany.window)) 1406 if (menubar_visible () && isMenuBarWindow (ev.xany.window))
1427 menubar_expose (); 1407 menubar_expose ();
1428#endif 1408#endif
1429#ifdef RXVT_GRAPHICS
1430 Gr_expose (ev.xany.window);
1431#endif
1432
1433 } 1409 }
1434 break; 1410 break;
1435 1411
1436 case MotionNotify: 1412 case MotionNotify:
1437#ifdef POINTER_BLANK 1413#ifdef POINTER_BLANK
1590 /* 1566 /*
1591 * VT window processing of button press 1567 * VT window processing of button press
1592 */ 1568 */
1593 if (ev.window == TermWin.vt) 1569 if (ev.window == TermWin.vt)
1594 { 1570 {
1595#if RXVT_GRAPHICS
1596 if (ev.subwindow != None)
1597 rxvt_Gr_ButtonPress (ev.x, ev.y);
1598 else
1599#endif
1600
1601 {
1602 clickintime = ev.time - MEvent.time < MULTICLICK_TIME; 1571 clickintime = ev.time - MEvent.time < MULTICLICK_TIME;
1603 if (reportmode) 1572 if (reportmode)
1573 {
1574 /* mouse report from vt window */
1575 /* save the xbutton state (for ButtonRelease) */
1576 MEvent.state = ev.state;
1577#ifdef MOUSE_REPORT_DOUBLECLICK
1578 if (ev.button == MEvent.button && clickintime)
1604 { 1579 {
1605 /* mouse report from vt window */ 1580 /* same button, within alloted time */
1606 /* save the xbutton state (for ButtonRelease) */ 1581 MEvent.clicks++;
1607 MEvent.state = ev.state; 1582 if (MEvent.clicks > 1)
1608#ifdef MOUSE_REPORT_DOUBLECLICK
1609 if (ev.button == MEvent.button && clickintime)
1610 { 1583 {
1611 /* same button, within alloted time */
1612 MEvent.clicks++;
1613 if (MEvent.clicks > 1)
1614 {
1615 /* only report double clicks */ 1584 /* only report double clicks */
1616 MEvent.clicks = 2; 1585 MEvent.clicks = 2;
1617 mouse_report (ev); 1586 mouse_report (ev);
1618 1587
1619 /* don't report the release */ 1588 /* don't report the release */
1620 MEvent.clicks = 0; 1589 MEvent.clicks = 0;
1621 MEvent.button = AnyButton; 1590 MEvent.button = AnyButton;
1622 }
1623 } 1591 }
1624 else
1625 {
1626 /* different button, or time expired */
1627 MEvent.clicks = 1;
1628 MEvent.button = ev.button;
1629 mouse_report (ev);
1630 }
1631#else
1632 MEvent.button = ev.button;
1633 mouse_report (ev);
1634#endif /* MOUSE_REPORT_DOUBLECLICK */
1635
1636 } 1592 }
1637 else 1593 else
1638 { 1594 {
1595 /* different button, or time expired */
1596 MEvent.clicks = 1;
1597 MEvent.button = ev.button;
1598 mouse_report (ev);
1599 }
1600#else
1601 MEvent.button = ev.button;
1602 mouse_report (ev);
1603#endif /* MOUSE_REPORT_DOUBLECLICK */
1604
1605 }
1606 else
1607 {
1639 if (ev.button != MEvent.button) 1608 if (ev.button != MEvent.button)
1640 MEvent.clicks = 0; 1609 MEvent.clicks = 0;
1641 switch (ev.button) 1610 switch (ev.button)
1642 { 1611 {
1643 case Button1: 1612 case Button1:
1644 /* allow shift+left click to extend selection */ 1613 /* allow shift+left click to extend selection */
1645 if (ev.state & ShiftMask && ! (PrivateModes & PrivMode_mouse_report)) 1614 if (ev.state & ShiftMask && ! (PrivateModes & PrivMode_mouse_report))
1646 { 1615 {
1647 if (MEvent.button == Button1 && clickintime)
1648 selection_rotate (ev.x, ev.y);
1649 else
1650 selection_extend (ev.x, ev.y, 1);
1651 }
1652 else
1653 {
1654 if (MEvent.button == Button1 && clickintime)
1655 MEvent.clicks++;
1656 else
1657 MEvent.clicks = 1;
1658
1659 selection_click (MEvent.clicks, ev.x, ev.y);
1660 }
1661
1662 MEvent.button = Button1;
1663 break;
1664
1665 case Button3:
1666 if (MEvent.button == Button3 && clickintime) 1616 if (MEvent.button == Button1 && clickintime)
1667 selection_rotate (ev.x, ev.y); 1617 selection_rotate (ev.x, ev.y);
1668 else 1618 else
1669 selection_extend (ev.x, ev.y, 1); 1619 selection_extend (ev.x, ev.y, 1);
1620 }
1621 else
1622 {
1623 if (MEvent.button == Button1 && clickintime)
1624 MEvent.clicks++;
1625 else
1626 MEvent.clicks = 1;
1627
1628 selection_click (MEvent.clicks, ev.x, ev.y);
1629 }
1630
1631 MEvent.button = Button1;
1632 break;
1633
1634 case Button3:
1635 if (MEvent.button == Button3 && clickintime)
1636 selection_rotate (ev.x, ev.y);
1637 else
1638 selection_extend (ev.x, ev.y, 1);
1670 MEvent.button = Button3; 1639 MEvent.button = Button3;
1671 break; 1640 break;
1672 }
1673 } 1641 }
1642 }
1674 MEvent.time = ev.time; 1643 MEvent.time = ev.time;
1675 return; 1644 return;
1676 }
1677 } 1645 }
1678 1646
1679 /* 1647 /*
1680 * Scrollbar window processing of button press 1648 * Scrollbar window processing of button press
1681 */ 1649 */
1846#ifdef SELECTION_SCROLLING 1814#ifdef SELECTION_SCROLLING
1847 pending_scroll_selection=0; 1815 pending_scroll_selection=0;
1848#endif 1816#endif
1849 if (ev.window == TermWin.vt) 1817 if (ev.window == TermWin.vt)
1850 { 1818 {
1851#ifdef RXVT_GRAPHICS
1852 if (ev.subwindow != None)
1853 rxvt_Gr_ButtonRelease (ev.x, ev.y);
1854 else
1855#endif
1856
1857 {
1858 if (reportmode) 1819 if (reportmode)
1820 {
1821 /* mouse report from vt window */
1822 /* don't report release of wheel "buttons" */
1823 if (ev.button >= 4)
1824 return;
1825#ifdef MOUSE_REPORT_DOUBLECLICK
1826 /* only report the release of 'slow' single clicks */
1827 if (MEvent.button != AnyButton
1828 && (ev.button != MEvent.button
1829 || (ev.time - MEvent.time
1830 > MULTICLICK_TIME / 2)))
1859 { 1831 {
1860 /* mouse report from vt window */
1861 /* don't report release of wheel "buttons" */
1862 if (ev.button >= 4)
1863 return;
1864#ifdef MOUSE_REPORT_DOUBLECLICK
1865 /* only report the release of 'slow' single clicks */
1866 if (MEvent.button != AnyButton
1867 && (ev.button != MEvent.button
1868 || (ev.time - MEvent.time
1869 > MULTICLICK_TIME / 2)))
1870 {
1871 MEvent.clicks = 0; 1832 MEvent.clicks = 0;
1872 MEvent.button = AnyButton;
1873 mouse_report (ev);
1874 }
1875#else /* MOUSE_REPORT_DOUBLECLICK */
1876 MEvent.button = AnyButton; 1833 MEvent.button = AnyButton;
1877 mouse_report (ev); 1834 mouse_report (ev);
1835 }
1836#else /* MOUSE_REPORT_DOUBLECLICK */
1837 MEvent.button = AnyButton;
1838 mouse_report (ev);
1878#endif /* MOUSE_REPORT_DOUBLECLICK */ 1839#endif /* MOUSE_REPORT_DOUBLECLICK */
1879 return; 1840 return;
1880 } 1841 }
1881 /* 1842 /*
1882 * dumb hack to compensate for the failure of click-and-drag 1843 * dumb hack to compensate for the failure of click-and-drag
1883 * when overriding mouse reporting 1844 * when overriding mouse reporting
1884 */ 1845 */
1885 if (PrivateModes & PrivMode_mouse_report 1846 if (PrivateModes & PrivMode_mouse_report
1886 && bypass_keystate 1847 && bypass_keystate
1887 && ev.button == Button1 && MEvent.clicks <= 1) 1848 && ev.button == Button1 && MEvent.clicks <= 1)
1888 selection_extend (ev.x, ev.y, 0); 1849 selection_extend (ev.x, ev.y, 0);
1889 1850
1890 switch (ev.button) 1851 switch (ev.button)
1852 {
1853 case Button1:
1854 case Button3:
1855 selection_make (ev.time);
1856 break;
1857 case Button2:
1858 selection_request (ev.time, ev.x, ev.y);
1859 break;
1860#ifdef MOUSE_WHEEL
1861 case Button4:
1862 case Button5:
1891 { 1863 {
1892 case Button1: 1864 int i;
1893 case Button3: 1865 page_dirn v;
1894 selection_make (ev.time); 1866
1867 v = (ev.button == Button4) ? UP : DN;
1868 if (ev.state & ShiftMask)
1895 break; 1869 i = 1;
1896 case Button2: 1870 else if ((Options & Opt_mouseWheelScrollPage))
1897 selection_request (ev.time, ev.x, ev.y); 1871 i = TermWin.nrow - 1;
1872 else
1898 break; 1873 i = 5;
1899#ifdef MOUSE_WHEEL 1874# ifdef MOUSE_SLIP_WHEELING
1900 case Button4: 1875 if (ev.state & ControlMask)
1901 case Button5:
1902 { 1876 {
1903 int i;
1904 page_dirn v;
1905
1906 v = (ev.button == Button4) ? UP : DN;
1907 if (ev.state & ShiftMask)
1908 i = 1;
1909 else if ((Options & Opt_mouseWheelScrollPage))
1910 i = TermWin.nrow - 1;
1911 else
1912 i = 5;
1913# ifdef MOUSE_SLIP_WHEELING
1914 if (ev.state & ControlMask)
1915 {
1916 mouse_slip_wheel_speed += (v ? -1 : 1); 1877 mouse_slip_wheel_speed += (v ? -1 : 1);
1917 mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY; 1878 mouse_slip_wheel_delay = SCROLLBAR_CONTINUOUS_DELAY;
1918 } 1879 }
1919# endif 1880# endif
1920# ifdef JUMP_MOUSE_WHEEL 1881# ifdef JUMP_MOUSE_WHEEL
1882 scr_page (v, i);
1883 scr_refresh (SMOOTH_REFRESH);
1884 scrollbar_show (1);
1885# else
1886 while (i--)
1887 {
1921 scr_page (v, i); 1888 scr_page (v, 1);
1922 scr_refresh (SMOOTH_REFRESH); 1889 scr_refresh (SMOOTH_REFRESH);
1923 scrollbar_show (1); 1890 scrollbar_show (1);
1924# else
1925 while (i--)
1926 {
1927 scr_page (v, 1);
1928 scr_refresh (SMOOTH_REFRESH);
1929 scrollbar_show (1);
1930 } 1891 }
1931# endif 1892# endif
1932 1893
1933 }
1934 break;
1935#endif
1936
1937 } 1894 }
1895 break;
1896#endif
1897
1938 } 1898 }
1939 } 1899 }
1940#ifdef MENUBAR 1900#ifdef MENUBAR
1941 else if (isMenuBarWindow (ev.window)) 1901 else if (isMenuBarWindow (ev.window))
1942 menubar_control (ev); 1902 menubar_control (ev);
3472void 3432void
3473rxvt_term::process_graphics () 3433rxvt_term::process_graphics ()
3474{ 3434{
3475 unsigned char ch, cmd = cmd_getc (); 3435 unsigned char ch, cmd = cmd_getc ();
3476 3436
3477#ifndef RXVT_GRAPHICS
3478 if (cmd == 'Q') 3437 if (cmd == 'Q')
3479 { /* query graphics */ 3438 { /* query graphics */
3480 tt_printf ("\033G0\n"); /* no graphics */ 3439 tt_printf ("\033G0\n"); /* no graphics */
3481 return; 3440 return;
3482 } 3441 }
3483 /* swallow other graphics sequences until terminating ':' */ 3442 /* swallow other graphics sequences until terminating ':' */
3484 do 3443 do
3485 ch = cmd_getc (); 3444 ch = cmd_getc ();
3486 while (ch != ':'); 3445 while (ch != ':');
3487#else
3488 unsigned int nargs;
3489 int args[NGRX_PTS];
3490 unsigned char *text = NULL;
3491
3492 if (cmd == 'Q')
3493 { /* query graphics */
3494 tt_printf ("\033G1\n"); /* yes, graphics (color) */
3495 return;
3496 }
3497 for (nargs = 0; nargs < (sizeof (args) / sizeof (args[0])) - 1;)
3498 {
3499 int neg;
3500
3501 ch = cmd_getc ();
3502 neg = (ch == '-');
3503 if (neg || ch == '+')
3504 ch = cmd_getc ();
3505
3506 for (args[nargs] = 0; isdigit (ch); ch = cmd_getc ())
3507 args[nargs] = args[nargs] * 10 + (ch - '0');
3508 if (neg)
3509 args[nargs] = -args[nargs];
3510
3511 nargs++;
3512 args[nargs] = 0;
3513 if (ch != ';')
3514 break;
3515 }
3516
3517 if ((cmd == 'T') && (nargs >= 5))
3518 {
3519 int i, len = args[4];
3520
3521 text = (unsigned char *)rxvt_malloc ((len + 1) * sizeof (char));
3522
3523 if (text != NULL)
3524 {
3525 for (i = 0; i < len; i++)
3526 text[i] = cmd_getc ();
3527 text[len] = '\0';
3528 }
3529 }
3530 Gr_do_graphics (cmd, nargs, args, text);
3531#endif
3532} 3446}
3533/*}}} */ 3447/*}}} */
3534 3448
3535/* ------------------------------------------------------------------------- */ 3449/* ------------------------------------------------------------------------- */
3536 3450

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines