… | |
… | |
135 | rxvt_term::iso14755_54 (int x, int y) |
135 | rxvt_term::iso14755_54 (int x, int y) |
136 | { |
136 | { |
137 | x = Pixel2Col (x); |
137 | x = Pixel2Col (x); |
138 | y = Pixel2Row (y); |
138 | y = Pixel2Row (y); |
139 | |
139 | |
140 | if (x < 0 || x >= ncol |
140 | if (!IN_RANGE_EXC (x, 0, ncol) |
141 | || y < 0 || y >= 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 = save[y + saveLines - 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 | |
|
|
160 | } |
159 | } |
161 | #endif |
160 | #endif |
162 | |
161 | |
|
|
162 | void |
|
|
163 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
|
|
164 | { |
163 | #if ENABLE_OVERLAY |
165 | #if ENABLE_OVERLAY |
164 | void |
|
|
165 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r) |
|
|
166 | { |
|
|
167 | rxvt_fontset *fs = FONTSET (r); |
166 | rxvt_fontset *fs = FONTSET (r); |
168 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
169 | wchar_t *chr, *alloc, ch2, *fname; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
170 | int len; |
169 | int len; |
171 | |
170 | |
172 | fname = rxvt_utf8towcs (f->name); |
171 | fname = rxvt_utf8towcs (f->name); |
173 | |
172 | |
174 | #if ENABLE_COMBINING |
173 | # if ENABLE_COMBINING |
175 | if (IS_COMPOSE (ch)) |
174 | if (IS_COMPOSE (ch)) |
176 | { |
175 | { |
177 | len = rxvt_composite.expand (ch, 0); |
176 | len = rxvt_composite.expand (ch, 0); |
178 | alloc = chr = new wchar_t[len]; |
177 | alloc = chr = new wchar_t[len]; |
179 | rxvt_composite.expand (ch, chr); |
178 | rxvt_composite.expand (ch, chr); |
180 | } |
179 | } |
181 | else |
180 | else |
182 | #endif |
181 | # endif |
183 | { |
182 | { |
184 | ch2 = ch; |
183 | ch2 = ch; |
185 | |
184 | |
186 | alloc = 0; |
185 | alloc = 0; |
187 | chr = &ch2; |
186 | chr = &ch2; |
188 | len = 1; |
187 | len = 1; |
189 | } |
188 | } |
190 | |
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 | fgcolor_of (r), bgcolor_of (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 | |
191 | int width = wcswidth (fname, wcslen (fname)); |
202 | int width = wcswidth (fname, wcslen (fname)); |
192 | |
203 | |
193 | 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); |
194 | |
214 | |
195 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
215 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
196 | |
216 | |
197 | for (int y = 0; y < len; y++) |
217 | for (int y = 0; y < len; y++) |
198 | { |
218 | { |
… | |
… | |
201 | ch = *chr++; |
221 | ch = *chr++; |
202 | |
222 | |
203 | sprintf (buf, "%8x", ch); |
223 | sprintf (buf, "%8x", ch); |
204 | scr_overlay_set (0, y, buf); |
224 | scr_overlay_set (0, y, buf); |
205 | scr_overlay_set (9, y, '='); |
225 | scr_overlay_set (9, y, '='); |
206 | #if !UNICODE3 |
226 | # if !UNICODE3 |
207 | if (ch >= 0x10000) |
227 | if (ch >= 0x10000) |
208 | ch = 0xfffd; |
228 | ch = 0xfffd; |
209 | #endif |
229 | # endif |
210 | scr_overlay_set (11, y, ch, r); |
230 | scr_overlay_set (11, y, ch, r); |
211 | scr_overlay_set (12, y, NOCHAR, r); |
231 | scr_overlay_set (12, y, NOCHAR, r); |
212 | } |
232 | } |
213 | |
233 | |
|
|
234 | scr_overlay_set (0, len , attr); |
214 | scr_overlay_set (0, len, fname); |
235 | scr_overlay_set (0, len + 1, fname); |
215 | |
236 | |
216 | free (fname); |
237 | free (fname); |
217 | |
238 | |
218 | #if ENABLE_COMBINING |
239 | # if ENABLE_COMBINING |
219 | if (alloc) |
240 | if (alloc) |
220 | delete [] alloc; |
241 | delete [] alloc; |
221 | #endif |
242 | # endif |
222 | } |
|
|
223 | #endif |
243 | #endif |
|
|
244 | } |
224 | |
245 | |
225 | void |
246 | void |
226 | rxvt_term::commit_iso14755 () |
247 | rxvt_term::commit_iso14755 () |
227 | { |
248 | { |
228 | wchar_t ch[2]; |
249 | wchar_t ch[2]; |
… | |
… | |
845 | } |
866 | } |
846 | |
867 | |
847 | if (len <= 0) |
868 | if (len <= 0) |
848 | return; /* not mapped */ |
869 | return; /* not mapped */ |
849 | |
870 | |
850 | if (options & Opt_scrollTtyKeypress) |
871 | if (OPTION (Opt_scrollTtyKeypress)) |
851 | if (view_start) |
872 | if (view_start) |
852 | { |
873 | { |
853 | view_start = 0; |
874 | view_start = 0; |
854 | want_refresh = 1; |
875 | want_refresh = 1; |
855 | } |
876 | } |
… | |
… | |
1068 | if (n > 0) |
1089 | if (n > 0) |
1069 | { |
1090 | { |
1070 | cmdbuf_endp += n; |
1091 | cmdbuf_endp += n; |
1071 | return true; |
1092 | return true; |
1072 | } |
1093 | } |
1073 | 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 (!OPTION (Opt_hold)) |
1074 | destroy (); |
1099 | destroy (); |
|
|
1100 | } |
1075 | |
1101 | |
1076 | return false; |
1102 | return false; |
1077 | } |
1103 | } |
1078 | |
1104 | |
1079 | void |
1105 | void |
… | |
… | |
1099 | recolour_cursor (); |
1125 | recolour_cursor (); |
1100 | |
1126 | |
1101 | #ifdef POINTER_BLANK |
1127 | #ifdef POINTER_BLANK |
1102 | hidden_pointer = 0; |
1128 | hidden_pointer = 0; |
1103 | |
1129 | |
1104 | if (options & Opt_pointerBlank) |
1130 | if (OPTION (Opt_pointerBlank)) |
1105 | pointer_ev.start (NOW + pointerBlankDelay); |
1131 | pointer_ev.start (NOW + pointerBlankDelay); |
1106 | #endif |
1132 | #endif |
1107 | } |
1133 | } |
1108 | |
1134 | |
1109 | #ifdef POINTER_BLANK |
1135 | #ifdef POINTER_BLANK |
1110 | void |
1136 | void |
1111 | rxvt_term::pointer_blank () |
1137 | rxvt_term::pointer_blank () |
1112 | { |
1138 | { |
1113 | if (! (options & Opt_pointerBlank)) |
1139 | if (! OPTION (Opt_pointerBlank)) |
1114 | return; |
1140 | return; |
1115 | |
1141 | |
1116 | XDefineCursor (display->display, vt, display->blank_cursor); |
1142 | XDefineCursor (display->display, vt, display->blank_cursor); |
1117 | XFlush (display->display); |
1143 | XFlush (display->display); |
1118 | |
1144 | |
… | |
… | |
1216 | |
1242 | |
1217 | SET_R (this); |
1243 | SET_R (this); |
1218 | SET_LOCALE (locale); |
1244 | SET_LOCALE (locale); |
1219 | |
1245 | |
1220 | #if defined(CURSOR_BLINK) |
1246 | #if defined(CURSOR_BLINK) |
1221 | if ((options & Opt_cursorBlink) && ev.type == KeyPress) |
1247 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1222 | { |
1248 | { |
1223 | if (hidden_cursor) |
1249 | if (hidden_cursor) |
1224 | { |
1250 | { |
1225 | hidden_cursor = 0; |
1251 | hidden_cursor = 0; |
1226 | want_refresh = 1; |
1252 | want_refresh = 1; |
… | |
… | |
1229 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1255 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1230 | } |
1256 | } |
1231 | #endif |
1257 | #endif |
1232 | |
1258 | |
1233 | #if defined(POINTER_BLANK) |
1259 | #if defined(POINTER_BLANK) |
1234 | if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) |
1260 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1235 | { |
1261 | { |
1236 | if (ev.type == MotionNotify |
1262 | if (ev.type == MotionNotify |
1237 | || ev.type == ButtonPress |
1263 | || ev.type == ButtonPress |
1238 | || ev.type == ButtonRelease) |
1264 | || ev.type == ButtonRelease) |
1239 | if (hidden_pointer) |
1265 | if (hidden_pointer) |
… | |
… | |
1435 | seen_resize = 1; |
1461 | seen_resize = 1; |
1436 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1462 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1437 | } |
1463 | } |
1438 | |
1464 | |
1439 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1465 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1440 | if (options & Opt_transparent) |
1466 | if (OPTION (Opt_transparent)) |
1441 | check_our_parents (); |
1467 | check_our_parents (); |
1442 | #endif |
1468 | #endif |
1443 | } |
1469 | } |
1444 | break; |
1470 | break; |
1445 | |
1471 | |
… | |
… | |
1601 | } |
1627 | } |
1602 | |
1628 | |
1603 | scroll_selection_lines = Pixel2Height (dist) |
1629 | scroll_selection_lines = Pixel2Height (dist) |
1604 | / SELECTION_SCROLL_LINE_SPEEDUP |
1630 | / SELECTION_SCROLL_LINE_SPEEDUP |
1605 | + 1; |
1631 | + 1; |
1606 | MIN_IT (scroll_selection_lines, |
1632 | min_it (scroll_selection_lines, |
1607 | SELECTION_SCROLL_MAX_LINES); |
1633 | SELECTION_SCROLL_MAX_LINES); |
1608 | } |
1634 | } |
1609 | else |
1635 | else |
1610 | { |
1636 | { |
1611 | /* we are within the text window, so we |
1637 | /* we are within the text window, so we |
… | |
… | |
1654 | IMSetStatusPosition (); |
1680 | IMSetStatusPosition (); |
1655 | XSetICFocus (Input_Context); |
1681 | XSetICFocus (Input_Context); |
1656 | } |
1682 | } |
1657 | #endif |
1683 | #endif |
1658 | #if CURSOR_BLINK |
1684 | #if CURSOR_BLINK |
1659 | if (options & Opt_cursorBlink) |
1685 | if (OPTION (Opt_cursorBlink)) |
1660 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1686 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1661 | #endif |
1687 | #endif |
1662 | #if OFF_FOCUS_FADING |
1688 | #if OFF_FOCUS_FADING |
1663 | if (rs[Rs_fade]) |
1689 | if (rs[Rs_fade]) |
1664 | { |
1690 | { |
… | |
… | |
1686 | #if USE_XIM |
1712 | #if USE_XIM |
1687 | if (Input_Context != NULL) |
1713 | if (Input_Context != NULL) |
1688 | XUnsetICFocus (Input_Context); |
1714 | XUnsetICFocus (Input_Context); |
1689 | #endif |
1715 | #endif |
1690 | #if CURSOR_BLINK |
1716 | #if CURSOR_BLINK |
1691 | if (options & Opt_cursorBlink) |
1717 | if (OPTION (Opt_cursorBlink)) |
1692 | cursor_blink_ev.stop (); |
1718 | cursor_blink_ev.stop (); |
1693 | hidden_cursor = 0; |
1719 | hidden_cursor = 0; |
1694 | #endif |
1720 | #endif |
1695 | #if OFF_FOCUS_FADING |
1721 | #if OFF_FOCUS_FADING |
1696 | if (rs[Rs_fade]) |
1722 | if (rs[Rs_fade]) |
… | |
… | |
1720 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1746 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1721 | return; |
1747 | return; |
1722 | |
1748 | |
1723 | /* FALLTHROUGH */ |
1749 | /* FALLTHROUGH */ |
1724 | case ReparentNotify: |
1750 | case ReparentNotify: |
1725 | if ((options & Opt_transparent) && check_our_parents () && am_transparent) |
1751 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1726 | want_refresh = want_full_refresh = 1; |
1752 | want_refresh = want_full_refresh = 1; |
1727 | break; |
1753 | break; |
1728 | } |
1754 | } |
1729 | } |
1755 | } |
1730 | #endif |
1756 | #endif |
… | |
… | |
2072 | |
2098 | |
2073 | v = ev.button == Button4 ? UP : DN; |
2099 | v = ev.button == Button4 ? UP : DN; |
2074 | |
2100 | |
2075 | if (ev.state & ShiftMask) |
2101 | if (ev.state & ShiftMask) |
2076 | i = 1; |
2102 | i = 1; |
2077 | else if (options & Opt_mouseWheelScrollPage) |
2103 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2078 | i = nrow - 1; |
2104 | i = nrow - 1; |
2079 | else |
2105 | else |
2080 | i = 5; |
2106 | i = 5; |
2081 | |
2107 | |
2082 | # ifdef MOUSE_SLIP_WHEELING |
2108 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2368 | XWindowAttributes wattr, wrootattr; |
2394 | XWindowAttributes wattr, wrootattr; |
2369 | dDisp; |
2395 | dDisp; |
2370 | |
2396 | |
2371 | pchanged = 0; |
2397 | pchanged = 0; |
2372 | |
2398 | |
2373 | if (!(options & Opt_transparent)) |
2399 | if (!OPTION (Opt_transparent)) |
2374 | return pchanged; /* Don't try any more */ |
2400 | return pchanged; /* Don't try any more */ |
2375 | |
2401 | |
2376 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2402 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2377 | rootdepth = wrootattr.depth; |
2403 | rootdepth = wrootattr.depth; |
2378 | |
2404 | |
… | |
… | |
2452 | nh += sy; |
2478 | nh += sy; |
2453 | ny = -sy; |
2479 | ny = -sy; |
2454 | sy = 0; |
2480 | sy = 0; |
2455 | } |
2481 | } |
2456 | |
2482 | |
2457 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
2483 | min_it (nw, (unsigned int) (wrootattr.width - sx)); |
2458 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
2484 | min_it (nh, (unsigned int) (wrootattr.height - sy)); |
2459 | |
2485 | |
2460 | XSync (disp, False); |
2486 | XSync (disp, False); |
2461 | allowedxerror = -1; |
2487 | allowedxerror = -1; |
2462 | image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2488 | image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2463 | |
2489 | |
… | |
… | |
2656 | if (ch == C0_LF) |
2682 | if (ch == C0_LF) |
2657 | nlines++; |
2683 | nlines++; |
2658 | |
2684 | |
2659 | refresh_count++; |
2685 | refresh_count++; |
2660 | |
2686 | |
2661 | if (!(options & Opt_jumpScroll) |
2687 | if (!OPTION (Opt_jumpScroll) |
2662 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2688 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2663 | { |
2689 | { |
2664 | refreshnow = true; |
2690 | refreshnow = true; |
2665 | ch = NOCHAR; |
2691 | ch = NOCHAR; |
2666 | break; |
2692 | break; |
… | |
… | |
2700 | * the number of pages between refreshes is refresh_limit, which |
2726 | * the number of pages between refreshes is refresh_limit, which |
2701 | * is incremented here because we must be doing flat-out scrolling. |
2727 | * is incremented here because we must be doing flat-out scrolling. |
2702 | */ |
2728 | */ |
2703 | if (refreshnow) |
2729 | if (refreshnow) |
2704 | { |
2730 | { |
2705 | if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2731 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2706 | refresh_limit++; |
2732 | refresh_limit++; |
2707 | else |
2733 | else |
2708 | { |
2734 | { |
2709 | flag = true; |
2735 | flag = true; |
2710 | scr_refresh (refresh_type); |
2736 | scr_refresh (refresh_type); |
… | |
… | |
3352 | |
3378 | |
3353 | case CSI_SD: /* 8.3.114: (1) SCROLL DOWN */ |
3379 | case CSI_SD: /* 8.3.114: (1) SCROLL DOWN */ |
3354 | arg[0] = -arg[0]; |
3380 | arg[0] = -arg[0]; |
3355 | /* FALLTHROUGH */ |
3381 | /* FALLTHROUGH */ |
3356 | case CSI_SU: /* 8.3.148: (1) SCROLL UP */ |
3382 | case CSI_SU: /* 8.3.148: (1) SCROLL UP */ |
3357 | scr_scroll_text (screen.tscroll, screen.bscroll, arg[0], 0); |
3383 | scr_scroll_text (screen.tscroll, screen.bscroll, arg[0]); |
3358 | break; |
3384 | break; |
3359 | |
3385 | |
3360 | case CSI_DA: /* 8.3.24: (0) DEVICE ATTRIBUTES */ |
3386 | case CSI_DA: /* 8.3.24: (0) DEVICE ATTRIBUTES */ |
3361 | tt_write ((const unsigned char *)VT100_ANS, |
3387 | tt_write ((const unsigned char *)VT100_ANS, |
3362 | (unsigned int) (sizeof (VT100_ANS) - 1)); |
3388 | (unsigned int) (sizeof (VT100_ANS) - 1)); |
… | |
… | |
3374 | break; |
3400 | break; |
3375 | case 6: /* CPR requested */ |
3401 | case 6: /* CPR requested */ |
3376 | scr_report_position (); |
3402 | scr_report_position (); |
3377 | break; |
3403 | break; |
3378 | case 7: /* unofficial extension */ |
3404 | case 7: /* unofficial extension */ |
3379 | if (options & Opt_insecure) |
3405 | if (OPTION (Opt_insecure)) |
3380 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3406 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3381 | break; |
3407 | break; |
3382 | case 8: /* unofficial extension */ |
3408 | case 8: /* unofficial extension */ |
3383 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3409 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3384 | break; |
3410 | break; |
… | |
… | |
3548 | break; |
3574 | break; |
3549 | case 20: /* report icon label */ |
3575 | case 20: /* report icon label */ |
3550 | { |
3576 | { |
3551 | char *s; |
3577 | char *s; |
3552 | XGetIconName (disp, parent[0], &s); |
3578 | XGetIconName (disp, parent[0], &s); |
3553 | tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3579 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3554 | XFree (s); |
3580 | XFree (s); |
3555 | } |
3581 | } |
3556 | break; |
3582 | break; |
3557 | case 21: /* report window title */ |
3583 | case 21: /* report window title */ |
3558 | { |
3584 | { |
3559 | char *s; |
3585 | char *s; |
3560 | XFetchName (disp, parent[0], &s); |
3586 | XFetchName (disp, parent[0], &s); |
3561 | tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3587 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3562 | XFree (s); |
3588 | XFree (s); |
3563 | } |
3589 | } |
3564 | break; |
3590 | break; |
3565 | } |
3591 | } |
3566 | } |
3592 | } |
… | |
… | |
3842 | // TODO, when secure mode? |
3868 | // TODO, when secure mode? |
3843 | break; |
3869 | break; |
3844 | |
3870 | |
3845 | #ifdef MENUBAR |
3871 | #ifdef MENUBAR |
3846 | case URxvt_Menu: |
3872 | case URxvt_Menu: |
3847 | if (options & Opt_insecure) |
3873 | if (OPTION (Opt_insecure)) |
3848 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3874 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3849 | break; |
3875 | break; |
3850 | #endif |
3876 | #endif |
3851 | #if 0 |
3877 | #if 0 |
3852 | case XTerm_dumpscreen: /* no error notices */ |
3878 | case XTerm_dumpscreen: /* no error notices */ |
… | |
… | |
3868 | case URxvt_italicFont: |
3894 | case URxvt_italicFont: |
3869 | case URxvt_boldItalicFont: |
3895 | case URxvt_boldItalicFont: |
3870 | #endif |
3896 | #endif |
3871 | if (query) |
3897 | if (query) |
3872 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3898 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3873 | (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3899 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3874 | ? fontset[op - URxvt_font]->fontdesc : "", |
3900 | ? fontset[op - URxvt_font]->fontdesc : "", |
3875 | resp); |
3901 | resp); |
3876 | else |
3902 | else |
3877 | { |
3903 | { |
3878 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3904 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3884 | break; |
3910 | break; |
3885 | |
3911 | |
3886 | #if ENABLE_FRILLS |
3912 | #if ENABLE_FRILLS |
3887 | case URxvt_locale: |
3913 | case URxvt_locale: |
3888 | if (query) |
3914 | if (query) |
3889 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3915 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); |
3890 | else |
3916 | else |
3891 | { |
3917 | { |
3892 | set_locale (str); |
3918 | set_locale (str); |
3893 | pty.set_utf8_mode (enc_utf8); |
3919 | pty.set_utf8_mode (enc_utf8); |
3894 | init_xlocale (); |
3920 | init_xlocale (); |
… | |
… | |
4024 | /* extra handling for values with state unkept */ |
4050 | /* extra handling for values with state unkept */ |
4025 | switch (arg[i]) |
4051 | switch (arg[i]) |
4026 | { |
4052 | { |
4027 | case 1048: /* alternative cursor save */ |
4053 | case 1048: /* alternative cursor save */ |
4028 | case 1049: |
4054 | case 1049: |
4029 | if (options & Opt_secondaryScreen) |
4055 | if (OPTION (Opt_secondaryScreen)) |
4030 | if (mode == 0) |
4056 | if (mode == 0) |
4031 | scr_cursor (RESTORE); |
4057 | scr_cursor (RESTORE); |
4032 | else if (mode == 1) |
4058 | else if (mode == 1) |
4033 | scr_cursor (SAVE); |
4059 | scr_cursor (SAVE); |
4034 | break; |
4060 | break; |
… | |
… | |
4049 | case 3: /* 80/132 */ |
4075 | case 3: /* 80/132 */ |
4050 | if (priv_modes & PrivMode_132OK) |
4076 | if (priv_modes & PrivMode_132OK) |
4051 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4077 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4052 | break; |
4078 | break; |
4053 | case 4: /* smooth scrolling */ |
4079 | case 4: /* smooth scrolling */ |
4054 | if (state) |
4080 | if (!state) |
4055 | options &= ~Opt_jumpScroll; |
4081 | SET_OPTION (Opt_jumpScroll); |
4056 | else |
4082 | else |
4057 | options |= Opt_jumpScroll; |
4083 | CLR_OPTION (Opt_jumpScroll); |
4058 | break; |
4084 | break; |
4059 | case 5: /* reverse video */ |
4085 | case 5: /* reverse video */ |
4060 | scr_rvideo_mode (state); |
4086 | scr_rvideo_mode (state); |
4061 | break; |
4087 | break; |
4062 | case 6: /* relative/absolute origins */ |
4088 | case 6: /* relative/absolute origins */ |
… | |
… | |
4103 | #if 0 |
4129 | #if 0 |
4104 | case 1001: |
4130 | case 1001: |
4105 | break; /* X11 mouse highlighting */ |
4131 | break; /* X11 mouse highlighting */ |
4106 | #endif |
4132 | #endif |
4107 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4133 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4108 | if (state) |
4134 | if (!state) |
4109 | options &= ~Opt_scrollTtyOutput; |
4135 | SET_OPTION (Opt_scrollTtyOutput); |
4110 | else |
4136 | else |
4111 | options |= Opt_scrollTtyOutput; |
4137 | CLR_OPTION (Opt_scrollTtyOutput); |
4112 | break; |
4138 | break; |
4113 | case 1011: /* scroll to bottom on key press */ |
4139 | case 1011: /* scroll to bottom on key press */ |
4114 | if (state) |
4140 | if (state) |
4115 | options |= Opt_scrollTtyKeypress; |
4141 | SET_OPTION (Opt_scrollTtyKeypress); |
4116 | else |
4142 | else |
4117 | options &= ~Opt_scrollTtyKeypress; |
4143 | CLR_OPTION (Opt_scrollTtyKeypress); |
4118 | break; |
4144 | break; |
|
|
4145 | #if ENABLE_STYLES |
|
|
4146 | case 1021: |
|
|
4147 | if (state) |
|
|
4148 | SET_OPTION (Opt_intensityStyles); |
|
|
4149 | else |
|
|
4150 | CLR_OPTION (Opt_intensityStyles); |
|
|
4151 | #endif |
4119 | case 1047: /* secondary screen w/ clearing last */ |
4152 | case 1047: /* secondary screen w/ clearing last */ |
4120 | if (options & Opt_secondaryScreen) |
4153 | if (OPTION (Opt_secondaryScreen)) |
4121 | if (current_screen != PRIMARY) |
4154 | if (current_screen != PRIMARY) |
4122 | scr_erase_screen (2); |
4155 | scr_erase_screen (2); |
4123 | scr_change_screen (state); |
4156 | scr_change_screen (state); |
4124 | break; |
4157 | break; |
4125 | case 1049: /* secondary screen w/ clearing first */ |
4158 | case 1049: /* secondary screen w/ clearing first */ |
4126 | scr_change_screen (state); |
4159 | scr_change_screen (state); |
4127 | if (options & Opt_secondaryScreen) |
4160 | if (OPTION (Opt_secondaryScreen)) |
4128 | if (current_screen != PRIMARY) |
4161 | if (current_screen != PRIMARY) |
4129 | scr_erase_screen (2); |
4162 | scr_erase_screen (2); |
4130 | break; |
4163 | break; |
4131 | default: |
4164 | default: |
4132 | break; |
4165 | break; |
… | |
… | |
4373 | } |
4406 | } |
4374 | |
4407 | |
4375 | memmove (v_buffer, v_buffer + written, v_buflen); |
4408 | memmove (v_buffer, v_buffer + written, v_buflen); |
4376 | } |
4409 | } |
4377 | else if (written != -1 || (errno != EAGAIN && errno != EINTR)) |
4410 | else if (written != -1 || (errno != EAGAIN && errno != EINTR)) |
4378 | // original code just ignores this... |
4411 | pty_ev.set (EVENT_READ); |
4379 | destroy (); |
|
|
4380 | } |
4412 | } |
4381 | |
4413 | |
4382 | /*----------------------- end-of-file (C source) -----------------------*/ |
4414 | /*----------------------- end-of-file (C source) -----------------------*/ |
4383 | |
4415 | |