… | |
… | |
141 | || !IN_RANGE_EXC (y, 0, nrow)) |
141 | || !IN_RANGE_EXC (y, 0, nrow)) |
142 | return; |
142 | return; |
143 | |
143 | |
144 | for (;;) |
144 | for (;;) |
145 | { |
145 | { |
146 | const line_t &l = ROW(-view_start); |
146 | const line_t &l = ROW(y - view_start); |
147 | |
147 | |
148 | text_t t = l.t[x]; |
148 | text_t t = l.t[x]; |
149 | |
149 | |
150 | if (t != NOCHAR || !x) |
150 | if (t != NOCHAR || !x) |
151 | { |
151 | { |
152 | iso14755_51 (l.t[x], l.r[x]); |
152 | iso14755_51 (l.t[x], l.r[x], x, y); |
153 | iso14755buf = ISO_14755_54; |
153 | iso14755buf = ISO_14755_54; |
154 | break; |
154 | break; |
155 | } |
155 | } |
156 | |
156 | |
157 | x--; |
157 | x--; |
158 | } |
158 | } |
159 | } |
159 | } |
160 | #endif |
160 | #endif |
161 | |
161 | |
|
|
162 | void |
|
|
163 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
|
|
164 | { |
162 | #if ENABLE_OVERLAY |
165 | #if ENABLE_OVERLAY |
163 | void |
|
|
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r) |
|
|
165 | { |
|
|
166 | rxvt_fontset *fs = FONTSET (r); |
166 | rxvt_fontset *fs = FONTSET (r); |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
169 | int len; |
169 | int len; |
170 | |
170 | |
171 | fname = rxvt_utf8towcs (f->name); |
171 | fname = rxvt_utf8towcs (f->name); |
172 | |
172 | |
173 | #if ENABLE_COMBINING |
173 | # if ENABLE_COMBINING |
174 | if (IS_COMPOSE (ch)) |
174 | if (IS_COMPOSE (ch)) |
175 | { |
175 | { |
176 | len = rxvt_composite.expand (ch, 0); |
176 | len = rxvt_composite.expand (ch, 0); |
177 | alloc = chr = new wchar_t[len]; |
177 | alloc = chr = new wchar_t[len]; |
178 | rxvt_composite.expand (ch, chr); |
178 | rxvt_composite.expand (ch, chr); |
179 | } |
179 | } |
180 | else |
180 | else |
181 | #endif |
181 | # endif |
182 | { |
182 | { |
183 | ch2 = ch; |
183 | ch2 = ch; |
184 | |
184 | |
185 | alloc = 0; |
185 | alloc = 0; |
186 | chr = &ch2; |
186 | chr = &ch2; |
187 | len = 1; |
187 | len = 1; |
188 | } |
188 | } |
189 | |
189 | |
|
|
190 | char attr[80]; // plenty |
|
|
191 | |
|
|
192 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
|
|
193 | (int)r, |
|
|
194 | GET_FGCOLOR (r), GET_BGCOLOR (r), |
|
|
195 | r & RS_Bold ? " bold" : "", |
|
|
196 | r & RS_Italic ? " italic" : "", |
|
|
197 | r & RS_Blink ? " blink" : "", |
|
|
198 | r & RS_RVid ? " rvid" : "", |
|
|
199 | r & RS_Uline ? " uline" : "", |
|
|
200 | r & RS_Careful ? " careful" : ""); |
|
|
201 | |
190 | int width = wcswidth (fname, wcslen (fname)); |
202 | int width = wcswidth (fname, wcslen (fname)); |
191 | |
203 | |
192 | scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); |
204 | max_it (width, 8+5); // for char + hey |
|
|
205 | max_it (width, strlen (attr)); |
|
|
206 | |
|
|
207 | if (y >= 0) |
|
|
208 | { |
|
|
209 | y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; |
|
|
210 | x = 0; |
|
|
211 | } |
|
|
212 | |
|
|
213 | scr_overlay_new (x, y, width, len + 2); |
193 | |
214 | |
194 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
215 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
195 | |
216 | |
196 | for (int y = 0; y < len; y++) |
217 | for (int y = 0; y < len; y++) |
197 | { |
218 | { |
… | |
… | |
200 | ch = *chr++; |
221 | ch = *chr++; |
201 | |
222 | |
202 | sprintf (buf, "%8x", ch); |
223 | sprintf (buf, "%8x", ch); |
203 | scr_overlay_set (0, y, buf); |
224 | scr_overlay_set (0, y, buf); |
204 | scr_overlay_set (9, y, '='); |
225 | scr_overlay_set (9, y, '='); |
205 | #if !UNICODE3 |
226 | # if !UNICODE3 |
206 | if (ch >= 0x10000) |
227 | if (ch >= 0x10000) |
207 | ch = 0xfffd; |
228 | ch = 0xfffd; |
208 | #endif |
229 | # endif |
209 | scr_overlay_set (11, y, ch, r); |
230 | scr_overlay_set (11, y, ch, r); |
210 | scr_overlay_set (12, y, NOCHAR, r); |
231 | scr_overlay_set (12, y, NOCHAR, r); |
211 | } |
232 | } |
212 | |
233 | |
|
|
234 | scr_overlay_set (0, len , attr); |
213 | scr_overlay_set (0, len, fname); |
235 | scr_overlay_set (0, len + 1, fname); |
214 | |
236 | |
215 | free (fname); |
237 | free (fname); |
216 | |
238 | |
217 | #if ENABLE_COMBINING |
239 | # if ENABLE_COMBINING |
218 | if (alloc) |
240 | if (alloc) |
219 | delete [] alloc; |
241 | delete [] alloc; |
220 | #endif |
242 | # endif |
221 | } |
|
|
222 | #endif |
243 | #endif |
|
|
244 | } |
223 | |
245 | |
224 | void |
246 | void |
225 | rxvt_term::commit_iso14755 () |
247 | rxvt_term::commit_iso14755 () |
226 | { |
248 | { |
227 | wchar_t ch[2]; |
249 | wchar_t ch[2]; |
… | |
… | |
1067 | if (n > 0) |
1089 | if (n > 0) |
1068 | { |
1090 | { |
1069 | cmdbuf_endp += n; |
1091 | cmdbuf_endp += n; |
1070 | return true; |
1092 | return true; |
1071 | } |
1093 | } |
1072 | else if (n < 0 && errno != EAGAIN) |
1094 | else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) |
|
|
1095 | { |
|
|
1096 | pty_ev.stop (); |
|
|
1097 | |
|
|
1098 | if (!(options & Opt_hold)) |
1073 | destroy (); |
1099 | destroy (); |
|
|
1100 | } |
1074 | |
1101 | |
1075 | return false; |
1102 | return false; |
1076 | } |
1103 | } |
1077 | |
1104 | |
1078 | void |
1105 | void |
… | |
… | |
1600 | } |
1627 | } |
1601 | |
1628 | |
1602 | scroll_selection_lines = Pixel2Height (dist) |
1629 | scroll_selection_lines = Pixel2Height (dist) |
1603 | / SELECTION_SCROLL_LINE_SPEEDUP |
1630 | / SELECTION_SCROLL_LINE_SPEEDUP |
1604 | + 1; |
1631 | + 1; |
1605 | MIN_IT (scroll_selection_lines, |
1632 | min_it (scroll_selection_lines, |
1606 | SELECTION_SCROLL_MAX_LINES); |
1633 | SELECTION_SCROLL_MAX_LINES); |
1607 | } |
1634 | } |
1608 | else |
1635 | else |
1609 | { |
1636 | { |
1610 | /* we are within the text window, so we |
1637 | /* we are within the text window, so we |
… | |
… | |
2451 | nh += sy; |
2478 | nh += sy; |
2452 | ny = -sy; |
2479 | ny = -sy; |
2453 | sy = 0; |
2480 | sy = 0; |
2454 | } |
2481 | } |
2455 | |
2482 | |
2456 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
2483 | min_it (nw, (unsigned int) (wrootattr.width - sx)); |
2457 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
2484 | min_it (nh, (unsigned int) (wrootattr.height - sy)); |
2458 | |
2485 | |
2459 | XSync (disp, False); |
2486 | XSync (disp, False); |
2460 | allowedxerror = -1; |
2487 | allowedxerror = -1; |
2461 | image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2488 | image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2462 | |
2489 | |
… | |
… | |
4372 | } |
4399 | } |
4373 | |
4400 | |
4374 | memmove (v_buffer, v_buffer + written, v_buflen); |
4401 | memmove (v_buffer, v_buffer + written, v_buflen); |
4375 | } |
4402 | } |
4376 | else if (written != -1 || (errno != EAGAIN && errno != EINTR)) |
4403 | else if (written != -1 || (errno != EAGAIN && errno != EINTR)) |
4377 | // original code just ignores this... |
4404 | pty_ev.set (EVENT_READ); |
4378 | destroy (); |
|
|
4379 | } |
4405 | } |
4380 | |
4406 | |
4381 | /*----------------------- end-of-file (C source) -----------------------*/ |
4407 | /*----------------------- end-of-file (C source) -----------------------*/ |
4382 | |
4408 | |