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.25 by pcg, Fri Dec 19 09:41:09 2003 UTC vs.
Revision 1.31 by pcg, Thu Jan 29 23:26:01 2004 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: command.c 2 * File: command.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: command.C,v 1.25 2003/12/19 09:41:09 pcg Exp $ 4 * $Id: command.C,v 1.31 2004/01/29 23:26:01 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>
716 XEvent xev; 716 XEvent xev;
717 717
718 XNextEvent (Xdisplay, &xev); 718 XNextEvent (Xdisplay, &xev);
719 719
720#if defined(CURSOR_BLINK) 720#if defined(CURSOR_BLINK)
721 if ((Options & Opt_cursorBlink) 721 if ((Options & Opt_cursorBlink) && xev.type == KeyPress)
722 && xev.type == KeyPress)
723 { 722 {
724 if (hidden_cursor) 723 if (hidden_cursor)
725 { 724 {
726 hidden_cursor = 0; 725 hidden_cursor = 0;
727 want_refresh = 1; 726 want_refresh = 1;
728 } 727 }
729 728
730 blink_ev.start (NOW + BLINK_INTERVAL); 729 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
731 } 730 }
732#endif 731#endif
733 732
734#if defined(POINTER_BLANK) 733#if defined(POINTER_BLANK)
735 if ((Options & Opt_pointerBlank) 734 if ((Options & Opt_pointerBlank) && pointerBlankDelay > 0)
736 && (pointerBlankDelay > 0))
737 { 735 {
738 if (xev.type == MotionNotify 736 if (xev.type == MotionNotify
739 || xev.type == ButtonPress 737 || xev.type == ButtonPress
740 || xev.type == ButtonRelease) 738 || xev.type == ButtonRelease)
741 if (hidden_pointer) 739 if (hidden_pointer)
752 rxvt_process_x_event (this, &xev); 750 rxvt_process_x_event (this, &xev);
753 } 751 }
754 while (XPending (Xdisplay)); 752 while (XPending (Xdisplay));
755} 753}
756 754
755#ifdef CURSOR_BLINK
757void 756void
758rxvt_term::blink_cb (time_watcher &w) 757rxvt_term::cursor_blink_cb (time_watcher &w)
759{ 758{
760 w.at += BLINK_INTERVAL;
761 hidden_cursor = !hidden_cursor; 759 hidden_cursor = !hidden_cursor;
762 want_refresh = 1; 760 want_refresh = 1;
761
762 w.start (w.at + BLINK_INTERVAL);
763} 763}
764#endif
765
766#ifdef TEXT_BLINK
767void
768rxvt_term::text_blink_cb (time_watcher &w)
769{
770 if (scr_refresh_rend (RS_Blink, RS_Blink))
771 {
772 hidden_text = !hidden_text;
773 want_refresh = 1;
774 w.start (w.at + TEXT_BLINK_INTERVAL);
775 }
776}
777#endif
764 778
765void 779void
766rxvt_term::x_cb (io_watcher &w, short revents) 780rxvt_term::x_cb (io_watcher &w, short revents)
767{ 781{
768 SET_R (this); 782 SET_R (this);
1017 quick_timeout |= R->want_full_refresh; 1031 quick_timeout |= R->want_full_refresh;
1018#endif 1032#endif
1019#endif 1033#endif
1020} 1034}
1021 1035
1036#ifdef POINTER_BLANK
1022void 1037void
1023rxvt_term::pointer_unblank () 1038rxvt_term::pointer_unblank ()
1024{ 1039{
1025 XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor); 1040 XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor);
1026 recolour_cursor (); 1041 recolour_cursor ();
1027 1042
1028#ifdef POINTER_BLANK
1029 hidden_pointer = 0; 1043 hidden_pointer = 0;
1030 1044
1031 if (Options & Opt_pointerBlank) 1045 if (Options & Opt_pointerBlank)
1032 pointer_ev.start (NOW + pointerBlankDelay); 1046 pointer_ev.start (NOW + pointerBlankDelay);
1033#endif
1034} 1047}
1035 1048
1036#ifdef POINTER_BLANK
1037void 1049void
1038rxvt_term::pointer_blank () 1050rxvt_term::pointer_blank ()
1039{ 1051{
1040 pointer_ev.stop ();
1041
1042 if (!(Options & Opt_pointerBlank)) 1052 if (!(Options & Opt_pointerBlank))
1043 return; 1053 return;
1044 1054
1045 XDefineCursor (Xdisplay, TermWin.vt, blank_cursor); 1055 XDefineCursor (Xdisplay, TermWin.vt, blank_cursor);
1046 XFlush (Xdisplay); 1056 XFlush (Xdisplay);
1293 if (R->Input_Context != NULL) 1303 if (R->Input_Context != NULL)
1294 XSetICFocus(R->Input_Context); 1304 XSetICFocus(R->Input_Context);
1295#endif 1305#endif
1296#ifdef CURSOR_BLINK 1306#ifdef CURSOR_BLINK
1297 if (R->Options & Opt_cursorBlink) 1307 if (R->Options & Opt_cursorBlink)
1298 R->blink_ev.start (NOW + BLINK_INTERVAL); 1308 R->cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1299#endif 1309#endif
1300 } 1310 }
1301 break; 1311 break;
1302 1312
1303 case FocusOut: 1313 case FocusOut:
1308 if (R->Input_Context != NULL) 1318 if (R->Input_Context != NULL)
1309 XUnsetICFocus(R->Input_Context); 1319 XUnsetICFocus(R->Input_Context);
1310#endif 1320#endif
1311#ifdef CURSOR_BLINK 1321#ifdef CURSOR_BLINK
1312 if (R->Options & Opt_cursorBlink) 1322 if (R->Options & Opt_cursorBlink)
1313 R->blink_ev.stop (); 1323 R->cursor_blink_ev.stop ();
1314 R->hidden_cursor = 0; 1324 R->hidden_cursor = 0;
1315#endif 1325#endif
1316 } 1326 }
1317 break; 1327 break;
1318 1328
1359 rxvt_selection_send(aR_ &(ev->xselectionrequest)); 1369 rxvt_selection_send(aR_ &(ev->xselectionrequest));
1360 break; 1370 break;
1361 1371
1362 case UnmapNotify: 1372 case UnmapNotify:
1363 R->TermWin.mapped = 0; 1373 R->TermWin.mapped = 0;
1374#ifdef TEXT_BLINK
1375 R->text_blink_ev.stop ();
1376#endif
1364 break; 1377 break;
1365 1378
1366 case MapNotify: 1379 case MapNotify:
1367 R->TermWin.mapped = 1; 1380 R->TermWin.mapped = 1;
1381#ifdef TEXT_BLINK
1382 R->text_blink_ev.start (NOW + TEXT_BLINK_INTERVAL);
1383#endif
1368 break; 1384 break;
1369 1385
1370 case PropertyNotify: 1386 case PropertyNotify:
1371 if (ev->xproperty.atom == R->xa[XA_VT_SELECTION]) { 1387 if (ev->xproperty.atom == R->xa[XA_VT_SELECTION]) {
1372 if (ev->xproperty.state == PropertyNewValue) 1388 if (ev->xproperty.state == PropertyNewValue)
1526 1542
1527/* INTPROTO */ 1543/* INTPROTO */
1528void 1544void
1529rxvt_button_press(pR_ XButtonEvent *ev) 1545rxvt_button_press(pR_ XButtonEvent *ev)
1530{ 1546{
1531 int reportmode = 0, clickintime; 1547 int reportmode = 0, clickintime;
1532 1548
1533 R->bypass_keystate = ev->state & (R->ModMetaMask | ShiftMask); 1549 R->bypass_keystate = ev->state & (R->ModMetaMask | ShiftMask);
1534 if (!R->bypass_keystate) 1550 if (!R->bypass_keystate)
1535 reportmode = !!(R->PrivateModes & PrivMode_mouse_report); 1551 reportmode = !!(R->PrivateModes & PrivMode_mouse_report);
1536/* 1552/*
1584 R->MEvent.clicks = 0; 1600 R->MEvent.clicks = 0;
1585 switch (ev->button) 1601 switch (ev->button)
1586 { 1602 {
1587 case Button1: 1603 case Button1:
1588 /* allow shift+left click to extend selection */ 1604 /* allow shift+left click to extend selection */
1589 if (ev->state & ShiftMask) 1605 if (ev->state & ShiftMask && !(R->PrivateModes & PrivMode_mouse_report))
1590 { 1606 {
1591 if (R->MEvent.button == Button1 && clickintime) 1607 if (R->MEvent.button == Button1 && clickintime)
1592 R->selection_rotate (ev->x, ev->y); 1608 R->selection_rotate (ev->x, ev->y);
1593 else 1609 else
1594 R->selection_extend (ev->x, ev->y, 1); 1610 R->selection_extend (ev->x, ev->y, 1);
2692 break; 2708 break;
2693#endif 2709#endif
2694 2710
2695 case CSI_78: /* DECREQTPARM */ 2711 case CSI_78: /* DECREQTPARM */
2696 if (arg[0] == 0 || arg[0] == 1) 2712 if (arg[0] == 0 || arg[0] == 1)
2697 R->tt_printf("\033[%d;1;1;112;112;1;0x", arg[0] + 2); 2713 R->tt_printf("\033[%d;1;1;128;128;1;0x", arg[0] + 2);
2698 /* FALLTHROUGH */ 2714 /* FALLTHROUGH */
2699 2715
2700 default: 2716 default:
2701 break; 2717 break;
2702 } 2718 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines