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.538 by sf-exg, Thu Apr 11 08:13:43 2013 UTC vs.
Revision 1.542 by root, Thu Apr 24 22:32:59 2014 UTC

25 * - extensive modifications 25 * - extensive modifications
26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
27 * Copyright (c) 2001 Marius Gedminas 27 * Copyright (c) 2001 Marius Gedminas
28 * - Ctrl/Mod4+Tab works like Meta+Tab (options) 28 * - Ctrl/Mod4+Tab works like Meta+Tab (options)
29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> 29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org>
30 * Copyright (c) 2003-2011 Marc Lehmann <schmorp@schmorp.de> 30 * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de>
31 * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> 31 * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it>
32 * 32 *
33 * This program is free software; you can redistribute it and/or modify 33 * This program is free software; you can redistribute it and/or modify
34 * it under the terms of the GNU General Public License as published by 34 * it under the terms of the GNU General Public License as published by
35 * the Free Software Foundation; either version 2 of the License, or 35 * the Free Software Foundation; either version 2 of the License, or
1077 1077
1078#ifdef SELECTION_SCROLLING 1078#ifdef SELECTION_SCROLLING
1079void 1079void
1080rxvt_term::sel_scroll_cb (ev::timer &w, int revents) 1080rxvt_term::sel_scroll_cb (ev::timer &w, int revents)
1081{ 1081{
1082 if (scr_page (scroll_selection_dir, scroll_selection_lines)) 1082 if (scr_page (scroll_selection_lines))
1083 { 1083 {
1084 selection_extend (selection_save_x, selection_save_y, selection_save_state); 1084 selection_extend (selection_save_x, selection_save_y, selection_save_state);
1085 want_refresh = 1; 1085 want_refresh = 1;
1086 refresh_check (); 1086 refresh_check ();
1087 } 1087 }
1092 1092
1093#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1093#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1094void 1094void
1095rxvt_term::slip_wheel_cb (ev::timer &w, int revents) 1095rxvt_term::slip_wheel_cb (ev::timer &w, int revents)
1096{ 1096{
1097 if (scr_changeview (view_start - mouse_slip_wheel_speed)) 1097 if (scr_page (mouse_slip_wheel_speed))
1098 { 1098 {
1099 want_refresh = 1; 1099 want_refresh = 1;
1100 refresh_check (); 1100 refresh_check ();
1101 } 1101 }
1102 1102
1638 1638
1639#ifdef SELECTION_SCROLLING 1639#ifdef SELECTION_SCROLLING
1640 if (ev.xbutton.y < int_bwidth 1640 if (ev.xbutton.y < int_bwidth
1641 || Pixel2Row (ev.xbutton.y) > (nrow-1)) 1641 || Pixel2Row (ev.xbutton.y) > (nrow-1))
1642 { 1642 {
1643 page_dirn scroll_selection_dir;
1643 int dist; 1644 int dist;
1644 1645
1645 /* don't clobber the current delay if we are 1646 /* don't clobber the current delay if we are
1646 * already in the middle of scrolling. 1647 * already in the middle of scrolling.
1647 */ 1648 */
1670 scroll_selection_lines = Pixel2Height (dist) 1671 scroll_selection_lines = Pixel2Height (dist)
1671 / SELECTION_SCROLL_LINE_SPEEDUP 1672 / SELECTION_SCROLL_LINE_SPEEDUP
1672 + 1; 1673 + 1;
1673 min_it (scroll_selection_lines, 1674 min_it (scroll_selection_lines,
1674 SELECTION_SCROLL_MAX_LINES); 1675 SELECTION_SCROLL_MAX_LINES);
1676 scroll_selection_lines *= scroll_selection_dir;
1675 } 1677 }
1676 else 1678 else
1677 { 1679 {
1678 /* we are within the text window, so we 1680 /* we are within the text window, so we
1679 * shouldn't be scrolling 1681 * shouldn't be scrolling
2211 2213
2212# ifdef MOUSE_SLIP_WHEELING 2214# ifdef MOUSE_SLIP_WHEELING
2213 if (ev.state & ControlMask) 2215 if (ev.state & ControlMask)
2214 { 2216 {
2215 mouse_slip_wheel_speed += dirn; 2217 mouse_slip_wheel_speed += dirn;
2216 if (mouse_slip_wheel_speed < -nrow) mouse_slip_wheel_speed = -nrow; 2218 clamp_it (mouse_slip_wheel_speed, -nrow, nrow);
2217 if (mouse_slip_wheel_speed > +nrow) mouse_slip_wheel_speed = +nrow;
2218 2219
2219 if (!slip_wheel_ev.is_active ()) 2220 if (!slip_wheel_ev.is_active ())
2220 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2221 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2221 } 2222 }
2222 else 2223 else
3226rxvt_term::get_to_st (unicode_t &ends_how) 3227rxvt_term::get_to_st (unicode_t &ends_how)
3227{ 3228{
3228 unicode_t ch; 3229 unicode_t ch;
3229 bool seen_esc = false; 3230 bool seen_esc = false;
3230 unsigned int n = 0; 3231 unsigned int n = 0;
3231 wchar_t string[STRING_MAX]; 3232 wchar_t string[CBUFSIZ];
3232 3233
3233 while ((ch = cmd_getc ()) != NOCHAR) 3234 while ((ch = cmd_getc ()) != NOCHAR)
3234 { 3235 {
3235 if (seen_esc) 3236 if (seen_esc)
3236 { 3237 {
3251 else if (ch < 0x20) 3252 else if (ch < 0x20)
3252 return NULL; /* other control character - exit */ 3253 return NULL; /* other control character - exit */
3253 3254
3254 seen_esc = false; 3255 seen_esc = false;
3255 3256
3256 if (n >= STRING_MAX - 1) 3257 if (n >= sizeof (string) - 1)
3257 // stop at some sane length 3258 // stop at some sane length
3258 return NULL; 3259 return NULL;
3259 3260
3260 string[n++] = ch; 3261 string[n++] = ch;
3261 } 3262 }
3378 &nitems, &bytes_after, &value) == Success 3379 &nitems, &bytes_after, &value) == Success
3379 && actual_type != None 3380 && actual_type != None
3380 && actual_format == 8) 3381 && actual_format == 8)
3381 str = (const char *)(value); 3382 str = (const char *)(value);
3382 3383
3383 tt_printf ("\033]%d;%s%c", op, str, resp); 3384 tt_printf ("\033]%d;%s%c", op, option (Opt_insecure) ? str : "", resp);
3384 3385
3385 XFree (value); 3386 XFree (value);
3386 } 3387 }
3387 else 3388 else
3388 { 3389 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines