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.381 by root, Fri Dec 14 05:25:23 2007 UTC vs.
Revision 1.390 by ayin, Tue Jan 8 16:25:42 2008 UTC

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-2007 Marc Lehmann <pcg@goof.com> 30 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com>
31 * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it>
31 * 32 *
32 * 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
33 * 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
34 * the Free Software Foundation; either version 2 of the License, or 35 * the Free Software Foundation; either version 2 of the License, or
35 * (at your option) any later version. 36 * (at your option) any later version.
198 r & RS_Uline ? " uline" : "", 199 r & RS_Uline ? " uline" : "",
199 r & RS_Careful ? " careful" : ""); 200 r & RS_Careful ? " careful" : "");
200 201
201 int width = wcswidth (fname, wcslen (fname)); 202 int width = wcswidth (fname, wcslen (fname));
202 203
203 max_it (width, 8+5); // for char + hey 204 max_it (width, 8+5); // for char + hex
204 max_it (width, strlen (attr)); 205 max_it (width, strlen (attr));
205 206
206 if (y >= 0) 207 if (y >= 0)
207 { 208 {
208 y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; 209 y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1;
220 ch = *chr++; 221 ch = *chr++;
221 222
222 sprintf (buf, "%8x", ch); 223 sprintf (buf, "%8x", ch);
223 scr_overlay_set (0, y, buf); 224 scr_overlay_set (0, y, buf);
224 scr_overlay_set (9, y, '='); 225 scr_overlay_set (9, y, '=');
225# if !UNICODE3 226# if !UNICODE_3
226 if (ch >= 0x10000) 227 if (ch >= 0x10000)
227 ch = 0xfffd; 228 ch = 0xfffd;
228# endif 229# endif
229 scr_overlay_set (11, y, ch, r); 230 scr_overlay_set (11, y, ch, r);
230 231
1047void 1048void
1048rxvt_term::refresh_check () 1049rxvt_term::refresh_check ()
1049{ 1050{
1050 if (want_refresh && !flush_ev.is_active ()) 1051 if (want_refresh && !flush_ev.is_active ())
1051 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally 1052 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
1053
1054 display->flush ();
1052} 1055}
1053 1056
1054void 1057void
1055rxvt_term::flush_cb (ev::timer &w, int revents) 1058rxvt_term::flush_cb (ev::timer &w, int revents)
1056{ 1059{
1209 if (cmd_parse ()) 1212 if (cmd_parse ())
1210 break; 1213 break;
1211 1214
1212 if (revents & ev::WRITE) 1215 if (revents & ev::WRITE)
1213 pty_write (); 1216 pty_write ();
1217
1218 refresh_check ();
1214} 1219}
1215 1220
1216void 1221void
1217rxvt_term::pointer_unblank () 1222rxvt_term::pointer_unblank ()
1218{ 1223{
1453#ifdef HAVE_BG_PIXMAP 1458#ifdef HAVE_BG_PIXMAP
1454 if (bgPixmap.window_position_sensitive ()) 1459 if (bgPixmap.window_position_sensitive ())
1455 update_background (); 1460 update_background ();
1456#endif 1461#endif
1457 } 1462 }
1463
1458 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1464 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1459 } 1465 }
1460 break; 1466 break;
1461 1467
1462 case PropertyNotify: 1468 case PropertyNotify:
1524 while (XCheckTypedWindowEvent (dpy, ev.xany.window, Expose, &unused_event)) 1530 while (XCheckTypedWindowEvent (dpy, ev.xany.window, Expose, &unused_event))
1525 ; 1531 ;
1526 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event)) 1532 while (XCheckTypedWindowEvent (dpy, ev.xany.window, GraphicsExpose, &unused_event))
1527 ; 1533 ;
1528 1534
1529 if (isScrollbarWindow (ev.xany.window)) 1535 if (scrollBar.state && ev.xany.window == scrollBar.win)
1530 { 1536 {
1531 scrollBar.setIdle (); 1537 scrollBar.setIdle ();
1532 scrollbar_show (0); 1538 scrollbar_show (0);
1533 } 1539 }
1534 } 1540 }
1624#ifdef MOUSE_THRESHOLD 1630#ifdef MOUSE_THRESHOLD
1625 } 1631 }
1626#endif 1632#endif
1627 } 1633 }
1628 } 1634 }
1629 else if (isScrollbarWindow (ev.xany.window) && scrollbar_isMotion ()) 1635 else if (scrollbar_isMotion () && ev.xany.window == scrollBar.win)
1630 { 1636 {
1631 while (XCheckTypedWindowEvent (dpy, scrollBar.win, 1637 while (XCheckTypedWindowEvent (dpy, scrollBar.win,
1632 MotionNotify, &ev)) 1638 MotionNotify, &ev))
1633 ; 1639 ;
1634 1640
1790 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID]) 1796 || ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID])
1791 { 1797 {
1792 bgPixmap.set_root_pixmap (); 1798 bgPixmap.set_root_pixmap ();
1793 update_background (); 1799 update_background ();
1794 } 1800 }
1801
1795 break; 1802 break;
1796 } 1803 }
1797# endif 1804# endif
1798 1805
1799 refresh_check (); 1806 refresh_check ();
1917 } 1924 }
1918 1925
1919 /* 1926 /*
1920 * Scrollbar window processing of button press 1927 * Scrollbar window processing of button press
1921 */ 1928 */
1922 if (isScrollbarWindow (ev.window)) 1929 if (scrollBar.state && ev.window == scrollBar.win)
1923 { 1930 {
1924 scrollBar.setIdle (); 1931 scrollBar.setIdle ();
1925 /* 1932 /*
1926 * Rxvt-style scrollbar: 1933 * Rxvt-style scrollbar:
1927 * move up if mouse is above slider 1934 * move up if mouse is above slider
2001 } 2008 }
2002 else 2009 else
2003 switch (ev.button) 2010 switch (ev.button)
2004 { 2011 {
2005 case Button2: 2012 case Button2:
2006 switch (scrollbar_align) 2013 switch (scrollBar.align)
2007 { 2014 {
2008 case R_SB_ALIGN_TOP: 2015 case R_SB_ALIGN_TOP:
2009 csrO = 0; 2016 csrO = 0;
2010 break; 2017 break;
2011 case R_SB_ALIGN_CENTRE: 2018 case R_SB_ALIGN_CENTRE:
2023 2030
2024 scrollBar.setMotion (); 2031 scrollBar.setMotion ();
2025 break; 2032 break;
2026 2033
2027 case Button1: 2034 case Button1:
2028 if (scrollbar_align == R_SB_ALIGN_CENTRE) 2035 if (scrollBar.align == R_SB_ALIGN_CENTRE)
2029 csrO = ev.y - scrollBar.top; 2036 csrO = ev.y - scrollBar.top;
2030 /* FALLTHROUGH */ 2037 /* FALLTHROUGH */
2031 2038
2032 case Button3: 2039 case Button3:
2033 if (scrollBar.style != R_SB_XTERM) 2040 if (scrollBar.style != R_SB_XTERM)
2163 2170
2164 if (!slip_wheel_ev.is_active ()) 2171 if (!slip_wheel_ev.is_active ())
2165 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY); 2172 slip_wheel_ev.start (SCROLLBAR_CONTINUOUS_DELAY, SCROLLBAR_CONTINUOUS_DELAY);
2166 } 2173 }
2167 else 2174 else
2175# endif
2168 { 2176 {
2169# endif
2170 scr_page (v, i); 2177 scr_page (v, i);
2171 scrollbar_show (1); 2178 scrollbar_show (1);
2172# ifdef MOUSE_SLIP_WHEELING
2173 } 2179 }
2174# endif
2175 } 2180 }
2176 break; 2181 break;
2177#endif 2182#endif
2178 } 2183 }
2179 } 2184 }
2308 } 2313 }
2309 2314
2310 ch = NOCHAR; 2315 ch = NOCHAR;
2311 } 2316 }
2312 } 2317 }
2313
2314 refresh_check ();
2315 2318
2316 return flag; 2319 return flag;
2317} 2320}
2318 2321
2319// read the next character 2322// read the next character
3387#if ENABLE_TRANSPARENCY 3390#if ENABLE_TRANSPARENCY
3388 case URxvt_Color_tint: 3391 case URxvt_Color_tint:
3389 process_color_seq (op, Color_tint, str, resp); 3392 process_color_seq (op, Color_tint, str, resp);
3390 { 3393 {
3391 bool changed = false; 3394 bool changed = false;
3395
3392 if (ISSET_PIXCOLOR (Color_tint)) 3396 if (ISSET_PIXCOLOR (Color_tint))
3393 changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]); 3397 changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]);
3394 else 3398 else
3395 changed = bgPixmap.unset_tint (); 3399 changed = bgPixmap.unset_tint ();
3400
3396 if (changed) 3401 if (changed)
3397 update_background (); 3402 update_background ();
3398 } 3403 }
3399 3404
3400 break; 3405 break;
3423 changed++; 3428 changed++;
3424 str = strchr (str, ';'); 3429 str = strchr (str, ';');
3425 if (str == NULL) 3430 if (str == NULL)
3426 bgPixmap.set_defaultGeometry (); 3431 bgPixmap.set_defaultGeometry ();
3427 } 3432 }
3433
3428 while (str) 3434 while (str)
3429 { 3435 {
3430 str++; 3436 str++;
3431 if (bgPixmap.set_geometry (str)) 3437 if (bgPixmap.set_geometry (str))
3432 changed++; 3438 changed++;
3433 str = strchr (str, ';'); 3439 str = strchr (str, ';');
3434 } 3440 }
3441
3435 if (changed) 3442 if (changed)
3436 update_background (); 3443 update_background ();
3437 } 3444 }
3438 break; 3445 break;
3439#endif 3446#endif
3440 3447
3441 case Rxvt_restoreFG: 3448 case Rxvt_restoreFG:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines