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.306 by root, Mon Feb 6 05:40:15 2006 UTC vs.
Revision 1.320 by root, Mon Apr 30 15:07:09 2007 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*----------------------------------------------------------------------*
2 * File: command.C 2 * File: command.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> 6 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
1458 break; 1458 break;
1459 } 1459 }
1460 break; 1460 break;
1461 1461
1462 case FocusIn: 1462 case FocusIn:
1463 if (ev.xfocus.detail != NotifyInferior
1464 && ev.xfocus.detail != NotifyPointer
1465 && ev.xfocus.mode != NotifyGrab)
1463 focus_in (); 1466 focus_in ();
1464 break; 1467 break;
1465 1468
1466 case FocusOut: 1469 case FocusOut:
1470 if (ev.xfocus.detail != NotifyInferior
1471 && ev.xfocus.detail != NotifyPointer
1472 && ev.xfocus.mode != NotifyGrab)
1467 focus_out (); 1473 focus_out ();
1468 break; 1474 break;
1469 1475
1470 case ConfigureNotify: 1476 case ConfigureNotify:
1471 if (ev.xconfigure.window == parent[0]) 1477 if (ev.xconfigure.window == parent[0])
1472 { 1478 {
1479 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1485 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1480 } 1486 }
1481 1487
1482 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1488 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1483 1489
1484#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ 1490#ifdef TRANSPARENT
1485 if (OPTION (Opt_transparent)) 1491 if (OPTION (Opt_transparent))
1486 check_our_parents (); 1492 check_our_parents ();
1487#endif 1493#endif
1488 } 1494 }
1489 break; 1495 break;
1714 if (!focus) 1720 if (!focus)
1715 { 1721 {
1716 focus = 1; 1722 focus = 1;
1717 want_refresh = 1; 1723 want_refresh = 1;
1718 1724
1719 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); 1725 HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END));
1720 1726
1721#if USE_XIM 1727#if USE_XIM
1722 if (Input_Context != NULL) 1728 if (Input_Context != NULL)
1723 { 1729 {
1724 IMSetStatusPosition (); 1730 IMSetPosition ();
1725 XSetICFocus (Input_Context); 1731 XSetICFocus (Input_Context);
1726 } 1732 }
1727#endif 1733#endif
1728#if CURSOR_BLINK 1734#if CURSOR_BLINK
1729 if (OPTION (Opt_cursorBlink)) 1735 if (OPTION (Opt_cursorBlink))
1775 } 1781 }
1776#endif 1782#endif
1777 } 1783 }
1778} 1784}
1779 1785
1780#if TRANSPARENT 1786void
1787rxvt_term::update_fade_color (unsigned int idx)
1788{
1789#if OFF_FOCUS_FADING
1790 if (rs[Rs_fade])
1791 {
1792 rgba c;
1793 pix_colors [Color_fade].get (c);
1794 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1795 }
1796#endif
1797}
1798
1799#if TRANSPARENT || ENABLE_PERL
1781void 1800void
1782rxvt_term::rootwin_cb (XEvent &ev) 1801rxvt_term::rootwin_cb (XEvent &ev)
1783{ 1802{
1784 make_current (); 1803 make_current ();
1785 1804
1805 if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
1806 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
1807 return;
1808
1809# if TRANSPARENT
1786 switch (ev.type) 1810 switch (ev.type)
1787 { 1811 {
1788 case PropertyNotify: 1812 case PropertyNotify:
1789 /* 1813 /*
1790 * if user used some Esetroot compatible prog to set the root bg, 1814 * if user used some Esetroot compatible prog to set the root bg,
1798 case ReparentNotify: 1822 case ReparentNotify:
1799 if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) 1823 if (OPTION (Opt_transparent) && check_our_parents () && am_transparent)
1800 want_refresh = want_full_refresh = 1; 1824 want_refresh = want_full_refresh = 1;
1801 break; 1825 break;
1802 } 1826 }
1827# endif
1803} 1828}
1804#endif 1829#endif
1805 1830
1806void 1831void
1807rxvt_term::button_press (XButtonEvent &ev) 1832rxvt_term::button_press (XButtonEvent &ev)
2135 selection_make (ev.time); 2160 selection_make (ev.time);
2136 break; 2161 break;
2137 2162
2138 case Button2: 2163 case Button2:
2139 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? 2164 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window?
2140 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); 2165 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary);
2141 break; 2166 break;
2142 2167
2143#ifdef MOUSE_WHEEL 2168#ifdef MOUSE_WHEEL
2144 case Button4: 2169 case Button4:
2145 case Button5: 2170 case Button5:
2765 if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) 2790 if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2766 refresh_limit++; 2791 refresh_limit++;
2767 else 2792 else
2768 { 2793 {
2769 flag = true; 2794 flag = true;
2795 //TODO: due to popular request, implement "skipscroll" option here
2770 scr_refresh (); 2796 scr_refresh ();
2771 want_refresh = 1; 2797 want_refresh = 1;
2772 } 2798 }
2773 } 2799 }
2774 2800
3654 seen_esc = true; 3680 seen_esc = true;
3655 continue; 3681 continue;
3656 } 3682 }
3657 else if (ch == C0_BEL || ch == CHAR_ST) 3683 else if (ch == C0_BEL || ch == CHAR_ST)
3658 break; 3684 break;
3685 else if (ch == C0_SYN)
3686 ch = cmd_get8 ();
3659 else if (ch < 0x20) 3687 else if (ch < 0x20)
3660 return NULL; /* other control character - exit */ 3688 return NULL; /* other control character - exit */
3661 3689
3662 seen_esc = false; 3690 seen_esc = false;
3663 3691
3664 if (n >= STRING_MAX - 1) 3692 if (n >= STRING_MAX - 1)
3665 // stop at some sane length 3693 // stop at some sane length
3666 return NULL; 3694 return NULL;
3667 3695
3668 if (ch == C0_SYN)
3669 string[n++] = cmd_get8 ();
3670 else
3671 string[n++] = ch; 3696 string[n++] = ch;
3672 } 3697 }
3673 3698
3674 string[n++] = '\0'; 3699 string[n++] = '\0';
3675 3700
3676 ends_how = (ch == 0x5c ? C0_ESC : ch); 3701 ends_how = (ch == 0x5c ? C0_ESC : ch);
3755 int saveop = op; 3780 int saveop = op;
3756 3781
3757 dLocal (Display *, dpy); 3782 dLocal (Display *, dpy);
3758 3783
3759 assert (str != NULL); 3784 assert (str != NULL);
3785
3786 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END)))
3787 return;
3788
3760 switch (op) 3789 switch (op)
3761 { 3790 {
3762 case XTerm_name: 3791 case XTerm_name:
3763 set_title (str); 3792 set_title (str);
3764 /* FALLTHROUGH */ 3793 /* FALLTHROUGH */
3981 break; 4010 break;
3982#endif 4011#endif
3983 4012
3984#if ENABLE_PERL 4013#if ENABLE_PERL
3985 case URxvt_perl: 4014 case URxvt_perl:
3986 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_STR, str, DT_END))) 4015 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ_PERL, DT_STR, str, DT_END)))
3987 ; // no responses yet 4016 ; // no responses yet
3988 break; 4017 break;
3989#endif 4018#endif
3990 } 4019 }
3991} 4020}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines