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.18 by pcg, Thu Dec 18 02:07:12 2003 UTC vs.
Revision 1.19 by pcg, Thu Dec 18 05:45:11 2003 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: command.c 2 * File: command.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: command.C,v 1.18 2003/12/18 02:07:12 pcg Exp $ 4 * $Id: command.C,v 1.19 2003/12/18 05:45:11 pcg Exp $
5 * 5 *
6 * All portions of code are copyright by their respective author/s. 6 * All portions of code are copyright by their respective author/s.
7 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> 7 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
8 * - original version 8 * - original version
9 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> 9 * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com>
691 691
692void 692void
693rxvt_term::check_cb (check_watcher &w) 693rxvt_term::check_cb (check_watcher &w)
694{ 694{
695 SET_R (this); 695 SET_R (this);
696 SET_LOCALE (locale);
696 697
697 flush (); 698 flush ();
698} 699}
699 700
700void 701void
744} 745}
745 746
746void 747void
747rxvt_term::blink_cb (time_watcher &w) 748rxvt_term::blink_cb (time_watcher &w)
748{ 749{
749 SET_R (this);
750
751 w.at += BLINK_INTERVAL; 750 w.at += BLINK_INTERVAL;
752 hidden_cursor = !hidden_cursor; 751 hidden_cursor = !hidden_cursor;
753 want_refresh = 1; 752 want_refresh = 1;
754} 753}
755 754
756void 755void
757rxvt_term::x_cb (io_watcher &w, short revents) 756rxvt_term::x_cb (io_watcher &w, short revents)
758{ 757{
759 SET_R (this); 758 SET_R (this);
759 SET_LOCALE (locale);
760 760
761 process_x_events (); 761 process_x_events ();
762} 762}
763 763
764bool 764bool
785 785
786void 786void
787rxvt_term::pty_cb (io_watcher &w, short revents) 787rxvt_term::pty_cb (io_watcher &w, short revents)
788{ 788{
789 SET_R (this); 789 SET_R (this);
790 SET_LOCALE (locale);
790 791
791 if (revents & EVENT_WRITE) 792 if (revents & EVENT_WRITE)
792 tt_write (0, 0); 793 tt_write (0, 0);
793 else if (revents & EVENT_READ) 794 else if (revents & EVENT_READ)
794 { 795 {
1038 1039
1039void 1040void
1040rxvt_term::pointer_unblank () 1041rxvt_term::pointer_unblank ()
1041{ 1042{
1042 XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor); 1043 XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor);
1043 rxvt_recolour_cursor (this); 1044 recolour_cursor ();
1044 1045
1045#ifdef POINTER_BLANK 1046#ifdef POINTER_BLANK
1046 hidden_pointer = 0; 1047 hidden_pointer = 0;
1047 1048
1048 if (Options & Opt_pointerBlank) 1049 if (Options & Opt_pointerBlank)
1067 1068
1068void 1069void
1069rxvt_term::pointer_cb (time_watcher &w) 1070rxvt_term::pointer_cb (time_watcher &w)
1070{ 1071{
1071 SET_R (this); 1072 SET_R (this);
1073 SET_LOCALE (locale);
1072 1074
1073 pointer_blank (); 1075 pointer_blank ();
1074} 1076}
1075#endif 1077#endif
1076 1078
1432 &unused_xevent)) ; 1434 &unused_xevent)) ;
1433 while (XCheckTypedWindowEvent(R->Xdisplay, ev->xany.window, 1435 while (XCheckTypedWindowEvent(R->Xdisplay, ev->xany.window,
1434 GraphicsExpose, 1436 GraphicsExpose,
1435 &unused_xevent)) ; 1437 &unused_xevent)) ;
1436 if (isScrollbarWindow(ev->xany.window)) { 1438 if (isScrollbarWindow(ev->xany.window)) {
1437 scrollbar_setIdle(); 1439 R->scrollBar.setIdle();
1438 rxvt_scrollbar_show(aR_ 0); 1440 rxvt_scrollbar_show(aR_ 0);
1439 } 1441 }
1440#ifdef MENUBAR 1442#ifdef MENUBAR
1441 if (menubar_visible(aR) && isMenuBarWindow(ev->xany.window)) 1443 if (menubar_visible(aR) && isMenuBarWindow(ev->xany.window))
1442 rxvt_menubar_expose(aR); 1444 rxvt_menubar_expose(aR);
1627/* 1629/*
1628 * Scrollbar window processing of button press 1630 * Scrollbar window processing of button press
1629 */ 1631 */
1630 if (isScrollbarWindow(ev->window)) 1632 if (isScrollbarWindow(ev->window))
1631 { 1633 {
1632 scrollbar_setIdle(); 1634 R->scrollBar.setIdle ();
1633 /* 1635 /*
1634 * Rxvt-style scrollbar: 1636 * Rxvt-style scrollbar:
1635 * move up if mouse is above slider 1637 * move up if mouse is above slider
1636 * move dn if mouse is below slider 1638 * move dn if mouse is below slider
1637 * 1639 *
1690#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1692#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1691 R->scroll_arrow_delay = SCROLLBAR_INITIAL_DELAY; 1693 R->scroll_arrow_delay = SCROLLBAR_INITIAL_DELAY;
1692#endif 1694#endif
1693 if (rxvt_scr_page(aR_ upordown < 0 ? UP : DN, 1)) { 1695 if (rxvt_scr_page(aR_ upordown < 0 ? UP : DN, 1)) {
1694 if (upordown < 0) 1696 if (upordown < 0)
1695 scrollbar_setUp(); 1697 R->scrollBar.setUp ();
1696 else 1698 else
1697 scrollbar_setDn(); 1699 R->scrollBar.setDn ();
1698 } 1700 }
1699 } else 1701 } else
1700 switch (ev->button) { 1702 switch (ev->button) {
1701 case Button2: 1703 case Button2:
1702 switch (R->scrollbar_align) { 1704 switch (R->scrollbar_align) {
1714 || scrollbar_above_slider(ev->y) 1716 || scrollbar_above_slider(ev->y)
1715 || scrollbar_below_slider(ev->y)) 1717 || scrollbar_below_slider(ev->y))
1716 rxvt_scr_move_to(aR_ 1718 rxvt_scr_move_to(aR_
1717 scrollbar_position(ev->y) - R->csrO, 1719 scrollbar_position(ev->y) - R->csrO,
1718 scrollbar_size()); 1720 scrollbar_size());
1719 scrollbar_setMotion(); 1721 R->scrollBar.setMotion ();
1720 break; 1722 break;
1721 1723
1722 case Button1: 1724 case Button1:
1723 if (R->scrollbar_align == R_SB_ALIGN_CENTRE) 1725 if (R->scrollbar_align == R_SB_ALIGN_CENTRE)
1724 R->csrO = ev->y - R->scrollBar.top; 1726 R->csrO = ev->y - R->scrollBar.top;
1737 rxvt_scr_page(aR_ DN, R->TermWin.nrow - 1); 1739 rxvt_scr_page(aR_ DN, R->TermWin.nrow - 1);
1738# else 1740# else
1739 rxvt_scr_page(aR_ DN, R->TermWin.nrow / 4); 1741 rxvt_scr_page(aR_ DN, R->TermWin.nrow / 4);
1740# endif 1742# endif
1741 else 1743 else
1742 scrollbar_setMotion(); 1744 R->scrollBar.setMotion ();
1743 } else { 1745 } else {
1744 rxvt_scr_page(aR_ (ev->button == Button1 ? DN : UP), 1746 rxvt_scr_page(aR_ (ev->button == Button1 ? DN : UP),
1745 (R->TermWin.nrow 1747 (R->TermWin.nrow
1746 * scrollbar_position(ev->y) 1748 * scrollbar_position(ev->y)
1747 / scrollbar_size())); 1749 / scrollbar_size()));
1769 R->csrO = 0; /* reset csr Offset */ 1771 R->csrO = 0; /* reset csr Offset */
1770 if (!R->bypass_keystate) 1772 if (!R->bypass_keystate)
1771 reportmode = !!(R->PrivateModes & PrivMode_mouse_report); 1773 reportmode = !!(R->PrivateModes & PrivMode_mouse_report);
1772 1774
1773 if (scrollbar_isUpDn()) { 1775 if (scrollbar_isUpDn()) {
1774 scrollbar_setIdle(); 1776 R->scrollBar.setIdle ();
1775 rxvt_scrollbar_show(aR_ 0); 1777 rxvt_scrollbar_show(aR_ 0);
1776#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1778#ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
1777 R->refresh_type &= ~SMOOTH_REFRESH; 1779 R->refresh_type &= ~SMOOTH_REFRESH;
1778#endif 1780#endif
1779 } 1781 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines