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.328 by ayin, Mon Jun 11 17:40:15 2007 UTC vs.
Revision 1.334 by ayin, Tue Jun 26 13:05:05 2007 UTC

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
541 541
542#ifdef PRINTPIPE 542#ifdef PRINTPIPE
543 if (keysym == XK_Print) 543 if (keysym == XK_Print)
544 { 544 {
545 scr_printscreen (ctrl | shft); 545 scr_printscreen (ctrl | shft);
546 return; 546 return;
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
1186 1185
1187#if LINUX_YIELD_HACK 1186#if LINUX_YIELD_HACK
1188static struct event_handler 1187static struct event_handler
1189{ 1188{
1190 check_watcher yield_ev; 1189 check_watcher yield_ev;
1191 1190
1192 void yield_cb (check_watcher &w) 1191 void yield_cb (check_watcher &w)
1193 { 1192 {
1194 // this should really be sched_yield(), but the linux guys thought 1193 // this should really be sched_yield(), but the linux guys thought
1195 // that giving a process calling sched_yield () less cpu time than 1194 // that giving a process calling sched_yield () less cpu time than
1196 // ones with high nice levels is a useful thing to do. It surely is is 1195 // ones with high nice levels is a useful thing to do. It surely is is
1243 pty_ev.stop (); 1242 pty_ev.stop ();
1244 1243
1245 if (!option (Opt_hold)) 1244 if (!option (Opt_hold))
1246 destroy (); 1245 destroy ();
1247 } 1246 }
1248 1247
1249 return false; 1248 return false;
1250} 1249}
1251 1250
1252void 1251void
1253rxvt_term::pty_cb (io_watcher &w, short revents) 1252rxvt_term::pty_cb (io_watcher &w, short revents)
1490 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height) 1489 if (szHint.width != ev.xconfigure.width || szHint.height != ev.xconfigure.height)
1491 { 1490 {
1492 seen_resize = 1; 1491 seen_resize = 1;
1493 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1492 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1494#ifdef XPM_BACKGROUND 1493#ifdef XPM_BACKGROUND
1495 if (!option(Opt_transparent) && bgPixmap.auto_resize) 1494 if (!option (Opt_transparent) && bgPixmap.auto_resize)
1496 { 1495 {
1497 resize_pixmap (); 1496 resize_pixmap ();
1498 scr_touch (true); 1497 scr_touch (true);
1499 } 1498 }
1500#endif 1499#endif
1501 } 1500 }
1502 1501
1503 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1502 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1504 1503
1505#ifdef TRANSPARENT 1504#ifdef ENABLE_TRANSPARENCY
1506 if (option (Opt_transparent)) 1505 if (option (Opt_transparent))
1507 check_our_parents (); 1506 check_our_parents ();
1508#endif 1507#endif
1509 } 1508 }
1510 break; 1509 break;
1544 text_blink_ev.stop (); 1543 text_blink_ev.stop ();
1545#endif 1544#endif
1546 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); 1545 HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1547 break; 1546 break;
1548 1547
1549#ifdef TRANSPARENT 1548#ifdef ENABLE_TRANSPARENCY
1550 case ReparentNotify: 1549 case ReparentNotify:
1551 rootwin_cb (ev); 1550 rootwin_cb (ev);
1552 break; 1551 break;
1553#endif /* TRANSPARENT */ 1552#endif /* ENABLE_TRANSPARENCY */
1554 1553
1555 case GraphicsExpose: 1554 case GraphicsExpose:
1556 case Expose: 1555 case Expose:
1557 if (ev.xany.window == vt) 1556 if (ev.xany.window == vt)
1558 { 1557 {
1582 { 1581 {
1583 scrollBar.setIdle (); 1582 scrollBar.setIdle ();
1584 scrollbar_show (0); 1583 scrollbar_show (0);
1585 } 1584 }
1586 1585
1587#ifdef TRANSPARENT 1586#ifdef ENABLE_TRANSPARENCY
1588 if (am_transparent && ev.xany.window == parent[0]) 1587 if (am_transparent && ev.xany.window == parent[0])
1589 XClearWindow (dpy, ev.xany.window); 1588 XClearWindow (dpy, ev.xany.window);
1590#endif 1589#endif
1591 } 1590 }
1592 break; 1591 break;
1693 &ev.xbutton.x, &ev.xbutton.y, 1692 &ev.xbutton.x, &ev.xbutton.y,
1694 &unused_mask); 1693 &unused_mask);
1695 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO, 1694 scr_move_to (scrollbar_position (ev.xbutton.y) - csrO,
1696 scrollbar_size ()); 1695 scrollbar_size ());
1697 want_refresh = 1; 1696 want_refresh = 1;
1698 refresh_limit = 0;
1699 scrollbar_show (1); 1697 scrollbar_show (1);
1700 } 1698 }
1701 break; 1699 break;
1702 } 1700 }
1703 1701
1822 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); 1820 pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
1823 } 1821 }
1824#endif 1822#endif
1825} 1823}
1826 1824
1827#if TRANSPARENT || ENABLE_PERL 1825#if ENABLE_TRANSPARENCY || ENABLE_PERL
1828void 1826void
1829rxvt_term::rootwin_cb (XEvent &ev) 1827rxvt_term::rootwin_cb (XEvent &ev)
1830{ 1828{
1831 make_current (); 1829 make_current ();
1832 1830
1833 if (SHOULD_INVOKE (HOOK_ROOT_EVENT) 1831 if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
1834 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) 1832 && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
1835 return; 1833 return;
1836 1834
1837# if TRANSPARENT 1835# if ENABLE_TRANSPARENCY
1838 switch (ev.type) 1836 switch (ev.type)
1839 { 1837 {
1840 case PropertyNotify: 1838 case PropertyNotify:
1841 /* 1839 /*
1842 * if user used some Esetroot compatible prog to set the root bg, 1840 * if user used some Esetroot compatible prog to set the root bg,
2291 if (ch == C0_LF) 2289 if (ch == C0_LF)
2292 nlines++; 2290 nlines++;
2293 2291
2294 refresh_count++; 2292 refresh_count++;
2295 2293
2296 if (!option (Opt_jumpScroll) 2294 if (!option (Opt_jumpScroll) || refresh_count >= nrow - 1)
2297 || (refresh_count >= refresh_limit * (nrow - 1)))
2298 { 2295 {
2299 refreshnow = true;
2300 refresh_count = 0; 2296 refresh_count = 0;
2297
2298 if (!option (Opt_skipScroll) || io_manager::now () > NOW + 1. / 60.)
2299 {
2300 refreshnow = true;
2301 ch = NOCHAR; 2301 ch = NOCHAR;
2302 break; 2302 break;
2303 }
2303 } 2304 }
2304 2305
2305 // scr_add_lines only works for nlines <= nrow - 1. 2306 // scr_add_lines only works for nlines <= nrow - 1.
2306 if (nlines >= nrow - 1) 2307 if (nlines >= nrow - 1)
2307 { 2308 {
2335 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END)))) 2336 && HOOK_INVOKE ((this, HOOK_ADD_LINES, DT_WCS_LEN, buf, str - buf, DT_END))))
2336 scr_add_lines (buf, str - buf, nlines); 2337 scr_add_lines (buf, str - buf, nlines);
2337 2338
2338 /* 2339 /*
2339 * If there have been a lot of new lines, then update the screen 2340 * 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. 2341 * 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 2342 * if skipScroll is enabled.
2342 * is incremented here because we must be doing flat-out scrolling.
2343 */ 2343 */
2344 if (refreshnow) 2344 if (refreshnow)
2345 { 2345 {
2346 if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2347 refresh_limit++;
2348 else
2349 {
2350 flag = true; 2346 flag = true;
2351 //TODO: due to popular request, implement "skipscroll" option here
2352 scr_refresh (); 2347 scr_refresh ();
2353 want_refresh = 1; 2348 want_refresh = 1;
2354 }
2355 } 2349 }
2356 2350
2357 } 2351 }
2358 else 2352 else
2359 { 2353 {
2508 { 2502 {
2509 if ((buf[len++] = cmd_getc ()) == 'i') 2503 if ((buf[len++] = cmd_getc ()) == 'i')
2510 break; /* done = 1 */ 2504 break; /* done = 1 */
2511 } 2505 }
2512 } 2506 }
2513 2507
2514 for (i = 0; i < len; i++) 2508 for (i = 0; i < len; i++)
2515 if (putc (buf[i], fd) == EOF) 2509 if (putc (buf[i], fd) == EOF)
2516 { 2510 {
2517 done = 1; 2511 done = 1;
2518 break; 2512 break;
2580 process_dcs_seq (); 2574 process_dcs_seq ();
2581 break; 2575 break;
2582 case 0x9b: /* CSI */ 2576 case 0x9b: /* CSI */
2583 process_csi_seq (); 2577 process_csi_seq ();
2584 break; 2578 break;
2585 case 0x9d: /* CSI */ 2579 case 0x9d: /* OSC */
2586 process_osc_seq (); 2580 process_osc_seq ();
2587 break; 2581 break;
2588#endif 2582#endif
2589 } 2583 }
2590} 2584}
2873 switch (priv) 2867 switch (priv)
2874 { 2868 {
2875 case '>': 2869 case '>':
2876 if (ch == CSI_DA) /* secondary device attributes */ 2870 if (ch == CSI_DA) /* secondary device attributes */
2877 { 2871 {
2878 // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, 2872 // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt,
2879 // 'U' for rxvt-unicode != 7.[34] (where it was broken). 2873 // 'U' for rxvt-unicode != 7.[34] (where it was broken).
2880 // 2874 //
2881 // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt 2875 // 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 2876 // 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). 2877 // that we do not support xterm mouse reporting (should be 95 when we do).
3336 int saveop = op; 3330 int saveop = op;
3337 3331
3338 dLocal (Display *, dpy); 3332 dLocal (Display *, dpy);
3339 3333
3340 assert (str != NULL); 3334 assert (str != NULL);
3341 3335
3342 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) 3336 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END)))
3343 return; 3337 return;
3344 3338
3345 switch (op) 3339 switch (op)
3346 { 3340 {
3441 break; 3435 break;
3442 case URxvt_Color_IT: 3436 case URxvt_Color_IT:
3443 process_color_seq (op, Color_IT, str, resp); 3437 process_color_seq (op, Color_IT, str, resp);
3444 break; 3438 break;
3445#endif 3439#endif
3446#if TRANSPARENT && TINTING 3440#if ENABLE_TRANSPARENCY && TINTING
3447 case URxvt_Color_tint: 3441 case URxvt_Color_tint:
3448 process_color_seq (op, Color_tint, str, resp); 3442 process_color_seq (op, Color_tint, str, resp);
3449 3443
3450 check_our_parents (); 3444 check_our_parents ();
3451 3445
3481#ifdef XPM_BACKGROUND 3475#ifdef XPM_BACKGROUND
3482 resize_pixmap (); 3476 resize_pixmap ();
3483 scr_touch (true); 3477 scr_touch (true);
3484#endif 3478#endif
3485 } 3479 }
3486#if TRANSPARENT && defined(HAVE_AFTERIMAGE) 3480#if ENABLE_TRANSPARENCY && defined(HAVE_AFTERIMAGE)
3487 if (option(Opt_transparent)) 3481 if (option (Opt_transparent))
3488 check_our_parents (); 3482 check_our_parents ();
3489#endif 3483#endif
3490
3491 } 3484 }
3492 break; 3485 break;
3493 3486
3494 case Rxvt_restoreFG: 3487 case Rxvt_restoreFG:
3495 set_window_color (Color_fg, str); 3488 set_window_color (Color_fg, str);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines