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.330 by root, Mon Jun 18 12:53:25 2007 UTC vs.
Revision 1.345 by sasha, Mon Aug 13 22:41:34 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);
1433 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) 1433 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT)
1434 focus_out (); 1434 focus_out ();
1435 } 1435 }
1436#endif 1436#endif
1437 } 1437 }
1438 break;
1439
1440 case MappingNotify:
1441 XRefreshKeyboardMapping (&ev.xmapping);
1442 break; 1438 break;
1443 1439
1444 /* 1440 /*
1445 * XXX: this is not the _current_ arrangement 1441 * XXX: this is not the _current_ arrangement
1446 * Here's my conclusion: 1442 * Here's my conclusion:
1489 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) 1485 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height)
1490 { 1486 {
1491 seen_resize = 1; 1487 seen_resize = 1;
1492 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1488 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1493#ifdef XPM_BACKGROUND 1489#ifdef XPM_BACKGROUND
1490 /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */
1494 if (!option (Opt_transparent) && bgPixmap.auto_resize) 1491 if (!option (Opt_transparent) && bgPixmap.window_size_sensitive ())
1495 { 1492 {
1496 resize_pixmap (); 1493 bgPixmap.render ();
1497 scr_touch (true); 1494 scr_touch (true);
1498 } 1495 }
1499#endif 1496#endif
1500 } 1497 }
1501 1498
1502 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1499 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1503 1500
1504#ifdef TRANSPARENT 1501#ifdef ENABLE_TRANSPARENCY
1505 if (option (Opt_transparent)) 1502 if (option (Opt_transparent))
1506 check_our_parents (); 1503 bgPixmap.render ();
1507#endif 1504#endif
1508 } 1505 }
1509 break; 1506 break;
1510 1507
1511 case PropertyNotify: 1508 case PropertyNotify:
1543 text_blink_ev.stop (); 1540 text_blink_ev.stop ();
1544#endif 1541#endif
1545 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1542 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1546 break; 1543 break;
1547 1544
1548#ifdef TRANSPARENT 1545#ifdef ENABLE_TRANSPARENCY
1549 case ReparentNotify: 1546 case ReparentNotify:
1550 rootwin_cb (ev); 1547 rootwin_cb (ev);
1551 break; 1548 break;
1552#endif /* TRANSPARENT */ 1549#endif /* ENABLE_TRANSPARENCY */
1553 1550
1554 case GraphicsExpose: 1551 case GraphicsExpose:
1555 case Expose: 1552 case Expose:
1556 if (ev.xany.window == vt) 1553 if (ev.xany.window == vt)
1557 { 1554 {
1580 if (isScrollbarWindow (ev.xany.window)) 1577 if (isScrollbarWindow (ev.xany.window))
1581 { 1578 {
1582 scrollBar.setIdle (); 1579 scrollBar.setIdle ();
1583 scrollbar_show (0); 1580 scrollbar_show (0);
1584 } 1581 }
1585
1586#ifdef TRANSPARENT
1587 if (am_transparent && ev.xany.window == parent[0])
1588 XClearWindow (dpy, ev.xany.window);
1589#endif
1590 } 1582 }
1591 break; 1583 break;
1592 1584
1593 case MotionNotify: 1585 case MotionNotify:
1594#ifdef POINTER_BLANK 1586#ifdef POINTER_BLANK
1783 1775
1784#if ENABLE_FRILLS || ISO_14755 1776#if ENABLE_FRILLS || ISO_14755
1785 if (iso14755buf) 1777 if (iso14755buf)
1786 { 1778 {
1787 iso14755buf = 0; 1779 iso14755buf = 0;
1788# if ENABLE_OVERLAY 1780# if ISO_14755
1789 scr_overlay_off (); 1781 scr_overlay_off ();
1790# endif 1782# endif
1791 } 1783 }
1792#endif 1784#endif
1793#if USE_XIM 1785#if USE_XIM
1820 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1812 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1821 } 1813 }
1822#endif 1814#endif
1823} 1815}
1824 1816
1825#if TRANSPARENT || ENABLE_PERL 1817#if ENABLE_TRANSPARENCY || ENABLE_PERL
1826void 1818void
1827rxvt_term::rootwin_cb (XEvent &ev) 1819rxvt_term::rootwin_cb (XEvent &ev)
1828{ 1820{
1829 make_current (); 1821 make_current ();
1830 1822
1831 if (SHOULD_INVOKE (HOOK_ROOT_EVENT) 1823 if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
1832 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) 1824 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
1833 return; 1825 return;
1834 1826
1835# if TRANSPARENT 1827# if ENABLE_TRANSPARENCY
1836 switch (ev.type) 1828 switch (ev.type)
1837 { 1829 {
1838 case PropertyNotify: 1830 case PropertyNotify:
1839 /* 1831 /*
1840 * if user used some Esetroot compatible prog to set the root bg, 1832 * if user used some Esetroot compatible prog to set the root bg,
1841 * use the property to determine the pixmap. We use it later on. 1833 * use the property to determine the pixmap. We use it later on.
1842 */ 1834 */
1843 if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID] 1835 if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID]
1844 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) 1836 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID])
1845 return; 1837 {
1846 1838 bgPixmap.set_root_pixmap ();
1847 /* FALLTHROUGH */ 1839 bgPixmap.render ();
1848 case ReparentNotify: 1840 }
1849 if (option (Opt_transparent))
1850 check_our_parents ();
1851 break; 1841 break;
1852 } 1842 }
1853# endif 1843# endif
1854} 1844}
1855#endif 1845#endif
2293 2283
2294 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1) 2284 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2295 { 2285 {
2296 refresh_count = 0; 2286 refresh_count = 0;
2297 2287
2298 if (!option (Opt_skipScroll) || io_manager::now () > NOW + .1) 2288 if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.)
2299 { 2289 {
2300 refreshnow = true; 2290 refreshnow = true;
2301 ch = NOCHAR; 2291 ch = NOCHAR;
2302 break; 2292 break;
2303 } 2293 }
2574 process_dcs_seq (); 2564 process_dcs_seq ();
2575 break; 2565 break;
2576 case 0x9b: /* CSI */ 2566 case 0x9b: /* CSI */
2577 process_csi_seq (); 2567 process_csi_seq ();
2578 break; 2568 break;
2579 case 0x9d: /* CSI */ 2569 case 0x9d: /* OSC */
2580 process_osc_seq (); 2570 process_osc_seq ();
2581 break; 2571 break;
2582#endif 2572#endif
2583 } 2573 }
2584} 2574}
2812 unicode_t ch, priv, i; 2802 unicode_t ch, priv, i;
2813 unsigned int nargs, p; 2803 unsigned int nargs, p;
2814 int n, ndef; 2804 int n, ndef;
2815 int arg[ESC_ARGS]; 2805 int arg[ESC_ARGS];
2816 2806
2817 for (nargs = ESC_ARGS; nargs > 0;) 2807 memset (arg, 0, sizeof (arg));
2818 arg[--nargs] = 0; 2808 nargs = 0;
2819 2809
2820 priv = 0; 2810 priv = 0;
2821 ch = cmd_getc (); 2811 ch = cmd_getc ();
2822 if (ch >= '<' && ch <= '?') 2812 if (ch >= '<' && ch <= '?')
2823 { /* '<' '=' '>' '?' */ 2813 { /* '<' '=' '>' '?' */
2867 switch (priv) 2857 switch (priv)
2868 { 2858 {
2869 case '>': 2859 case '>':
2870 if (ch == CSI_DA) /* secondary device attributes */ 2860 if (ch == CSI_DA) /* secondary device attributes */
2871 { 2861 {
2872 // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, 2862 // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt,
2873 // 'U' for rxvt-unicode != 7.[34] (where it was broken). 2863 // 'U' for rxvt-unicode != 7.[34] (where it was broken).
2874 // 2864 //
2875 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt 2865 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt
2876 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify 2866 // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify
2877 // that we do not support xterm mouse reporting (should be 95 when we do). 2867 // that we do not support xterm mouse reporting (should be 95 when we do).
3435 break; 3425 break;
3436 case URxvt_Color_IT: 3426 case URxvt_Color_IT:
3437 process_color_seq (op, Color_IT, str, resp); 3427 process_color_seq (op, Color_IT, str, resp);
3438 break; 3428 break;
3439#endif 3429#endif
3440#if TRANSPARENT && TINTING 3430#if ENABLE_TRANSPARENCY
3441 case URxvt_Color_tint: 3431 case URxvt_Color_tint:
3442 process_color_seq (op, Color_tint, str, resp); 3432 process_color_seq (op, Color_tint, str, resp);
3433 {
3434 bool changed = false;
3435 if (ISSET_PIXCOLOR (Color_tint))
3436 changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]);
3437 else
3438 changed = bgPixmap.unset_tint ();
3439 if (changed)
3440 bgPixmap.render ();
3441 }
3443 3442
3444 check_our_parents ();
3445
3446 if (am_transparent)
3447 want_full_refresh = want_refresh = 1;
3448
3449 break; 3443 break;
3450#endif 3444#endif
3451 3445
3446#if XPM_BACKGROUND
3452 case Rxvt_Pixmap: 3447 case Rxvt_Pixmap:
3448 if (!strcmp (str, "?"))
3453 { 3449 {
3450 char str[256];
3451
3452 sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */
3453 min (bgPixmap.h_scale, 32767), min (bgPixmap.v_scale, 32767),
3454 min (bgPixmap.h_align, 32767), min (bgPixmap.v_align, 32767));
3455 process_xterm_seq (XTerm_title, str, CHAR_ST);
3456 }
3457 else
3458 {
3459 int changed = 0;
3460
3454 if (*str != ';') 3461 if (*str != ';')
3455 { 3462 {
3456#if XPM_BACKGROUND
3457 scale_pixmap (""); /* reset to default scaling */ 3463 /* reset to default scaling :*/
3464 bgPixmap.unset_geometry ();
3458 set_bgPixmap (str); /* change pixmap */ 3465 if (bgPixmap.set_file (str)) /* change pixmap */
3466 changed++;
3467 str = strchr (str, ';');
3468 if (str == NULL)
3469 bgPixmap.set_defaultGeometry ();
3470 }
3471 while (str)
3472 {
3473 str++;
3474 if (bgPixmap.set_geometry (str))
3475 changed++;
3476 str = strchr (str, ';');
3477 }
3478 if (changed)
3479 {
3480 bgPixmap.render ();
3459 scr_touch (true); 3481 scr_touch (true);
3460#endif
3461 } 3482 }
3462
3463 int changed = 0;
3464
3465 while ((str = strchr (str, ';')) != NULL)
3466 {
3467 str++;
3468#if XPM_BACKGROUND
3469 changed += scale_pixmap (str);
3470#endif
3471 } 3483 }
3472
3473 if (changed)
3474 {
3475#ifdef XPM_BACKGROUND
3476 resize_pixmap ();
3477 scr_touch (true);
3478#endif
3479 }
3480#if TRANSPARENT && defined(HAVE_AFTERIMAGE)
3481 if (option (Opt_transparent))
3482 check_our_parents ();
3483#endif
3484 }
3485 break; 3484 break;
3485#endif
3486 3486
3487 case Rxvt_restoreFG: 3487 case Rxvt_restoreFG:
3488 set_window_color (Color_fg, str); 3488 set_window_color (Color_fg, str);
3489 break; 3489 break;
3490 case Rxvt_restoreBG: 3490 case Rxvt_restoreBG:
3612{ 3612{
3613 unsigned int i, j; 3613 unsigned int i, j;
3614 int state; 3614 int state;
3615 3615
3616 static const struct 3616 static const struct
3617 { 3617 {
3618 const int argval; 3618 const int argval;
3619 const unsigned long bit; 3619 const unsigned long bit;
3620 }
3621
3622 argtopriv[] = { 3620 } argtopriv[] = {
3623 { 1, PrivMode_aplCUR }, 3621 { 1, PrivMode_aplCUR },
3624 { 2, PrivMode_vt52 }, 3622 { 2, PrivMode_vt52 },
3625 { 3, PrivMode_132 }, 3623 { 3, PrivMode_132 },
3626 { 4, PrivMode_smoothScroll }, 3624 { 4, PrivMode_smoothScroll },
3627 { 5, PrivMode_rVideo }, 3625 { 5, PrivMode_rVideo },

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines