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.329 by ayin, Mon Jun 11 19:57:28 2007 UTC vs.
Revision 1.339 by ayin, Fri Aug 3 14:03:28 2007 UTC

519# endif 519# endif
520 return; 520 return;
521 } 521 }
522 else 522 else
523 { 523 {
524# if ENABLE_OVERLAY 524# if ISO_14755
525 scr_overlay_off (); 525 scr_overlay_off ();
526# endif 526# endif
527 iso14755buf = 0; 527 iso14755buf = 0;
528 } 528 }
529 } 529 }
530 else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R)) 530 else if ((ctrl && (keysym == XK_Shift_L || keysym == XK_Shift_R))
531 || (shft && (keysym == XK_Control_L || keysym == XK_Control_R))) 531 || (shft && (keysym == XK_Control_L || keysym == XK_Control_R)))
532 if (!(iso14755buf & ISO_14755_STARTED)) 532 if (!(iso14755buf & ISO_14755_STARTED))
533 { 533 {
534 iso14755buf |= ISO_14755_STARTED; 534 iso14755buf |= ISO_14755_STARTED;
535# if ENABLE_OVERLAY 535# if ISO_14755
536 scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1); 536 scr_overlay_new (0, -1, sizeof ("ISO 14755 mode") - 1, 1);
537 scr_overlay_set (0, 0, "ISO 14755 mode"); 537 scr_overlay_set (0, 0, "ISO 14755 mode");
538# endif 538# endif
539 } 539 }
540#endif 540#endif
728 728
729 case XK_Find: 729 case XK_Find:
730 strcpy (kbuf, "\033[1~"); 730 strcpy (kbuf, "\033[1~");
731 break; 731 break;
732 732
733#ifdef XK_KP_End 733#ifdef XK_KP_Insert
734 case XK_KP_Insert: 734 case XK_KP_Insert:
735 /* allow shift to override */ 735 /* allow shift to override */
736 if ((priv_modes & PrivMode_aplKP) ? !shft : shft) 736 if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
737 { 737 {
738 strcpy (kbuf, "\033Op"); 738 strcpy (kbuf, "\033Op");
934#if ENABLE_FRILLS || ISO_14755 934#if ENABLE_FRILLS || ISO_14755
935 // ISO 14755 support 935 // ISO 14755 support
936 if (iso14755buf) 936 if (iso14755buf)
937 if (iso14755buf & ISO_14755_52) 937 if (iso14755buf & ISO_14755_52)
938 { 938 {
939# if ENABLE_OVERLAY 939# if ISO_14755
940 scr_overlay_off (); 940 scr_overlay_off ();
941# endif 941# endif
942# if ISO_14755 942# if ISO_14755
943 // iso14755 part 5.2 handling: release time 943 // iso14755 part 5.2 handling: release time
944 // first: controls 944 // first: controls
967 967
968 return; 968 return;
969 } 969 }
970 else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask)) 970 else if ((ev.state & (ShiftMask | ControlMask)) != (ShiftMask | ControlMask))
971 { 971 {
972# if ENABLE_OVERLAY 972# if ISO_14755
973 scr_overlay_off (); 973 scr_overlay_off ();
974# endif 974# endif
975 if (iso14755buf & ISO_14755_51) 975 if (iso14755buf & ISO_14755_51)
976 commit_iso14755 (); 976 commit_iso14755 ();
977#if ISO_14755 977#if ISO_14755
1035void 1035void
1036rxvt_term::flush () 1036rxvt_term::flush ()
1037{ 1037{
1038 flush_ev.stop (); 1038 flush_ev.stop ();
1039 1039
1040#ifdef TRANSPARENT 1040#ifdef ENABLE_TRANSPARENCY
1041 if (want_full_refresh) 1041 if (want_full_refresh)
1042 { 1042 {
1043 want_full_refresh = 0; 1043 want_full_refresh = 0;
1044 scr_clear (); 1044 scr_clear ();
1045 scr_touch (false); 1045 scr_touch (false);
1110void 1110void
1111rxvt_term::flush_cb (time_watcher &w) 1111rxvt_term::flush_cb (time_watcher &w)
1112{ 1112{
1113 make_current (); 1113 make_current ();
1114 1114
1115 refresh_limit = 1;
1116 refresh_count = 0; 1115 refresh_count = 0;
1117 flush (); 1116 flush ();
1118} 1117}
1119 1118
1120#ifdef CURSOR_BLINK 1119#ifdef CURSOR_BLINK
1434 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) 1433 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT)
1435 focus_out (); 1434 focus_out ();
1436 } 1435 }
1437#endif 1436#endif
1438 } 1437 }
1439 break;
1440
1441 case MappingNotify:
1442 XRefreshKeyboardMapping (&ev.xmapping);
1443 break; 1438 break;
1444 1439
1445 /* 1440 /*
1446 * XXX: this is not the _current_ arrangement 1441 * XXX: this is not the _current_ arrangement
1447 * Here's my conclusion: 1442 * Here's my conclusion:
1500#endif 1495#endif
1501 } 1496 }
1502 1497
1503 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1498 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1504 1499
1505#ifdef TRANSPARENT 1500#ifdef ENABLE_TRANSPARENCY
1506 if (option (Opt_transparent)) 1501 if (option (Opt_transparent))
1507 check_our_parents (); 1502 check_our_parents ();
1508#endif 1503#endif
1509 } 1504 }
1510 break; 1505 break;
1544 text_blink_ev.stop (); 1539 text_blink_ev.stop ();
1545#endif 1540#endif
1546 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1541 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1547 break; 1542 break;
1548 1543
1549#ifdef TRANSPARENT 1544#ifdef ENABLE_TRANSPARENCY
1550 case ReparentNotify: 1545 case ReparentNotify:
1551 rootwin_cb (ev); 1546 rootwin_cb (ev);
1552 break; 1547 break;
1553#endif /* TRANSPARENT */ 1548#endif /* ENABLE_TRANSPARENCY */
1554 1549
1555 case GraphicsExpose: 1550 case GraphicsExpose:
1556 case Expose: 1551 case Expose:
1557 if (ev.xany.window == vt) 1552 if (ev.xany.window == vt)
1558 { 1553 {
1582 { 1577 {
1583 scrollBar.setIdle (); 1578 scrollBar.setIdle ();
1584 scrollbar_show (0); 1579 scrollbar_show (0);
1585 } 1580 }
1586 1581
1587#ifdef TRANSPARENT 1582#ifdef ENABLE_TRANSPARENCY
1588 if (am_transparent && ev.xany.window == parent[0]) 1583 if (am_transparent && ev.xany.window == parent[0])
1589 XClearWindow (dpy, ev.xany.window); 1584 XClearWindow (dpy, ev.xany.window);
1590#endif 1585#endif
1591 } 1586 }
1592 break; 1587 break;
1693 &ev.xbutton.x, &ev.xbutton.y, 1688 &ev.xbutton.x, &ev.xbutton.y,
1694 &unused_mask); 1689 &unused_mask);
1695 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, 1690 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO,
1696 scrollbar_size ()); 1691 scrollbar_size ());
1697 want_refresh = 1; 1692 want_refresh = 1;
1698 refresh_limit = 0;
1699 scrollbar_show (1); 1693 scrollbar_show (1);
1700 } 1694 }
1701 break; 1695 break;
1702 } 1696 }
1703 1697
1785 1779
1786#if ENABLE_FRILLS || ISO_14755 1780#if ENABLE_FRILLS || ISO_14755
1787 if (iso14755buf) 1781 if (iso14755buf)
1788 { 1782 {
1789 iso14755buf = 0; 1783 iso14755buf = 0;
1790# if ENABLE_OVERLAY 1784# if ISO_14755
1791 scr_overlay_off (); 1785 scr_overlay_off ();
1792# endif 1786# endif
1793 } 1787 }
1794#endif 1788#endif
1795#if USE_XIM 1789#if USE_XIM
1822 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1816 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1823 } 1817 }
1824#endif 1818#endif
1825} 1819}
1826 1820
1827#if TRANSPARENT || ENABLE_PERL 1821#if ENABLE_TRANSPARENCY || ENABLE_PERL
1828void 1822void
1829rxvt_term::rootwin_cb (XEvent &ev) 1823rxvt_term::rootwin_cb (XEvent &ev)
1830{ 1824{
1831 make_current (); 1825 make_current ();
1832 1826
1833 if (SHOULD_INVOKE (HOOK_ROOT_EVENT) 1827 if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
1834 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) 1828 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
1835 return; 1829 return;
1836 1830
1837# if TRANSPARENT 1831# if ENABLE_TRANSPARENCY
1838 switch (ev.type) 1832 switch (ev.type)
1839 { 1833 {
1840 case PropertyNotify: 1834 case PropertyNotify:
1841 /* 1835 /*
1842 * if user used some Esetroot compatible prog to set the root bg, 1836 * if user used some Esetroot compatible prog to set the root bg,
2291 if (ch == C0_LF) 2285 if (ch == C0_LF)
2292 nlines++; 2286 nlines++;
2293 2287
2294 refresh_count++; 2288 refresh_count++;
2295 2289
2296 if (!option (Opt_jumpScroll) 2290 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2297 || (refresh_count >= refresh_limit * (nrow - 1)))
2298 { 2291 {
2299 refreshnow = true;
2300 refresh_count = 0; 2292 refresh_count = 0;
2293
2294 if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.)
2295 {
2296 refreshnow = true;
2301 ch = NOCHAR; 2297 ch = NOCHAR;
2302 break; 2298 break;
2299 }
2303 } 2300 }
2304 2301
2305 // scr_add_lines only works for nlines <= nrow - 1. 2302 // scr_add_lines only works for nlines <= nrow - 1.
2306 if (nlines >= nrow - 1) 2303 if (nlines >= nrow - 1)
2307 { 2304 {
2335 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) 2332 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END))))
2336 scr_add_lines (buf, str - buf, nlines); 2333 scr_add_lines (buf, str - buf, nlines);
2337 2334
2338 /* 2335 /*
2339 * If there have been a lot of new lines, then update the screen 2336 * If there have been a lot of new lines, then update the screen
2340 * What the heck I'll cheat and only refresh less than every page-full. 2337 * What the heck we'll cheat and only refresh less than every page-full.
2341 * the number of pages between refreshes is refresh_limit, which 2338 * if skipScroll is enabled.
2342 * is incremented here because we must be doing flat-out scrolling.
2343 */ 2339 */
2344 if (refreshnow) 2340 if (refreshnow)
2345 { 2341 {
2346 if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2347 refresh_limit++;
2348 else
2349 {
2350 flag = true; 2342 flag = true;
2351 //TODO: due to popular request, implement "skipscroll" option here
2352 scr_refresh (); 2343 scr_refresh ();
2353 want_refresh = 1; 2344 want_refresh = 1;
2354 }
2355 } 2345 }
2356 2346
2357 } 2347 }
2358 else 2348 else
2359 { 2349 {
2580 process_dcs_seq (); 2570 process_dcs_seq ();
2581 break; 2571 break;
2582 case 0x9b: /* CSI */ 2572 case 0x9b: /* CSI */
2583 process_csi_seq (); 2573 process_csi_seq ();
2584 break; 2574 break;
2585 case 0x9d: /* CSI */ 2575 case 0x9d: /* OSC */
2586 process_osc_seq (); 2576 process_osc_seq ();
2587 break; 2577 break;
2588#endif 2578#endif
2589 } 2579 }
2590} 2580}
2818 unicode_t ch, priv, i; 2808 unicode_t ch, priv, i;
2819 unsigned int nargs, p; 2809 unsigned int nargs, p;
2820 int n, ndef; 2810 int n, ndef;
2821 int arg[ESC_ARGS]; 2811 int arg[ESC_ARGS];
2822 2812
2823 for (nargs = ESC_ARGS; nargs > 0;) 2813 memset (arg, 0, sizeof (arg));
2824 arg[--nargs] = 0; 2814 nargs = 0;
2825 2815
2826 priv = 0; 2816 priv = 0;
2827 ch = cmd_getc (); 2817 ch = cmd_getc ();
2828 if (ch >= '<' && ch <= '?') 2818 if (ch >= '<' && ch <= '?')
2829 { /* '<' '=' '>' '?' */ 2819 { /* '<' '=' '>' '?' */
2873 switch (priv) 2863 switch (priv)
2874 { 2864 {
2875 case '>': 2865 case '>':
2876 if (ch == CSI_DA) /* secondary device attributes */ 2866 if (ch == CSI_DA) /* secondary device attributes */
2877 { 2867 {
2878 // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, 2868 // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt,
2879 // 'U' for rxvt-unicode != 7.[34] (where it was broken). 2869 // 'U' for rxvt-unicode != 7.[34] (where it was broken).
2880 // 2870 //
2881 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt 2871 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt
2882 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify 2872 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify
2883 // that we do not support xterm mouse reporting (should be 95 when we do). 2873 // that we do not support xterm mouse reporting (should be 95 when we do).
3441 break; 3431 break;
3442 case URxvt_Color_IT: 3432 case URxvt_Color_IT:
3443 process_color_seq (op, Color_IT, str, resp); 3433 process_color_seq (op, Color_IT, str, resp);
3444 break; 3434 break;
3445#endif 3435#endif
3446#if TRANSPARENT && TINTING 3436#if ENABLE_TRANSPARENCY && TINTING
3447 case URxvt_Color_tint: 3437 case URxvt_Color_tint:
3448 process_color_seq (op, Color_tint, str, resp); 3438 process_color_seq (op, Color_tint, str, resp);
3449 3439
3450 check_our_parents (); 3440 check_our_parents ();
3451 3441
3453 want_full_refresh = want_refresh = 1; 3443 want_full_refresh = want_refresh = 1;
3454 3444
3455 break; 3445 break;
3456#endif 3446#endif
3457 3447
3448#if XPM_BACKGROUND
3458 case Rxvt_Pixmap: 3449 case Rxvt_Pixmap:
3459 { 3450 {
3460 if (*str != ';') 3451 if (*str != ';')
3461 { 3452 {
3462#if XPM_BACKGROUND
3463 scale_pixmap (""); /* reset to default scaling */ 3453 scale_pixmap (""); /* reset to default scaling */
3464 set_bgPixmap (str); /* change pixmap */ 3454 set_bgPixmap (str); /* change pixmap */
3465 scr_touch (true); 3455 scr_touch (true);
3466#endif
3467 } 3456 }
3468 3457
3469 int changed = 0; 3458 int changed = 0;
3470 3459
3471 while ((str = strchr (str, ';')) != NULL) 3460 while ((str = strchr (str, ';')) != NULL)
3472 { 3461 {
3473 str++; 3462 str++;
3474#if XPM_BACKGROUND
3475 changed += scale_pixmap (str); 3463 changed += scale_pixmap (str);
3476#endif
3477 } 3464 }
3478 3465
3479 if (changed) 3466 if (changed)
3480 { 3467 {
3481#ifdef XPM_BACKGROUND
3482 resize_pixmap (); 3468 resize_pixmap ();
3483 scr_touch (true); 3469 scr_touch (true);
3484#endif
3485 } 3470 }
3486#if TRANSPARENT && defined(HAVE_AFTERIMAGE) 3471#if ENABLE_TRANSPARENCY && defined(HAVE_AFTERIMAGE)
3487 if (option (Opt_transparent)) 3472 if (option (Opt_transparent))
3488 check_our_parents (); 3473 check_our_parents ();
3489#endif 3474#endif
3490 } 3475 }
3491 break; 3476 break;
3477#endif
3492 3478
3493 case Rxvt_restoreFG: 3479 case Rxvt_restoreFG:
3494 set_window_color (Color_fg, str); 3480 set_window_color (Color_fg, str);
3495 break; 3481 break;
3496 case Rxvt_restoreBG: 3482 case Rxvt_restoreBG:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines