… | |
… | |
87 | /* |
87 | /* |
88 | * CLEAR_ROWS : clear <num> rows starting from row <row> |
88 | * CLEAR_ROWS : clear <num> rows starting from row <row> |
89 | * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y> |
89 | * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y> |
90 | * ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour |
90 | * ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour |
91 | */ |
91 | */ |
92 | #define drawBuffer vt |
|
|
93 | |
|
|
94 | #define CLEAR_ROWS(row, num) \ |
92 | #define CLEAR_ROWS(row, num) \ |
95 | if (mapped) \ |
93 | if (mapped) \ |
96 | XClearArea (dpy, drawBuffer, 0, \ |
94 | XClearArea (dpy, vt, 0, \ |
97 | Row2Pixel (row), (unsigned int)width, \ |
95 | Row2Pixel (row), (unsigned int)width, \ |
98 | (unsigned int)Height2Pixel (num), False) |
96 | (unsigned int)Height2Pixel (num), False) |
99 | |
97 | |
100 | #define CLEAR_CHARS(x, y, num) \ |
98 | #define CLEAR_CHARS(x, y, num) \ |
101 | if (mapped) \ |
99 | if (mapped) \ |
102 | XClearArea (dpy, drawBuffer, x, y, \ |
100 | XClearArea (dpy, vt, x, y, \ |
103 | (unsigned int)Width2Pixel (num), \ |
101 | (unsigned int)Width2Pixel (num), \ |
104 | (unsigned int)Height2Pixel (1), False) |
102 | (unsigned int)Height2Pixel (1), False) |
105 | |
103 | |
106 | #define ERASE_ROWS(row, num) \ |
104 | #define ERASE_ROWS(row, num) \ |
107 | XFillRectangle (dpy, drawBuffer, gc, \ |
105 | XFillRectangle (dpy, vt, gc, \ |
108 | 0, Row2Pixel (row), \ |
106 | 0, Row2Pixel (row), \ |
109 | (unsigned int)width, \ |
107 | (unsigned int)width, \ |
110 | (unsigned int)Height2Pixel (num)) |
108 | (unsigned int)Height2Pixel (num)) |
111 | |
109 | |
112 | /* ------------------------------------------------------------------------- * |
110 | /* ------------------------------------------------------------------------- * |
113 | * SCREEN `COMMON' ROUTINES * |
111 | * SCREEN `COMMON' ROUTINES * |
114 | * ------------------------------------------------------------------------- */ |
112 | * ------------------------------------------------------------------------- */ |
… | |
… | |
596 | /* |
594 | /* |
597 | * Change the rendition style for following text |
595 | * Change the rendition style for following text |
598 | */ |
596 | */ |
599 | void |
597 | void |
600 | rxvt_term::scr_rendition (int set, int style) NOTHROW |
598 | rxvt_term::scr_rendition (int set, int style) NOTHROW |
601 | { |
599 | { |
602 | if (set) |
600 | if (set) |
603 | rstyle |= style; |
601 | rstyle |= style; |
604 | else if (style == ~RS_None) |
602 | else if (style == ~RS_None) |
605 | rstyle = DEFAULT_RSTYLE; |
603 | rstyle = DEFAULT_RSTYLE; |
606 | else |
604 | else |
607 | rstyle &= ~style; |
605 | rstyle &= ~style; |
608 | } |
606 | } |
609 | |
607 | |
610 | /* ------------------------------------------------------------------------- */ |
608 | /* ------------------------------------------------------------------------- */ |
611 | /* |
609 | /* |
612 | * Scroll text between <row1> and <row2> inclusive, by <count> lines |
610 | * Scroll text between <row1> and <row2> inclusive, by <count> lines |
613 | * count positive ==> scroll up |
611 | * count positive ==> scroll up |
… | |
… | |
1011 | * XTERM_SEQ: CTRL-H |
1009 | * XTERM_SEQ: CTRL-H |
1012 | */ |
1010 | */ |
1013 | void |
1011 | void |
1014 | rxvt_term::scr_backspace () NOTHROW |
1012 | rxvt_term::scr_backspace () NOTHROW |
1015 | { |
1013 | { |
1016 | want_refresh = 1; |
|
|
1017 | |
|
|
1018 | if (screen.cur.col == 0) |
1014 | if (screen.cur.col == 0) |
1019 | { |
1015 | { |
1020 | if (screen.cur.row > 0) |
1016 | if (screen.cur.row > 0) |
1021 | { |
1017 | { |
1022 | #ifdef TERMCAP_HAS_BW |
1018 | #ifdef TERMCAP_HAS_BW |
1023 | screen.cur.col = ncol - 1; |
1019 | screen.cur.col = ncol - 1; |
1024 | screen.cur.row--; |
1020 | --screen.cur.row; |
1025 | return; |
1021 | |
|
|
1022 | want_refresh = 1; |
1026 | #endif |
1023 | #endif |
1027 | } |
1024 | } |
1028 | } |
1025 | } |
1029 | else if (!(screen.flags & Screen_WrapNext)) |
1026 | else |
1030 | scr_gotorc (0, -1, RELATIVE); |
1027 | scr_gotorc (0, -1, RELATIVE); |
1031 | |
|
|
1032 | screen.flags &= ~Screen_WrapNext; |
|
|
1033 | } |
1028 | } |
1034 | |
1029 | |
1035 | /* ------------------------------------------------------------------------- */ |
1030 | /* ------------------------------------------------------------------------- */ |
1036 | /* |
1031 | /* |
1037 | * Process Horizontal Tab |
1032 | * Process Horizontal Tab |
… | |
… | |
1872 | void |
1867 | void |
1873 | rxvt_term::bell_cb (ev::timer &w, int revents) |
1868 | rxvt_term::bell_cb (ev::timer &w, int revents) |
1874 | { |
1869 | { |
1875 | rvideo_bell = false; |
1870 | rvideo_bell = false; |
1876 | scr_rvideo_mode (rvideo_mode); |
1871 | scr_rvideo_mode (rvideo_mode); |
|
|
1872 | refresh_check (); |
1877 | } |
1873 | } |
1878 | #endif |
1874 | #endif |
1879 | |
1875 | |
1880 | /* ------------------------------------------------------------------------- */ |
1876 | /* ------------------------------------------------------------------------- */ |
1881 | void |
1877 | void |
… | |
… | |
1903 | |
1899 | |
1904 | if (option (Opt_visualBell)) |
1900 | if (option (Opt_visualBell)) |
1905 | { |
1901 | { |
1906 | rvideo_bell = true; |
1902 | rvideo_bell = true; |
1907 | scr_rvideo_mode (rvideo_mode); |
1903 | scr_rvideo_mode (rvideo_mode); |
1908 | display->flush (); |
1904 | flush (); |
1909 | |
1905 | |
1910 | bell_ev.start (VISUAL_BELL_DURATION); |
1906 | bell_ev.start (VISUAL_BELL_DURATION); |
1911 | } |
1907 | } |
1912 | else |
1908 | else |
1913 | XBell (dpy, 0); |
1909 | XBell (dpy, 0); |
… | |
… | |
2263 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2259 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2264 | { |
2260 | { |
2265 | bool invert = rend & RS_RVid; |
2261 | bool invert = rend & RS_RVid; |
2266 | |
2262 | |
2267 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2263 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2268 | if (rend & RS_Bold |
|
|
2269 | && fore == Color_fg) |
2264 | if (rend & RS_Bold && fore == Color_fg) |
2270 | { |
2265 | { |
2271 | if (ISSET_PIXCOLOR (Color_BD)) |
2266 | if (ISSET_PIXCOLOR (Color_BD)) |
2272 | fore = Color_BD; |
2267 | fore = Color_BD; |
2273 | # if !ENABLE_STYLES |
2268 | # if !ENABLE_STYLES |
2274 | else |
2269 | else |
2275 | invert = !invert; |
2270 | invert = !invert; |
2276 | # endif |
2271 | # endif |
2277 | } |
2272 | } |
2278 | |
2273 | |
2279 | if (rend & RS_Italic |
2274 | if (rend & RS_Italic && fore == Color_fg) |
2280 | && fore == Color_fg) |
|
|
2281 | { |
2275 | { |
2282 | if (ISSET_PIXCOLOR (Color_IT)) |
2276 | if (ISSET_PIXCOLOR (Color_IT)) |
2283 | fore = Color_IT; |
2277 | fore = Color_IT; |
2284 | # if !ENABLE_STYLES |
2278 | # if !ENABLE_STYLES |
2285 | else |
2279 | else |
… | |
… | |
2379 | XSetForeground (dpy, gc, pix_colors[Color_underline]); |
2373 | XSetForeground (dpy, gc, pix_colors[Color_underline]); |
2380 | else |
2374 | else |
2381 | #endif |
2375 | #endif |
2382 | XSetForeground (dpy, gc, pix_colors[fore]); |
2376 | XSetForeground (dpy, gc, pix_colors[fore]); |
2383 | |
2377 | |
2384 | XDrawLine (dpy, drawBuffer, gc, |
2378 | XDrawLine (dpy, vt, gc, |
2385 | xpixel, ypixel + font->ascent + 1, |
2379 | xpixel, ypixel + font->ascent + 1, |
2386 | xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); |
2380 | xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); |
2387 | } |
2381 | } |
2388 | } /* for (col....) */ |
2382 | } /* for (col....) */ |
2389 | } /* for (row....) */ |
2383 | } /* for (row....) */ |
… | |
… | |
2427 | XSetForeground (dpy, gc, pix_colors[Color_cursor]); |
2421 | XSetForeground (dpy, gc, pix_colors[Color_cursor]); |
2428 | else |
2422 | else |
2429 | #endif |
2423 | #endif |
2430 | XSetForeground (dpy, gc, pix_colors[ccol1]); |
2424 | XSetForeground (dpy, gc, pix_colors[ccol1]); |
2431 | |
2425 | |
2432 | XDrawRectangle (dpy, drawBuffer, gc, |
2426 | XDrawRectangle (dpy, vt, gc, |
2433 | Col2Pixel (col), |
2427 | Col2Pixel (col), |
2434 | Row2Pixel (oldcursor.row), |
2428 | Row2Pixel (oldcursor.row), |
2435 | (unsigned int) (Width2Pixel (cursorwidth) - 1), |
2429 | (unsigned int) (Width2Pixel (cursorwidth) - 1), |
2436 | (unsigned int) (Height2Pixel (1) - lineSpace - 1)); |
2430 | (unsigned int) (Height2Pixel (1) - lineSpace - 1)); |
2437 | } |
2431 | } |
… | |
… | |
2475 | rxvt_term::scr_recolour () NOTHROW |
2469 | rxvt_term::scr_recolour () NOTHROW |
2476 | { |
2470 | { |
2477 | #ifdef HAVE_BG_PIXMAP |
2471 | #ifdef HAVE_BG_PIXMAP |
2478 | bgPixmap.apply (); |
2472 | bgPixmap.apply (); |
2479 | #else |
2473 | #else |
|
|
2474 | |
2480 | XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); |
2475 | XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); |
2481 | XClearWindow (dpy, parent[0]); |
2476 | XClearWindow (dpy, parent[0]); |
2482 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
2477 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
2483 | # if HAVE_SCROLLBARS |
2478 | |
2484 | if (scrollBar.win) |
2479 | if (scrollBar.win) |
2485 | { |
2480 | { |
2486 | XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); |
2481 | XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); |
2487 | scrollBar.setIdle (); |
2482 | scrollBar.state = STATE_IDLE; |
2488 | scrollbar_show (0); |
2483 | scrollbar_show (0); |
2489 | } |
2484 | } |
2490 | # endif |
2485 | |
2491 | scr_clear (); |
2486 | scr_clear (); |
2492 | scr_touch (true); |
2487 | scr_touch (true); |
2493 | want_refresh = 1; |
2488 | want_refresh = 1; |
2494 | #endif |
|
|
2495 | |
2489 | |
|
|
2490 | #endif |
2496 | } |
2491 | } |
2497 | |
2492 | |
2498 | /* ------------------------------------------------------------------------- */ |
2493 | /* ------------------------------------------------------------------------- */ |
2499 | void |
2494 | void |
2500 | rxvt_term::scr_clear (bool really) NOTHROW |
2495 | rxvt_term::scr_clear (bool really) NOTHROW |
… | |
… | |
2650 | /* convert normal newline chars into common keyboard Return key sequence */ |
2645 | /* convert normal newline chars into common keyboard Return key sequence */ |
2651 | for (unsigned int i = 0; i < len; i++) |
2646 | for (unsigned int i = 0; i < len; i++) |
2652 | if (data[i] == C0_LF) |
2647 | if (data[i] == C0_LF) |
2653 | data[i] = C0_CR; |
2648 | data[i] = C0_CR; |
2654 | |
2649 | |
|
|
2650 | if (priv_modes & PrivMode_BracketPaste) |
|
|
2651 | tt_printf ("\e[200~"); |
|
|
2652 | |
2655 | tt_write (data, len); |
2653 | tt_write (data, len); |
|
|
2654 | |
|
|
2655 | if (priv_modes & PrivMode_BracketPaste) |
|
|
2656 | tt_printf ("\e[201~"); |
2656 | } |
2657 | } |
2657 | |
2658 | |
2658 | /* ------------------------------------------------------------------------- */ |
2659 | /* ------------------------------------------------------------------------- */ |
2659 | /* |
2660 | /* |
2660 | * Respond to a notification that a primary selection has been sent |
2661 | * Respond to a notification that a primary selection has been sent |