… | |
… | |
162 | |
162 | |
163 | void |
163 | void |
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
165 | { |
165 | { |
166 | rxvt_fontset *fs = FONTSET (r); |
166 | rxvt_fontset *fs = FONTSET (r); |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
|
|
168 | wchar_t *chr, *alloc, ch2, *fname; |
167 | wchar_t *chr, *alloc, ch2, **fname; |
169 | int len; |
168 | int len; |
170 | |
|
|
171 | fname = rxvt_utf8towcs (f->name); |
|
|
172 | |
169 | |
173 | # if ENABLE_COMBINING |
170 | # if ENABLE_COMBINING |
174 | if (IS_COMPOSE (ch)) |
171 | if (IS_COMPOSE (ch)) |
175 | { |
172 | { |
176 | len = rxvt_composite.expand (ch, 0); |
173 | len = rxvt_composite.expand (ch, 0); |
… | |
… | |
197 | r & RS_Blink ? " blink" : "", |
194 | r & RS_Blink ? " blink" : "", |
198 | r & RS_RVid ? " rvid" : "", |
195 | r & RS_RVid ? " rvid" : "", |
199 | r & RS_Uline ? " uline" : "", |
196 | r & RS_Uline ? " uline" : "", |
200 | r & RS_Careful ? " careful" : ""); |
197 | r & RS_Careful ? " careful" : ""); |
201 | |
198 | |
|
|
199 | int width = 0; |
|
|
200 | fname = rxvt_temp_buf<wchar_t *> (len); |
|
|
201 | for (int i = 0; i < len; i++) |
|
|
202 | { |
|
|
203 | rxvt_font *f = (*fs)[fs->find_font (chr[i])]; |
|
|
204 | fname[i] = rxvt_utf8towcs (f->name); |
202 | int width = wcswidth (fname, wcslen (fname)); |
205 | max_it (width, wcswidth (fname[i], wcslen (fname[i]))); |
|
|
206 | } |
203 | |
207 | |
204 | max_it (width, 8+5); // for char + hex |
208 | max_it (width, 8+5); // for char + hex |
205 | max_it (width, strlen (attr)); |
209 | max_it (width, strlen (attr)); |
206 | |
210 | |
207 | if (y >= 0) |
211 | if (y >= 0) |
208 | { |
212 | { |
209 | y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; |
213 | y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; |
210 | x = 0; |
214 | x = 0; |
211 | } |
215 | } |
212 | |
216 | |
213 | scr_overlay_new (x, y, width, len + 2); |
217 | scr_overlay_new (x, y, width, len * 2 + 1); |
214 | |
218 | |
215 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
219 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
216 | |
220 | |
217 | for (int y = 0; y < len; y++) |
221 | for (int y = 0; y < len; y++) |
218 | { |
222 | { |
… | |
… | |
237 | // char buf[4+4+3+1]; |
241 | // char buf[4+4+3+1]; |
238 | // snprintf (buf, sizeof (buf), "(%.4d|%.4d)", x, y); |
242 | // snprintf (buf, sizeof (buf), "(%.4d|%.4d)", x, y); |
239 | // scr_overlay_set (0, 0, buf); |
243 | // scr_overlay_set (0, 0, buf); |
240 | // } |
244 | // } |
241 | scr_overlay_set (0, len , attr); |
245 | scr_overlay_set (0, len , attr); |
|
|
246 | for (int i = 0; i < len; i++) |
|
|
247 | { |
242 | scr_overlay_set (0, len + 1, fname); |
248 | scr_overlay_set (0, len + 1 + i, fname[i]); |
243 | |
|
|
244 | free (fname); |
249 | free (fname[i]); |
|
|
250 | } |
245 | |
251 | |
246 | # if ENABLE_COMBINING |
252 | # if ENABLE_COMBINING |
247 | if (alloc) |
253 | if (alloc) |
248 | delete [] alloc; |
254 | delete [] alloc; |
249 | # endif |
255 | # endif |
… | |
… | |
282 | } |
288 | } |
283 | |
289 | |
284 | static int |
290 | static int |
285 | hex_keyval (XKeyEvent &ev) |
291 | hex_keyval (XKeyEvent &ev) |
286 | { |
292 | { |
287 | // check wether this event corresponds to a hex digit |
293 | // check whether this event corresponds to a hex digit |
288 | // if the modifiers had not been pressed. |
294 | // if the modifiers had not been pressed. |
289 | for (int index = 0; index < 8; index++) |
295 | for (int index = 0; index < 8; index++) |
290 | { |
296 | { |
291 | KeySym k = XLookupKeysym (&ev, index); |
297 | KeySym k = XLookupKeysym (&ev, index); |
292 | |
298 | |
… | |
… | |
505 | #ifdef PAGING_CONTEXT_LINES |
511 | #ifdef PAGING_CONTEXT_LINES |
506 | lnsppg = nrow - PAGING_CONTEXT_LINES; |
512 | lnsppg = nrow - PAGING_CONTEXT_LINES; |
507 | #else |
513 | #else |
508 | lnsppg = nrow * 4 / 5; |
514 | lnsppg = nrow * 4 / 5; |
509 | #endif |
515 | #endif |
|
|
516 | max_it (lnsppg, 1); |
|
|
517 | |
510 | if (keysym == XK_Prior) |
518 | if (keysym == XK_Prior) |
511 | { |
519 | { |
512 | scr_page (UP, lnsppg); |
520 | scr_page (UP, lnsppg); |
513 | return; |
521 | return; |
514 | } |
522 | } |
… | |
… | |
1025 | } |
1033 | } |
1026 | |
1034 | |
1027 | display->flush (); |
1035 | display->flush (); |
1028 | } |
1036 | } |
1029 | |
1037 | |
1030 | /* checks wether a refresh is requested and starts the refresh timer */ |
1038 | /* checks whether a refresh is requested and starts the refresh timer */ |
1031 | void |
1039 | void |
1032 | rxvt_term::refresh_check () |
1040 | rxvt_term::refresh_check () |
1033 | { |
1041 | { |
1034 | if (want_refresh && !flush_ev.is_active ()) |
1042 | if (want_refresh && !flush_ev.is_active ()) |
1035 | flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally |
1043 | flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally |
… | |
… | |
1129 | // this should really be sched_yield(), but the linux guys thought |
1137 | // this should really be sched_yield(), but the linux guys thought |
1130 | // that giving a process calling sched_yield () less cpu time than |
1138 | // that giving a process calling sched_yield () less cpu time than |
1131 | // ones with high nice levels is a useful thing to do. It surely is is |
1139 | // ones with high nice levels is a useful thing to do. It surely is is |
1132 | // allowed by the sus... as is returning ENOSYS. |
1140 | // allowed by the sus... as is returning ENOSYS. |
1133 | // since the linux guys additionally thought that breaking the only |
1141 | // since the linux guys additionally thought that breaking the only |
1134 | // known workaroudn against their unusable sched_yield hack is cool, |
1142 | // known workaround against their unusable sched_yield hack is cool, |
1135 | // we just nanosleep a bit and hope for the best. |
1143 | // we just nanosleep a bit and hope for the best. |
1136 | |
1144 | |
1137 | struct timespec ts = { 0, 1000 }; |
1145 | struct timespec ts = { 0, 1000 }; |
1138 | nanosleep (&ts, 0); |
1146 | nanosleep (&ts, 0); |
1139 | |
1147 | |