--- rxvt-unicode/src/screen.C 2013/02/16 17:26:53 1.434 +++ rxvt-unicode/src/screen.C 2021/05/13 19:40:20 1.460 @@ -4,10 +4,11 @@ * * Copyright (c) 1997-2001 Geoff Wing * Copyright (c) 2003-2007 Marc Lehmann + * Copyright (c) 2015 Emanuele Giaquinta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -96,7 +97,7 @@ /* Fill part/all of a line with blanks. */ void -rxvt_term::scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW +rxvt_term::scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const noexcept { if (!l.valid ()) { @@ -123,7 +124,7 @@ /* ------------------------------------------------------------------------- */ /* Fill a full line with blanks - make sure it is allocated first */ void -rxvt_term::scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW +rxvt_term::scr_blank_screen_mem (line_t &l, rend_t efs) const noexcept { scr_blank_line (l, 0, ncol, efs); @@ -133,7 +134,7 @@ // nuke a single wide character at the given column void -rxvt_term::scr_kill_char (line_t &l, int col) const NOTHROW +rxvt_term::scr_kill_char (line_t &l, int col) const noexcept { // find begin while (col > 0 && l.t[col] == NOCHAR) @@ -167,7 +168,7 @@ * ------------------------------------------------------------------------- */ void -rxvt_term::scr_alloc () NOTHROW +rxvt_term::scr_alloc () noexcept { int tsize = sizeof (text_t) * ncol; int rsize = sizeof (rend_t) * ncol; @@ -256,9 +257,6 @@ if (!prev_row_buf) { - /* - * first time called (or after scr_release) so just malloc everything: don't rely on realloc - */ top_row = 0; term_start = 0; @@ -293,9 +291,14 @@ * add or delete rows as appropriate */ + int common_col = min (prev_ncol, ncol); + for (int row = min (nrow, prev_nrow); row--; ) { - copy_line (drawn_buf [row], prev_drawn_buf [row]); + scr_blank_screen_mem (drawn_buf [row], DEFAULT_RSTYLE); + memcpy (drawn_buf [row].t, prev_drawn_buf [row].t, sizeof (text_t) * common_col); + memcpy (drawn_buf [row].r, prev_drawn_buf [row].r, sizeof (rend_t) * common_col); + copy_line (swap_buf [row], prev_swap_buf [row]); } @@ -440,7 +443,7 @@ } void ecb_cold -rxvt_term::scr_release () NOTHROW +rxvt_term::scr_release () noexcept { chunk_free (chunk, chunk_size); chunk = 0; @@ -469,7 +472,7 @@ } void ecb_cold -rxvt_term::scr_soft_reset () NOTHROW +rxvt_term::scr_soft_reset () noexcept { /* only affects modes, nothing drastic such as clearing the screen */ #if ENABLE_OVERLAY @@ -493,7 +496,7 @@ * XTERM_SEQ: Restore cursor: ESC 8 */ void -rxvt_term::scr_cursor (cursor_mode mode) NOTHROW +rxvt_term::scr_cursor (cursor_mode mode) noexcept { screen_t *s; @@ -534,7 +537,7 @@ } void -rxvt_term::scr_swap_screen () NOTHROW +rxvt_term::scr_swap_screen () noexcept { if (!option (Opt_secondaryScreen)) return; @@ -592,7 +595,7 @@ // clear WrapNext indicator, solidifying position on next line void -rxvt_term::scr_do_wrap () NOTHROW +rxvt_term::scr_do_wrap () noexcept { if (!(screen.flags & Screen_WrapNext)) return; @@ -612,9 +615,9 @@ * Change the colour for following text */ void -rxvt_term::scr_color (unsigned int color, int fgbg) NOTHROW +rxvt_term::scr_color (unsigned int color, int fgbg) noexcept { - if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) + if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR24)) color = fgbg; if (fgbg == Color_fg) @@ -628,7 +631,7 @@ * Change the rendition style for following text */ void -rxvt_term::scr_rendition (int set, int style) NOTHROW +rxvt_term::scr_rendition (int set, int style) noexcept { if (set) rstyle |= style; @@ -645,7 +648,7 @@ * count negative ==> scroll down */ int ecb_hot -rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW +rxvt_term::scr_scroll_text (int row1, int row2, int count) noexcept { if (count == 0 || (row1 > row2)) return 0; @@ -715,7 +718,7 @@ if (option (Opt_scrollWithBuffer) && view_start != 0 && view_start != -saveLines) - scr_page (UP, count); + scr_page (count); if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); @@ -789,7 +792,7 @@ * Add text given in of length to screen struct */ void ecb_hot -rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW +rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) noexcept { if (len <= 0) /* sanity */ return; @@ -1011,8 +1014,8 @@ && ROW(screen.cur.row - 1).is_longer ()) { linep = &ROW(screen.cur.row - 1); - tp = line->t + ncol - 1; - rp = line->r + ncol - 1; + tp = linep->t + ncol - 1; + rp = linep->r + ncol - 1; } else continue; @@ -1045,7 +1048,7 @@ * XTERM_SEQ: CTRL-H */ void -rxvt_term::scr_backspace () NOTHROW +rxvt_term::scr_backspace () noexcept { if (screen.cur.col == 0) { @@ -1072,7 +1075,7 @@ * XTERM_SEQ: CTRL-I */ void -rxvt_term::scr_tab (int count, bool ht) NOTHROW +rxvt_term::scr_tab (int count, bool ht) noexcept { int i, x; @@ -1149,7 +1152,7 @@ */ #if !ENABLE_MINIMAL void ecb_cold -rxvt_term::scr_backindex () NOTHROW +rxvt_term::scr_backindex () noexcept { if (screen.cur.col > 0) scr_gotorc (0, -1, R_RELATIVE | C_RELATIVE); @@ -1166,7 +1169,7 @@ */ #if !ENABLE_MINIMAL void ecb_cold -rxvt_term::scr_forwardindex () NOTHROW +rxvt_term::scr_forwardindex () noexcept { if (screen.cur.col < ncol - 1) scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); @@ -1189,7 +1192,7 @@ * Goto Row/Column */ void -rxvt_term::scr_gotorc (int row, int col, int relative) NOTHROW +rxvt_term::scr_gotorc (int row, int col, int relative) noexcept { want_refresh = 1; ZERO_SCROLLBACK (); @@ -1238,22 +1241,18 @@ * direction should be UP or DN */ void -rxvt_term::scr_index (enum page_dirn direction) NOTHROW +rxvt_term::scr_index (enum page_dirn direction) noexcept { - int dirn; - want_refresh = 1; ZERO_SCROLLBACK (); - dirn = ((direction == UP) ? 1 : -1); - screen.flags &= ~Screen_WrapNext; if ((screen.cur.row == screen.bscroll && direction == UP) || (screen.cur.row == screen.tscroll && direction == DN)) - scr_scroll_text (screen.tscroll, screen.bscroll, dirn); + scr_scroll_text (screen.tscroll, screen.bscroll, direction); else - screen.cur.row += dirn; + screen.cur.row += direction; clamp_it (screen.cur.row, 0, nrow - 1); selection_check (0); @@ -1268,7 +1267,7 @@ * extension: clear to right unless wrapped: ESC [ 3 K */ void -rxvt_term::scr_erase_line (int mode) NOTHROW +rxvt_term::scr_erase_line (int mode) noexcept { unsigned int col, num; @@ -1332,7 +1331,7 @@ * XTERM_SEQ: Clear whole screen : ESC [ 2 J */ void -rxvt_term::scr_erase_screen (int mode) NOTHROW +rxvt_term::scr_erase_screen (int mode) noexcept { int num; int32_t row; @@ -1412,7 +1411,7 @@ #if !ENABLE_MINIMAL void -rxvt_term::scr_erase_savelines () NOTHROW +rxvt_term::scr_erase_savelines () noexcept { want_refresh = 1; ZERO_SCROLLBACK (); @@ -1427,7 +1426,7 @@ * XTERM_SEQ: Screen Alignment Test: ESC # 8 */ void ecb_cold -rxvt_term::scr_E () NOTHROW +rxvt_term::scr_E () noexcept { rend_t fs; @@ -1462,7 +1461,7 @@ * Insert/Delete lines */ void -rxvt_term::scr_insdel_lines (int count, int insdel) NOTHROW +rxvt_term::scr_insdel_lines (int count, int insdel) noexcept { int end; @@ -1492,7 +1491,7 @@ * Insert/Delete characters from the current position */ void -rxvt_term::scr_insdel_chars (int count, int insdel) NOTHROW +rxvt_term::scr_insdel_chars (int count, int insdel) noexcept { want_refresh = 1; ZERO_SCROLLBACK (); @@ -1601,7 +1600,7 @@ * XTERM_SEQ: Set region - inclusive: ESC [ ; r */ void ecb_cold -rxvt_term::scr_scroll_region (int top, int bot) NOTHROW +rxvt_term::scr_scroll_region (int top, int bot) noexcept { max_it (top, 0); min_it (bot, nrow - 1); @@ -1621,7 +1620,7 @@ * XTERM_SEQ: Make cursor invisible: ESC [ ? 25 l */ void ecb_cold -rxvt_term::scr_cursor_visible (int mode) NOTHROW +rxvt_term::scr_cursor_visible (int mode) noexcept { want_refresh = 1; @@ -1638,7 +1637,7 @@ * XTERM_SEQ: Unset Wraparound: ESC [ ? 7 l */ void ecb_cold -rxvt_term::scr_autowrap (int mode) NOTHROW +rxvt_term::scr_autowrap (int mode) noexcept { if (mode) screen.flags |= Screen_Autowrap; @@ -1657,7 +1656,7 @@ * XTERM_SEQ: Set Relative: ESC [ ? 6 l */ void ecb_cold -rxvt_term::scr_relative_origin (int mode) NOTHROW +rxvt_term::scr_relative_origin (int mode) noexcept { if (mode) screen.flags |= Screen_Relative; @@ -1674,7 +1673,7 @@ * XTERM_SEQ: Set Replace mode: ESC [ ? 4 l */ void ecb_cold -rxvt_term::scr_insert_mode (int mode) NOTHROW +rxvt_term::scr_insert_mode (int mode) noexcept { if (mode) screen.flags |= Screen_Insert; @@ -1690,7 +1689,7 @@ * XTERM_SEQ: Clear all tabs : ESC [ 3 g */ void ecb_cold -rxvt_term::scr_set_tab (int mode) NOTHROW +rxvt_term::scr_set_tab (int mode) noexcept { if (mode < 0) memset (tabs, 0, ncol); @@ -1705,7 +1704,7 @@ * XTERM_SEQ: Normal video : ESC [ ? 5 l */ void -rxvt_term::scr_rvideo_mode (bool on) NOTHROW +rxvt_term::scr_rvideo_mode (bool on) noexcept { rvideo_mode = on; @@ -1717,6 +1716,14 @@ { rvideo_state = on; +#if OFF_FOCUS_FADING + if (rs[Rs_fade]) + { + ::swap (pix_colors_focused[Color_fg], pix_colors_focused[Color_bg]); + ::swap (pix_colors_unfocused[Color_fg], pix_colors_unfocused[Color_bg]); + } + else +#endif ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); #ifdef HAVE_IMG if (bg_img == 0) @@ -1739,7 +1746,7 @@ * XTERM_SEQ: Report position: ESC [ 6 n */ void ecb_cold -rxvt_term::scr_report_position () NOTHROW +rxvt_term::scr_report_position () noexcept { tt_printf ("\033[%d;%dR", screen.cur.row + 1, screen.cur.col + 1); } @@ -1752,7 +1759,7 @@ * Set font style */ void ecb_cold -rxvt_term::set_font_style () NOTHROW +rxvt_term::set_font_style () noexcept { #if 0 switch (charsets [screen.charset]) @@ -1784,7 +1791,7 @@ * XTERM_SEQ: Invoke G3 character set: ESC O */ void ecb_cold -rxvt_term::scr_charset_choose (int set) NOTHROW +rxvt_term::scr_charset_choose (int set) noexcept { screen.charset = set; set_font_style (); @@ -1800,7 +1807,7 @@ * See set_font_style for possible values for */ void -rxvt_term::scr_charset_set (int set, unsigned int ch) NOTHROW +rxvt_term::scr_charset_set (int set, unsigned int ch) noexcept { charsets[set] = (unsigned char)ch; set_font_style (); @@ -1815,7 +1822,7 @@ * refresh matching text. */ bool ecb_cold -rxvt_term::scr_refresh_rend (rend_t mask, rend_t value) NOTHROW +rxvt_term::scr_refresh_rend (rend_t mask, rend_t value) noexcept { bool found = false; @@ -1844,7 +1851,7 @@ }; void ecb_hot -rxvt_term::scr_expose (int x, int y, int ewidth, int eheight, bool refresh) NOTHROW +rxvt_term::scr_expose (int x, int y, int ewidth, int eheight, bool refresh) noexcept { int i; row_col_t rc[RC_COUNT]; @@ -1888,7 +1895,7 @@ * Refresh the entire screen */ void -rxvt_term::scr_touch (bool refresh) NOTHROW +rxvt_term::scr_touch (bool refresh) noexcept { scr_expose (0, 0, vt_width, vt_height, refresh); } @@ -1899,9 +1906,10 @@ * the top of the screen */ void -rxvt_term::scr_move_to (int y, int len) NOTHROW +rxvt_term::scr_move_to (int y, int len) noexcept { - scr_changeview ((top_row - nrow) * (len - y) / len + (nrow - 1)); + // lerp (y, 0, len, top_row, nrow - 1) + scr_changeview (top_row + (nrow - 1 - top_row) * y / len); } /* ------------------------------------------------------------------------- */ @@ -1910,17 +1918,13 @@ * direction should be UP or DN */ bool -rxvt_term::scr_page (enum page_dirn direction, int nlines) NOTHROW +rxvt_term::scr_page (int nlines) noexcept { - int new_view_start = - direction == UP ? view_start - nlines - : view_start + nlines; - - return scr_changeview (new_view_start); + return scr_changeview (view_start - nlines); } bool -rxvt_term::scr_changeview (int new_view_start) NOTHROW +rxvt_term::scr_changeview (int new_view_start) noexcept { clamp_it (new_view_start, top_row, 0); @@ -1948,7 +1952,7 @@ /* ------------------------------------------------------------------------- */ void -rxvt_term::scr_bell () NOTHROW +rxvt_term::scr_bell () noexcept { #ifndef NO_BELL @@ -1980,7 +1984,7 @@ /* ------------------------------------------------------------------------- */ void ecb_cold -rxvt_term::scr_printscreen (int fullhist) NOTHROW +rxvt_term::scr_printscreen (int fullhist) noexcept { #ifdef PRINTPIPE int nrows, row_start; @@ -2039,7 +2043,7 @@ * screen.text/screen.rend contain what the screen will change to. */ void ecb_hot -rxvt_term::scr_refresh () NOTHROW +rxvt_term::scr_refresh () noexcept { int16_t col, row, /* column/row we're processing */ ocrow; /* old cursor row */ @@ -2048,6 +2052,7 @@ ccol2; /* Cursor colour2 */ rend_t cur_rend; int cur_col; + int cursorwidth; want_refresh = 0; /* screen is current */ @@ -2082,8 +2087,6 @@ * C: set the cursor character (s) */ { - bool setoldcursor; - #ifdef CURSOR_BLINK if (hidden_cursor) showcursor = 0; @@ -2096,6 +2099,11 @@ while (col && ROW(screen.cur.row).t[col] == NOCHAR) col--; + cursorwidth = 1; + while (col + cursorwidth < ncol + && ROW(screen.cur.row).t[col + cursorwidth] == NOCHAR) + cursorwidth++; + cur_rend = ROW(screen.cur.row).r[col]; cur_col = col; @@ -2121,53 +2129,33 @@ ccol2 = Color_bg; #endif - if (focus) + if (focus && cursor_type == 0) { rend_t rend = cur_rend; - if (option (Opt_cursorUnderline)) - rend ^= RS_Uline; - else - { - rend ^= RS_RVid; - rend = SET_FGCOLOR (rend, ccol1); - rend = SET_BGCOLOR (rend, ccol2); - } + rend ^= RS_RVid; + rend = SET_FGCOLOR (rend, ccol1); + rend = SET_BGCOLOR (rend, ccol2); scr_set_char_rend (ROW(screen.cur.row), cur_col, rend); } } /* make sure no outline cursor is left around */ - setoldcursor = 0; - if (ocrow != -1) - { - if (screen.cur.row - view_start != ocrow - || screen.cur.col != oldcursor.col) - { - if (ocrow < nrow - && oldcursor.col < ncol) - drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); + if (ocrow != -1 && ocrow < nrow && oldcursor.col < ncol) + drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); - if (focus || !showcursor) - oldcursor.row = -1; - else - setoldcursor = 1; - } - } - else if (!focus) - setoldcursor = 1; - - if (setoldcursor) + // save the current cursor coordinates if the cursor is visible + // and either the window is unfocused or the cursor style is + // underline or vertical bar, so as to clear the outline cursor in + // the next refresh if the cursor moves or becomes invisible + if (showcursor && (!focus || cursor_type != 0) && screen.cur.row - view_start < nrow) { - if (screen.cur.row - view_start >= nrow) - oldcursor.row = -1; - else - { - oldcursor.row = screen.cur.row - view_start; - oldcursor.col = screen.cur.col; - } + oldcursor.row = screen.cur.row - view_start; + oldcursor.col = screen.cur.col; } + else + oldcursor.row = -1; } #ifndef NO_SLOW_LINK_SUPPORT @@ -2258,10 +2246,7 @@ for (col = 0; col < ncol; col++) { /* compare new text with old - if exactly the same then continue */ - if (stp[col] == dtp[col] /* Must match characters to skip. */ - && (RS_SAME (srp[col], drp[col]) /* Either rendition the same or */ - || (stp[col] == ' ' /* space w/ no background change */ - && GET_BGATTR (srp[col]) == GET_BGATTR (drp[col])))) + if (stp[col] == dtp[col] && RS_SAME (srp[col], drp[col])) continue; // redraw one or more characters @@ -2443,6 +2428,10 @@ if (ecb_unlikely (rend & RS_Uline && font->descent > 1 && fore != back)) { + if (showcursor && focus && row == screen.cur.row + && IN_RANGE_EXC (col, cur_col, cur_col + cursorwidth)) + XSetForeground (dpy, gc, pix_colors[ccol1]); + else #if ENABLE_FRILLS if (ISSET_PIXCOLOR (Color_underline)) XSetForeground (dpy, gc, pix_colors[Color_underline]); @@ -2463,28 +2452,32 @@ if (showcursor) { if (focus) - scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); + { + if (cursor_type == 0) + scr_set_char_rend (ROW(screen.cur.row), cur_col, cur_rend); + else if (oldcursor.row >= 0) + { + XSetForeground (dpy, gc, pix_colors[ccol1]); + if (cursor_type == 1) + XFillRectangle (dpy, vt, gc, + Col2Pixel (cur_col), + Row2Pixel (oldcursor.row + 1) - 2, + Width2Pixel (1), + 2); + else + XFillRectangle (dpy, vt, gc, + Col2Pixel (cur_col), + Row2Pixel (oldcursor.row), + 2, + Height2Pixel (1)); + } + } else if (oldcursor.row >= 0) { - int cursorwidth = 1; - int col = oldcursor.col; - - while (col && ROW(screen.cur.row).t[col] == NOCHAR) - col--; - - while (col + cursorwidth < ncol - && drawn_buf[oldcursor.row].t[col + cursorwidth] == NOCHAR) - cursorwidth++; - -#ifndef NO_CURSORCOLOR - if (ISSET_PIXCOLOR (Color_cursor)) - XSetForeground (dpy, gc, pix_colors[Color_cursor]); - else -#endif - XSetForeground (dpy, gc, pix_colors[ccol1]); + XSetForeground (dpy, gc, pix_colors[ccol1]); XDrawRectangle (dpy, vt, gc, - Col2Pixel (col), + Col2Pixel (cur_col), Row2Pixel (oldcursor.row), (unsigned int) (Width2Pixel (cursorwidth) - 1), (unsigned int) (Height2Pixel (1) - 1)); @@ -2507,7 +2500,7 @@ } void ecb_cold -rxvt_term::scr_remap_chars (line_t &l) NOTHROW +rxvt_term::scr_remap_chars (line_t &l) noexcept { if (!l.valid ()) return; @@ -2519,7 +2512,7 @@ } void ecb_cold -rxvt_term::scr_remap_chars () NOTHROW +rxvt_term::scr_remap_chars () noexcept { for (int i = total_rows; i--; ) scr_remap_chars (row_buf [i]); @@ -2532,7 +2525,7 @@ } void ecb_cold -rxvt_term::scr_recolour (bool refresh) NOTHROW +rxvt_term::scr_recolor (bool refresh) noexcept { bool transparent = false; @@ -2563,7 +2556,7 @@ XClearWindow (dpy, parent); - if (scrollBar.win) + if (scrollBar.state && scrollBar.win) { if (transparent) XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); @@ -2583,7 +2576,7 @@ /* ------------------------------------------------------------------------- */ void -rxvt_term::scr_clear (bool really) NOTHROW +rxvt_term::scr_clear (bool really) noexcept { if (!mapped) return; @@ -2596,7 +2589,7 @@ } void -rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2) NOTHROW +rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2) noexcept { int view_end = view_start + nrow; int row, col; @@ -2618,7 +2611,7 @@ } void -rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle) NOTHROW +rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle) noexcept { int view_end = view_start + nrow; int row, col; @@ -2645,7 +2638,7 @@ /* ------------------------------------------------------------------------- */ void ecb_hot -rxvt_term::scr_reverse_selection () NOTHROW +rxvt_term::scr_reverse_selection () noexcept { if (selection.op && current_screen == selection.screen @@ -2671,7 +2664,7 @@ */ #if 0 void -rxvt_term::scr_dump (int fd) NOTHROW +rxvt_term::scr_dump (int fd) noexcept { // if this method is needed, it can be implemented by factoring the // relevant code in scr_printscreen @@ -2682,7 +2675,7 @@ * CHARACTER SELECTION * * ------------------------------------------------------------------------- */ void -rxvt_term::selection_check (int check_more) NOTHROW +rxvt_term::selection_check (int check_more) noexcept { if (!selection.op) return; @@ -2698,11 +2691,11 @@ } void -rxvt_term::selection_changed () NOTHROW +rxvt_term::selection_changed () noexcept { line_t &r1 = ROW (selection.beg.row); - while (selection.beg.col > 0 && r1.t [selection.beg.col] == NOCHAR) - --selection.beg.col; + while (selection.beg.col < r1.l && r1.t [selection.beg.col] == NOCHAR) + ++selection.beg.col; line_t &r2 = ROW (selection.end.row); while (selection.end.col < r2.l && r2.t [selection.end.col] == NOCHAR) @@ -2716,7 +2709,7 @@ * Paste a selection direct to the command fd */ void -rxvt_term::tt_paste (char *data, unsigned int len) NOTHROW +rxvt_term::tt_paste (char *data, unsigned int len) noexcept { /* convert normal newline chars into common keyboard Return key sequence */ for (unsigned int i = 0; i < len; i++) @@ -2733,7 +2726,7 @@ } void -rxvt_term::paste (char *data, unsigned int len) NOTHROW +rxvt_term::paste (char *data, unsigned int len) noexcept { if (HOOK_INVOKE ((this, HOOK_TT_PASTE, DT_STR_LEN, data, len, DT_END))) return; @@ -2749,7 +2742,7 @@ * EXT: button 2 release */ void -rxvt_term::selection_request (Time tm, int selnum) NOTHROW +rxvt_term::selection_request (Time tm, int selnum) noexcept { if (!selection_req) { @@ -2764,7 +2757,7 @@ * EXT: SelectionClear */ void -rxvt_term::selection_clear (bool clipboard) NOTHROW +rxvt_term::selection_clear (bool clipboard) noexcept { if (!clipboard) { @@ -2916,7 +2909,7 @@ } bool -rxvt_term::selection_grab (Time tm, bool clipboard) NOTHROW +rxvt_term::selection_grab (Time tm, bool clipboard) noexcept { Atom sel; @@ -2960,7 +2953,7 @@ * EXT: button 1 press */ void ecb_cold -rxvt_term::selection_click (int clicks, int x, int y) NOTHROW +rxvt_term::selection_click (int clicks, int x, int y) noexcept { clicks = ((clicks - 1) % 3) + 1; selection.clicks = clicks; /* save clicks so extend will work */ @@ -2989,7 +2982,7 @@ * Mark a selection at the specified col/row */ void ecb_cold -rxvt_term::selection_start_colrow (int col, int row) NOTHROW +rxvt_term::selection_start_colrow (int col, int row) noexcept { want_refresh = 1; @@ -3026,7 +3019,7 @@ #define DELIMIT_REND(x) 1 void ecb_cold -rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) NOTHROW +rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) noexcept { int col, row, dirnadd, tcol, trow, w1, w2; row_col_t bound; @@ -3110,7 +3103,7 @@ * flag == 2 ==> button 3 motion */ void ecb_cold -rxvt_term::selection_extend (int x, int y, int flag) NOTHROW +rxvt_term::selection_extend (int x, int y, int flag) noexcept { int col = clamp (Pixel2Col (x), 0, ncol); int row = clamp (Pixel2Row (y), 0, nrow - 1); @@ -3146,7 +3139,7 @@ * Extend the selection to the specified col/row */ void ecb_cold -rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int buttonpress, int clickchange) NOTHROW +rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int buttonpress, int clickchange) noexcept { row_col_t pos; enum { @@ -3347,7 +3340,7 @@ #if !ENABLE_MINIMAL void ecb_cold -rxvt_term::selection_remove_trailing_spaces () NOTHROW +rxvt_term::selection_remove_trailing_spaces () noexcept { int32_t end_col, end_row; text_t *stp; @@ -3395,7 +3388,7 @@ * EXT: button 3 double click */ void ecb_cold -rxvt_term::selection_rotate (int x, int y) NOTHROW +rxvt_term::selection_rotate (int x, int y) noexcept { selection.clicks = selection.clicks % 3 + 1; selection_extend_colrow (Pixel2Col (x), Pixel2Row (y), 1, 0, 1); @@ -3407,7 +3400,7 @@ * EXT: SelectionRequest */ void ecb_cold -rxvt_term::selection_send (const XSelectionRequestEvent &rq) NOTHROW +rxvt_term::selection_send (const XSelectionRequestEvent &rq) noexcept { Atom property = rq.property == None ? rq.target : rq.property; XSelectionEvent ev; @@ -3509,7 +3502,7 @@ } else { - cl = L""; + cl = (wchar_t *)L""; selectlen = 0; } @@ -3551,7 +3544,7 @@ /* ------------------------------------------------------------------------- */ #if USE_XIM void ecb_cold -rxvt_term::im_set_position (XPoint &pos) NOTHROW +rxvt_term::im_set_position (XPoint &pos) noexcept { XWindowAttributes xwa; @@ -3564,7 +3557,7 @@ #if ENABLE_OVERLAY void -rxvt_term::scr_overlay_new (int x, int y, int w, int h) NOTHROW +rxvt_term::scr_overlay_new (int x, int y, int w, int h) noexcept { if (nrow < 1 || ncol < 1) return; @@ -3619,7 +3612,7 @@ } void -rxvt_term::scr_overlay_off () NOTHROW +rxvt_term::scr_overlay_off () noexcept { if (!ov.text) return; @@ -3637,7 +3630,7 @@ } void -rxvt_term::scr_overlay_set (int x, int y, text_t text, rend_t rend) NOTHROW +rxvt_term::scr_overlay_set (int x, int y, text_t text, rend_t rend) noexcept { if (!ov.text || x >= ov.w - 2 || y >= ov.h - 2) return; @@ -3649,14 +3642,14 @@ } void -rxvt_term::scr_overlay_set (int x, int y, const char *s) NOTHROW +rxvt_term::scr_overlay_set (int x, int y, const char *s) noexcept { while (*s) scr_overlay_set (x++, y, *s++); } void -rxvt_term::scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW +rxvt_term::scr_overlay_set (int x, int y, const wchar_t *s) noexcept { while (*s) { @@ -3672,7 +3665,7 @@ } void -rxvt_term::scr_swap_overlay () NOTHROW +rxvt_term::scr_swap_overlay () noexcept { if (!ov.text) return;