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.27 by pcg, Tue Dec 30 01:35:58 2003 UTC vs.
Revision 1.33 by pcg, Fri Jan 30 18:12:17 2004 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: command.c 2 * File: command.c
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * $Id: command.C,v 1.27 2003/12/30 01:35:58 pcg Exp $ 4 * $Id: command.C,v 1.33 2004/01/30 18:12:17 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)
754 while (XPending (Xdisplay)); 752 while (XPending (Xdisplay));
755} 753}
756 754
757#ifdef CURSOR_BLINK 755#ifdef CURSOR_BLINK
758void 756void
759rxvt_term::blink_cb (time_watcher &w) 757rxvt_term::cursor_blink_cb (time_watcher &w)
760{ 758{
761 w.at += BLINK_INTERVAL;
762 hidden_cursor = !hidden_cursor; 759 hidden_cursor = !hidden_cursor;
763 want_refresh = 1; 760 want_refresh = 1;
761
762 w.start (w.at + BLINK_INTERVAL);
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 }
764} 776}
765#endif 777#endif
766 778
767void 779void
768rxvt_term::x_cb (io_watcher &w, short revents) 780rxvt_term::x_cb (io_watcher &w, short revents)
1019 quick_timeout |= R->want_full_refresh; 1031 quick_timeout |= R->want_full_refresh;
1020#endif 1032#endif
1021#endif 1033#endif
1022} 1034}
1023 1035
1036#ifdef POINTER_BLANK
1024void 1037void
1025rxvt_term::pointer_unblank () 1038rxvt_term::pointer_unblank ()
1026{ 1039{
1027 XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor); 1040 XDefineCursor (Xdisplay, TermWin.vt, TermWin_cursor);
1028 recolour_cursor (); 1041 recolour_cursor ();
1029 1042
1030#ifdef POINTER_BLANK
1031 hidden_pointer = 0; 1043 hidden_pointer = 0;
1032 1044
1033 if (Options & Opt_pointerBlank) 1045 if (Options & Opt_pointerBlank)
1034 pointer_ev.start (NOW + pointerBlankDelay); 1046 pointer_ev.start (NOW + pointerBlankDelay);
1035#endif
1036} 1047}
1037 1048
1038#ifdef POINTER_BLANK
1039void 1049void
1040rxvt_term::pointer_blank () 1050rxvt_term::pointer_blank ()
1041{ 1051{
1042 pointer_ev.stop ();
1043
1044 if (!(Options & Opt_pointerBlank)) 1052 if (!(Options & Opt_pointerBlank))
1045 return; 1053 return;
1046 1054
1047 XDefineCursor (Xdisplay, TermWin.vt, blank_cursor); 1055 XDefineCursor (Xdisplay, TermWin.vt, blank_cursor);
1048 XFlush (Xdisplay); 1056 XFlush (Xdisplay);
1295 if (R->Input_Context != NULL) 1303 if (R->Input_Context != NULL)
1296 XSetICFocus(R->Input_Context); 1304 XSetICFocus(R->Input_Context);
1297#endif 1305#endif
1298#ifdef CURSOR_BLINK 1306#ifdef CURSOR_BLINK
1299 if (R->Options & Opt_cursorBlink) 1307 if (R->Options & Opt_cursorBlink)
1300 R->blink_ev.start (NOW + BLINK_INTERVAL); 1308 R->cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1301#endif 1309#endif
1302 } 1310 }
1303 break; 1311 break;
1304 1312
1305 case FocusOut: 1313 case FocusOut:
1310 if (R->Input_Context != NULL) 1318 if (R->Input_Context != NULL)
1311 XUnsetICFocus(R->Input_Context); 1319 XUnsetICFocus(R->Input_Context);
1312#endif 1320#endif
1313#ifdef CURSOR_BLINK 1321#ifdef CURSOR_BLINK
1314 if (R->Options & Opt_cursorBlink) 1322 if (R->Options & Opt_cursorBlink)
1315 R->blink_ev.stop (); 1323 R->cursor_blink_ev.stop ();
1316 R->hidden_cursor = 0; 1324 R->hidden_cursor = 0;
1317#endif 1325#endif
1318 } 1326 }
1319 break; 1327 break;
1320 1328
1361 rxvt_selection_send(aR_ &(ev->xselectionrequest)); 1369 rxvt_selection_send(aR_ &(ev->xselectionrequest));
1362 break; 1370 break;
1363 1371
1364 case UnmapNotify: 1372 case UnmapNotify:
1365 R->TermWin.mapped = 0; 1373 R->TermWin.mapped = 0;
1374#ifdef TEXT_BLINK
1375 R->text_blink_ev.stop ();
1376#endif
1366 break; 1377 break;
1367 1378
1368 case MapNotify: 1379 case MapNotify:
1369 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
1370 break; 1384 break;
1371 1385
1372 case PropertyNotify: 1386 case PropertyNotify:
1373 if (ev->xproperty.atom == R->xa[XA_VT_SELECTION]) { 1387 if (ev->xproperty.atom == R->xa[XA_VT_SELECTION]) {
1374 if (ev->xproperty.state == PropertyNewValue) 1388 if (ev->xproperty.state == PropertyNewValue)
1460 if ((ev->xmotion.time - R->MEvent.time) > MOUSE_THRESHOLD) { 1474 if ((ev->xmotion.time - R->MEvent.time) > MOUSE_THRESHOLD) {
1461#endif 1475#endif
1462 R->selection_extend ((ev->xbutton.x), (ev->xbutton.y), 1476 R->selection_extend ((ev->xbutton.x), (ev->xbutton.y),
1463 (ev->xbutton.state & Button3Mask) ? 2 : 0); 1477 (ev->xbutton.state & Button3Mask) ? 2 : 0);
1464#ifdef SELECTION_SCROLLING 1478#ifdef SELECTION_SCROLLING
1465 if (ev->xbutton.y<R->TermWin.int_bwidth || 1479 if (ev->xbutton.y < R->TermWin.int_bwidth
1466 Pixel2Row(ev->xbutton.y)>(R->TermWin.nrow-1)) { 1480 || Pixel2Row(ev->xbutton.y) > (R->TermWin.nrow-1)) {
1467 int dist; 1481 int dist;
1468 1482
1469 R->pending_scroll_selection=1; 1483 R->pending_scroll_selection=1;
1470 1484
1471 /* don't clobber the current delay if we are 1485 /* don't clobber the current delay if we are
2694 break; 2708 break;
2695#endif 2709#endif
2696 2710
2697 case CSI_78: /* DECREQTPARM */ 2711 case CSI_78: /* DECREQTPARM */
2698 if (arg[0] == 0 || arg[0] == 1) 2712 if (arg[0] == 0 || arg[0] == 1)
2699 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);
2700 /* FALLTHROUGH */ 2714 /* FALLTHROUGH */
2701 2715
2702 default: 2716 default:
2703 break; 2717 break;
2704 } 2718 }
3071#endif 3085#endif
3072 { 1000, PrivMode_MouseX11 }, 3086 { 1000, PrivMode_MouseX11 },
3073 { 1010, PrivMode_TtyOutputInh }, 3087 { 1010, PrivMode_TtyOutputInh },
3074 { 1011, PrivMode_Keypress }, 3088 { 1011, PrivMode_Keypress },
3075 { 1047, PrivMode_Screen }, 3089 { 1047, PrivMode_Screen },
3090 { 1049, PrivMode_Screen }, /* xterm extension, not fully implemented */
3076 }; 3091 };
3077 3092
3078 if (nargs == 0) 3093 if (nargs == 0)
3079 return; 3094 return;
3080 3095
3187 R->Options |= Opt_scrollTtyKeypress; 3202 R->Options |= Opt_scrollTtyKeypress;
3188 else 3203 else
3189 R->Options &= ~Opt_scrollTtyKeypress; 3204 R->Options &= ~Opt_scrollTtyKeypress;
3190 break; 3205 break;
3191 case 1047: /* secondary screen w/ clearing */ 3206 case 1047: /* secondary screen w/ clearing */
3207 case 1049: /* better secondary screen w/ clearing, but not fully implemented */
3192 if (R->current_screen != PRIMARY) 3208 if (R->current_screen != PRIMARY)
3193 R->scr_erase_screen (2); 3209 R->scr_erase_screen (2);
3194 rxvt_scr_change_screen(aR_ state); 3210 rxvt_scr_change_screen(aR_ state);
3195 /* FALLTHROUGH */ 3211 /* FALLTHROUGH */
3196 default: 3212 default:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines