… | |
… | |
268 | }; |
268 | }; |
269 | |
269 | |
270 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
270 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
271 | : THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), overlay_av (0) |
271 | : THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), overlay_av (0) |
272 | { |
272 | { |
|
|
273 | if (w < 0) w = 0; |
|
|
274 | if (h < 0) h = 0; |
|
|
275 | |
273 | if (border == 2) |
276 | if (border == 2) |
274 | { |
277 | { |
275 | w += 2; |
278 | w += 2; |
276 | h += 2; |
279 | h += 2; |
277 | } |
280 | } |
… | |
… | |
1119 | CODE: |
1122 | CODE: |
1120 | { |
1123 | { |
1121 | wchar_t *wstr = sv2wcs (str); |
1124 | wchar_t *wstr = sv2wcs (str); |
1122 | |
1125 | |
1123 | rxvt_push_locale (THIS->locale); |
1126 | rxvt_push_locale (THIS->locale); |
1124 | RETVAL = wcswidth (wstr, wcslen (wstr)); |
1127 | RETVAL = 0; |
|
|
1128 | for (wchar_t *wc = wstr; *wc; wc++) |
|
|
1129 | { |
|
|
1130 | int w = WCWIDTH (*wc); |
|
|
1131 | |
|
|
1132 | if (w) |
|
|
1133 | RETVAL += min (w, 1); |
|
|
1134 | } |
1125 | rxvt_pop_locale (); |
1135 | rxvt_pop_locale (); |
1126 | |
1136 | |
1127 | free (wstr); |
1137 | free (wstr); |
1128 | } |
1138 | } |
1129 | OUTPUT: |
1139 | OUTPUT: |
… | |
… | |
1159 | rxvt_pop_locale (); |
1169 | rxvt_pop_locale (); |
1160 | |
1170 | |
1161 | RETVAL = wcs2sv (wstr); |
1171 | RETVAL = wcs2sv (wstr); |
1162 | free (wstr); |
1172 | free (wstr); |
1163 | } |
1173 | } |
|
|
1174 | OUTPUT: |
|
|
1175 | RETVAL |
|
|
1176 | |
|
|
1177 | char * |
|
|
1178 | rxvt_term::locale () |
|
|
1179 | CODE: |
|
|
1180 | RETVAL = THIS->locale; |
1164 | OUTPUT: |
1181 | OUTPUT: |
1165 | RETVAL |
1182 | RETVAL |
1166 | |
1183 | |
1167 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1184 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1168 | |
1185 | |