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.218 by root, Sat Dec 31 16:40:28 2005 UTC vs.
Revision 1.219 by root, Sat Dec 31 17:16:17 2005 UTC

866 } 866 }
867 867
868 if (len <= 0) 868 if (len <= 0)
869 return; /* not mapped */ 869 return; /* not mapped */
870 870
871 if (options & Opt_scrollTtyKeypress) 871 if (OPTION (Opt_scrollTtyKeypress))
872 if (view_start) 872 if (view_start)
873 { 873 {
874 view_start = 0; 874 view_start = 0;
875 want_refresh = 1; 875 want_refresh = 1;
876 } 876 }
1093 } 1093 }
1094 else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) 1094 else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0)
1095 { 1095 {
1096 pty_ev.stop (); 1096 pty_ev.stop ();
1097 1097
1098 if (!(options & Opt_hold)) 1098 if (!OPTION (Opt_hold))
1099 destroy (); 1099 destroy ();
1100 } 1100 }
1101 1101
1102 return false; 1102 return false;
1103} 1103}
1125 recolour_cursor (); 1125 recolour_cursor ();
1126 1126
1127#ifdef POINTER_BLANK 1127#ifdef POINTER_BLANK
1128 hidden_pointer = 0; 1128 hidden_pointer = 0;
1129 1129
1130 if (options & Opt_pointerBlank) 1130 if (OPTION (Opt_pointerBlank))
1131 pointer_ev.start (NOW + pointerBlankDelay); 1131 pointer_ev.start (NOW + pointerBlankDelay);
1132#endif 1132#endif
1133} 1133}
1134 1134
1135#ifdef POINTER_BLANK 1135#ifdef POINTER_BLANK
1136void 1136void
1137rxvt_term::pointer_blank () 1137rxvt_term::pointer_blank ()
1138{ 1138{
1139 if (! (options & Opt_pointerBlank)) 1139 if (! OPTION (Opt_pointerBlank))
1140 return; 1140 return;
1141 1141
1142 XDefineCursor (display->display, vt, display->blank_cursor); 1142 XDefineCursor (display->display, vt, display->blank_cursor);
1143 XFlush (display->display); 1143 XFlush (display->display);
1144 1144
1242 1242
1243 SET_R (this); 1243 SET_R (this);
1244 SET_LOCALE (locale); 1244 SET_LOCALE (locale);
1245 1245
1246#if defined(CURSOR_BLINK) 1246#if defined(CURSOR_BLINK)
1247 if ((options & Opt_cursorBlink) && ev.type == KeyPress) 1247 if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
1248 { 1248 {
1249 if (hidden_cursor) 1249 if (hidden_cursor)
1250 { 1250 {
1251 hidden_cursor = 0; 1251 hidden_cursor = 0;
1252 want_refresh = 1; 1252 want_refresh = 1;
1255 cursor_blink_ev.start (NOW + BLINK_INTERVAL); 1255 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1256 } 1256 }
1257#endif 1257#endif
1258 1258
1259#if defined(POINTER_BLANK) 1259#if defined(POINTER_BLANK)
1260 if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) 1260 if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
1261 { 1261 {
1262 if (ev.type == MotionNotify 1262 if (ev.type == MotionNotify
1263 || ev.type == ButtonPress 1263 || ev.type == ButtonPress
1264 || ev.type == ButtonRelease) 1264 || ev.type == ButtonRelease)
1265 if (hidden_pointer) 1265 if (hidden_pointer)
1461 seen_resize = 1; 1461 seen_resize = 1;
1462 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1462 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1463 } 1463 }
1464 1464
1465#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ 1465#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */
1466 if (options & Opt_transparent) 1466 if (OPTION (Opt_transparent))
1467 check_our_parents (); 1467 check_our_parents ();
1468#endif 1468#endif
1469 } 1469 }
1470 break; 1470 break;
1471 1471
1680 IMSetStatusPosition (); 1680 IMSetStatusPosition ();
1681 XSetICFocus (Input_Context); 1681 XSetICFocus (Input_Context);
1682 } 1682 }
1683#endif 1683#endif
1684#if CURSOR_BLINK 1684#if CURSOR_BLINK
1685 if (options & Opt_cursorBlink) 1685 if (OPTION (Opt_cursorBlink))
1686 cursor_blink_ev.start (NOW + BLINK_INTERVAL); 1686 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1687#endif 1687#endif
1688#if OFF_FOCUS_FADING 1688#if OFF_FOCUS_FADING
1689 if (rs[Rs_fade]) 1689 if (rs[Rs_fade])
1690 { 1690 {
1712#if USE_XIM 1712#if USE_XIM
1713 if (Input_Context != NULL) 1713 if (Input_Context != NULL)
1714 XUnsetICFocus (Input_Context); 1714 XUnsetICFocus (Input_Context);
1715#endif 1715#endif
1716#if CURSOR_BLINK 1716#if CURSOR_BLINK
1717 if (options & Opt_cursorBlink) 1717 if (OPTION (Opt_cursorBlink))
1718 cursor_blink_ev.stop (); 1718 cursor_blink_ev.stop ();
1719 hidden_cursor = 0; 1719 hidden_cursor = 0;
1720#endif 1720#endif
1721#if OFF_FOCUS_FADING 1721#if OFF_FOCUS_FADING
1722 if (rs[Rs_fade]) 1722 if (rs[Rs_fade])
1746 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) 1746 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID])
1747 return; 1747 return;
1748 1748
1749 /* FALLTHROUGH */ 1749 /* FALLTHROUGH */
1750 case ReparentNotify: 1750 case ReparentNotify:
1751 if ((options & Opt_transparent) && check_our_parents () && am_transparent) 1751 if (OPTION (Opt_transparent) && check_our_parents () && am_transparent)
1752 want_refresh = want_full_refresh = 1; 1752 want_refresh = want_full_refresh = 1;
1753 break; 1753 break;
1754 } 1754 }
1755} 1755}
1756#endif 1756#endif
2098 2098
2099 v = ev.button == Button4 ? UP : DN; 2099 v = ev.button == Button4 ? UP : DN;
2100 2100
2101 if (ev.state & ShiftMask) 2101 if (ev.state & ShiftMask)
2102 i = 1; 2102 i = 1;
2103 else if (options & Opt_mouseWheelScrollPage) 2103 else if (OPTION (Opt_mouseWheelScrollPage))
2104 i = nrow - 1; 2104 i = nrow - 1;
2105 else 2105 else
2106 i = 5; 2106 i = 5;
2107 2107
2108# ifdef MOUSE_SLIP_WHEELING 2108# ifdef MOUSE_SLIP_WHEELING
2394 XWindowAttributes wattr, wrootattr; 2394 XWindowAttributes wattr, wrootattr;
2395 dDisp; 2395 dDisp;
2396 2396
2397 pchanged = 0; 2397 pchanged = 0;
2398 2398
2399 if (!(options & Opt_transparent)) 2399 if (!OPTION (Opt_transparent))
2400 return pchanged; /* Don't try any more */ 2400 return pchanged; /* Don't try any more */
2401 2401
2402 XGetWindowAttributes (disp, display->root, &wrootattr); 2402 XGetWindowAttributes (disp, display->root, &wrootattr);
2403 rootdepth = wrootattr.depth; 2403 rootdepth = wrootattr.depth;
2404 2404
2682 if (ch == C0_LF) 2682 if (ch == C0_LF)
2683 nlines++; 2683 nlines++;
2684 2684
2685 refresh_count++; 2685 refresh_count++;
2686 2686
2687 if (!(options & Opt_jumpScroll) 2687 if (!OPTION (Opt_jumpScroll)
2688 || (refresh_count >= refresh_limit * (nrow - 1))) 2688 || (refresh_count >= refresh_limit * (nrow - 1)))
2689 { 2689 {
2690 refreshnow = true; 2690 refreshnow = true;
2691 ch = NOCHAR; 2691 ch = NOCHAR;
2692 break; 2692 break;
2726 * the number of pages between refreshes is refresh_limit, which 2726 * the number of pages between refreshes is refresh_limit, which
2727 * is incremented here because we must be doing flat-out scrolling. 2727 * is incremented here because we must be doing flat-out scrolling.
2728 */ 2728 */
2729 if (refreshnow) 2729 if (refreshnow)
2730 { 2730 {
2731 if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) 2731 if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2732 refresh_limit++; 2732 refresh_limit++;
2733 else 2733 else
2734 { 2734 {
2735 flag = true; 2735 flag = true;
2736 scr_refresh (refresh_type); 2736 scr_refresh (refresh_type);
3400 break; 3400 break;
3401 case 6: /* CPR requested */ 3401 case 6: /* CPR requested */
3402 scr_report_position (); 3402 scr_report_position ();
3403 break; 3403 break;
3404 case 7: /* unofficial extension */ 3404 case 7: /* unofficial extension */
3405 if (options & Opt_insecure) 3405 if (OPTION (Opt_insecure))
3406 tt_printf ("%-.250s\012", rs[Rs_display_name]); 3406 tt_printf ("%-.250s\012", rs[Rs_display_name]);
3407 break; 3407 break;
3408 case 8: /* unofficial extension */ 3408 case 8: /* unofficial extension */
3409 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); 3409 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST);
3410 break; 3410 break;
3574 break; 3574 break;
3575 case 20: /* report icon label */ 3575 case 20: /* report icon label */
3576 { 3576 {
3577 char *s; 3577 char *s;
3578 XGetIconName (disp, parent[0], &s); 3578 XGetIconName (disp, parent[0], &s);
3579 tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ 3579 tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
3580 XFree (s); 3580 XFree (s);
3581 } 3581 }
3582 break; 3582 break;
3583 case 21: /* report window title */ 3583 case 21: /* report window title */
3584 { 3584 {
3585 char *s; 3585 char *s;
3586 XFetchName (disp, parent[0], &s); 3586 XFetchName (disp, parent[0], &s);
3587 tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ 3587 tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
3588 XFree (s); 3588 XFree (s);
3589 } 3589 }
3590 break; 3590 break;
3591 } 3591 }
3592} 3592}
3868 // TODO, when secure mode? 3868 // TODO, when secure mode?
3869 break; 3869 break;
3870 3870
3871#ifdef MENUBAR 3871#ifdef MENUBAR
3872 case URxvt_Menu: 3872 case URxvt_Menu:
3873 if (options & Opt_insecure) 3873 if (OPTION (Opt_insecure))
3874 menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked 3874 menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked
3875 break; 3875 break;
3876#endif 3876#endif
3877#if 0 3877#if 0
3878 case XTerm_dumpscreen: /* no error notices */ 3878 case XTerm_dumpscreen: /* no error notices */
3894 case URxvt_italicFont: 3894 case URxvt_italicFont:
3895 case URxvt_boldItalicFont: 3895 case URxvt_boldItalicFont:
3896#endif 3896#endif
3897 if (query) 3897 if (query)
3898 tt_printf ("\33]%d;%-.250s%c", saveop, 3898 tt_printf ("\33]%d;%-.250s%c", saveop,
3899 (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc 3899 OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
3900 ? fontset[op - URxvt_font]->fontdesc : "", 3900 ? fontset[op - URxvt_font]->fontdesc : "",
3901 resp); 3901 resp);
3902 else 3902 else
3903 { 3903 {
3904 const char *&res = rs[Rs_font + (op - URxvt_font)]; 3904 const char *&res = rs[Rs_font + (op - URxvt_font)];
3910 break; 3910 break;
3911 3911
3912#if ENABLE_FRILLS 3912#if ENABLE_FRILLS
3913 case URxvt_locale: 3913 case URxvt_locale:
3914 if (query) 3914 if (query)
3915 tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); 3915 tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp);
3916 else 3916 else
3917 { 3917 {
3918 set_locale (str); 3918 set_locale (str);
3919 pty.set_utf8_mode (enc_utf8); 3919 pty.set_utf8_mode (enc_utf8);
3920 init_xlocale (); 3920 init_xlocale ();
4050 /* extra handling for values with state unkept */ 4050 /* extra handling for values with state unkept */
4051 switch (arg[i]) 4051 switch (arg[i])
4052 { 4052 {
4053 case 1048: /* alternative cursor save */ 4053 case 1048: /* alternative cursor save */
4054 case 1049: 4054 case 1049:
4055 if (options & Opt_secondaryScreen) 4055 if (OPTION (Opt_secondaryScreen))
4056 if (mode == 0) 4056 if (mode == 0)
4057 scr_cursor (RESTORE); 4057 scr_cursor (RESTORE);
4058 else if (mode == 1) 4058 else if (mode == 1)
4059 scr_cursor (SAVE); 4059 scr_cursor (SAVE);
4060 break; 4060 break;
4075 case 3: /* 80/132 */ 4075 case 3: /* 80/132 */
4076 if (priv_modes & PrivMode_132OK) 4076 if (priv_modes & PrivMode_132OK)
4077 set_widthheight (((state ? 132 : 80) * fwidth), height); 4077 set_widthheight (((state ? 132 : 80) * fwidth), height);
4078 break; 4078 break;
4079 case 4: /* smooth scrolling */ 4079 case 4: /* smooth scrolling */
4080 if (state) 4080 if (!state)
4081 options &= ~Opt_jumpScroll; 4081 SET_OPTION (Opt_jumpScroll);
4082 else 4082 else
4083 options |= Opt_jumpScroll; 4083 CLR_OPTION (Opt_jumpScroll);
4084 break; 4084 break;
4085 case 5: /* reverse video */ 4085 case 5: /* reverse video */
4086 scr_rvideo_mode (state); 4086 scr_rvideo_mode (state);
4087 break; 4087 break;
4088 case 6: /* relative/absolute origins */ 4088 case 6: /* relative/absolute origins */
4129#if 0 4129#if 0
4130 case 1001: 4130 case 1001:
4131 break; /* X11 mouse highlighting */ 4131 break; /* X11 mouse highlighting */
4132#endif 4132#endif
4133 case 1010: /* scroll to bottom on TTY output inhibit */ 4133 case 1010: /* scroll to bottom on TTY output inhibit */
4134 if (state) 4134 if (!state)
4135 options &= ~Opt_scrollTtyOutput; 4135 SET_OPTION (Opt_scrollTtyOutput);
4136 else 4136 else
4137 options |= Opt_scrollTtyOutput; 4137 CLR_OPTION (Opt_scrollTtyOutput);
4138 break; 4138 break;
4139 case 1011: /* scroll to bottom on key press */ 4139 case 1011: /* scroll to bottom on key press */
4140 if (state) 4140 if (state)
4141 options |= Opt_scrollTtyKeypress; 4141 SET_OPTION (Opt_scrollTtyKeypress);
4142 else 4142 else
4143 options &= ~Opt_scrollTtyKeypress; 4143 CLR_OPTION (Opt_scrollTtyKeypress);
4144 break; 4144 break;
4145#if ENABLE_STYLES
4146 case 1021:
4147 if (state)
4148 SET_OPTION (Opt_intensityStyles);
4149 else
4150 CLR_OPTION (Opt_intensityStyles);
4151#endif
4145 case 1047: /* secondary screen w/ clearing last */ 4152 case 1047: /* secondary screen w/ clearing last */
4146 if (options & Opt_secondaryScreen) 4153 if (OPTION (Opt_secondaryScreen))
4147 if (current_screen != PRIMARY) 4154 if (current_screen != PRIMARY)
4148 scr_erase_screen (2); 4155 scr_erase_screen (2);
4149 scr_change_screen (state); 4156 scr_change_screen (state);
4150 break; 4157 break;
4151 case 1049: /* secondary screen w/ clearing first */ 4158 case 1049: /* secondary screen w/ clearing first */
4152 scr_change_screen (state); 4159 scr_change_screen (state);
4153 if (options & Opt_secondaryScreen) 4160 if (OPTION (Opt_secondaryScreen))
4154 if (current_screen != PRIMARY) 4161 if (current_screen != PRIMARY)
4155 scr_erase_screen (2); 4162 scr_erase_screen (2);
4156 break; 4163 break;
4157 default: 4164 default:
4158 break; 4165 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines