… | |
… | |
48 | #include "../config.h" /* NECESSARY */ |
48 | #include "../config.h" /* NECESSARY */ |
49 | #include "rxvt.h" /* NECESSARY */ |
49 | #include "rxvt.h" /* NECESSARY */ |
50 | #include "version.h" |
50 | #include "version.h" |
51 | #include "command.h" |
51 | #include "command.h" |
52 | |
52 | |
|
|
53 | #if HAVE_SCHED_YIELD |
|
|
54 | # include <sched.h> |
|
|
55 | #endif |
|
|
56 | |
53 | #ifdef KEYSYM_RESOURCE |
57 | #ifdef KEYSYM_RESOURCE |
54 | # include "keyboard.h" |
58 | # include "keyboard.h" |
55 | #endif |
59 | #endif |
56 | |
60 | |
57 | #include <csignal> |
61 | #include <csignal> |
… | |
… | |
135 | rxvt_term::iso14755_54 (int x, int y) |
139 | rxvt_term::iso14755_54 (int x, int y) |
136 | { |
140 | { |
137 | x = Pixel2Col (x); |
141 | x = Pixel2Col (x); |
138 | y = Pixel2Row (y); |
142 | y = Pixel2Row (y); |
139 | |
143 | |
140 | if (x < 0 || x >= ncol |
144 | if (!IN_RANGE_EXC (x, 0, ncol) |
141 | || y < 0 || y >= nrow) |
145 | || !IN_RANGE_EXC (y, 0, nrow)) |
142 | return; |
146 | return; |
143 | |
147 | |
144 | for (;;) |
148 | for (;;) |
145 | { |
149 | { |
146 | const line_t &l = save[y + saveLines - view_start]; |
150 | const line_t &l = ROW(y - view_start); |
147 | |
151 | |
148 | text_t t = l.t[x]; |
152 | text_t t = l.t[x]; |
149 | |
153 | |
150 | if (t != NOCHAR || !x) |
154 | if (t != NOCHAR || !x) |
151 | { |
155 | { |
152 | iso14755_51 (l.t[x], l.r[x]); |
156 | iso14755_51 (l.t[x], l.r[x], x, y); |
153 | iso14755buf = ISO_14755_54; |
157 | iso14755buf = ISO_14755_54; |
154 | break; |
158 | break; |
155 | } |
159 | } |
156 | |
160 | |
157 | x--; |
161 | x--; |
158 | } |
162 | } |
159 | |
|
|
160 | } |
163 | } |
161 | #endif |
|
|
162 | |
164 | |
163 | #if ENABLE_OVERLAY |
|
|
164 | void |
165 | void |
165 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r) |
166 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
166 | { |
167 | { |
167 | rxvt_fontset *fs = FONTSET (r); |
168 | rxvt_fontset *fs = FONTSET (r); |
168 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
169 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
169 | wchar_t *chr, *alloc, ch2, *fname; |
170 | wchar_t *chr, *alloc, ch2, *fname; |
170 | int len; |
171 | int len; |
171 | |
172 | |
172 | fname = rxvt_utf8towcs (f->name); |
173 | fname = rxvt_utf8towcs (f->name); |
173 | |
174 | |
174 | #if ENABLE_COMBINING |
175 | # if ENABLE_COMBINING |
175 | if (IS_COMPOSE (ch)) |
176 | if (IS_COMPOSE (ch)) |
176 | { |
177 | { |
177 | len = rxvt_composite.expand (ch, 0); |
178 | len = rxvt_composite.expand (ch, 0); |
178 | alloc = chr = new wchar_t[len]; |
179 | alloc = chr = new wchar_t[len]; |
179 | rxvt_composite.expand (ch, chr); |
180 | rxvt_composite.expand (ch, chr); |
180 | } |
181 | } |
181 | else |
182 | else |
182 | #endif |
183 | # endif |
183 | { |
184 | { |
184 | ch2 = ch; |
185 | ch2 = ch; |
185 | |
186 | |
186 | alloc = 0; |
187 | alloc = 0; |
187 | chr = &ch2; |
188 | chr = &ch2; |
188 | len = 1; |
189 | len = 1; |
189 | } |
190 | } |
190 | |
191 | |
|
|
192 | char attr[80]; // plenty |
|
|
193 | |
|
|
194 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
|
|
195 | (int)r, |
|
|
196 | fgcolor_of (r), bgcolor_of (r), |
|
|
197 | r & RS_Bold ? " bold" : "", |
|
|
198 | r & RS_Italic ? " italic" : "", |
|
|
199 | r & RS_Blink ? " blink" : "", |
|
|
200 | r & RS_RVid ? " rvid" : "", |
|
|
201 | r & RS_Uline ? " uline" : "", |
|
|
202 | r & RS_Careful ? " careful" : ""); |
|
|
203 | |
191 | int width = wcswidth (fname, wcslen (fname)); |
204 | int width = wcswidth (fname, wcslen (fname)); |
192 | |
205 | |
193 | scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); |
206 | max_it (width, 8+5); // for char + hey |
|
|
207 | max_it (width, strlen (attr)); |
|
|
208 | |
|
|
209 | if (y >= 0) |
|
|
210 | { |
|
|
211 | y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; |
|
|
212 | x = 0; |
|
|
213 | } |
|
|
214 | |
|
|
215 | scr_overlay_new (x, y, width, len + 2); |
194 | |
216 | |
195 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
217 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
196 | |
218 | |
197 | for (int y = 0; y < len; y++) |
219 | for (int y = 0; y < len; y++) |
198 | { |
220 | { |
… | |
… | |
201 | ch = *chr++; |
223 | ch = *chr++; |
202 | |
224 | |
203 | sprintf (buf, "%8x", ch); |
225 | sprintf (buf, "%8x", ch); |
204 | scr_overlay_set (0, y, buf); |
226 | scr_overlay_set (0, y, buf); |
205 | scr_overlay_set (9, y, '='); |
227 | scr_overlay_set (9, y, '='); |
206 | #if !UNICODE3 |
228 | # if !UNICODE3 |
207 | if (ch >= 0x10000) |
229 | if (ch >= 0x10000) |
208 | ch = 0xfffd; |
230 | ch = 0xfffd; |
209 | #endif |
231 | # endif |
210 | scr_overlay_set (11, y, ch, r); |
232 | scr_overlay_set (11, y, ch, r); |
211 | scr_overlay_set (12, y, NOCHAR, r); |
233 | scr_overlay_set (12, y, NOCHAR, r); |
212 | } |
234 | } |
213 | |
235 | |
|
|
236 | scr_overlay_set (0, len , attr); |
214 | scr_overlay_set (0, len, fname); |
237 | scr_overlay_set (0, len + 1, fname); |
215 | |
238 | |
216 | free (fname); |
239 | free (fname); |
217 | |
240 | |
218 | #if ENABLE_COMBINING |
241 | # if ENABLE_COMBINING |
219 | if (alloc) |
242 | if (alloc) |
220 | delete [] alloc; |
243 | delete [] alloc; |
221 | #endif |
244 | # endif |
222 | } |
245 | } |
223 | #endif |
246 | #endif |
224 | |
247 | |
225 | void |
248 | void |
226 | rxvt_term::commit_iso14755 () |
249 | rxvt_term::commit_iso14755 () |
… | |
… | |
845 | } |
868 | } |
846 | |
869 | |
847 | if (len <= 0) |
870 | if (len <= 0) |
848 | return; /* not mapped */ |
871 | return; /* not mapped */ |
849 | |
872 | |
850 | if (options & Opt_scrollTtyKeypress) |
873 | if (OPTION (Opt_scrollTtyKeypress)) |
851 | if (view_start) |
874 | if (view_start) |
852 | { |
875 | { |
853 | view_start = 0; |
876 | view_start = 0; |
854 | want_refresh = 1; |
877 | want_refresh = 1; |
855 | } |
878 | } |
… | |
… | |
1035 | { |
1058 | { |
1036 | if (mouse_slip_wheel_speed == 0 |
1059 | if (mouse_slip_wheel_speed == 0 |
1037 | || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) |
1060 | || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) |
1038 | : scr_page (UP, mouse_slip_wheel_speed)) |
1061 | : scr_page (UP, mouse_slip_wheel_speed)) |
1039 | { |
1062 | { |
1040 | if (view_start == nscrolled || |
1063 | if (view_start == nsaved || |
1041 | view_start == 0) |
1064 | view_start == 0) |
1042 | mouse_slip_wheel_speed = 0; |
1065 | mouse_slip_wheel_speed = 0; |
1043 | |
1066 | |
1044 | refresh_type |= SMOOTH_REFRESH; |
1067 | refresh_type |= SMOOTH_REFRESH; |
1045 | want_refresh = 1; |
1068 | want_refresh = 1; |
… | |
… | |
1061 | |
1084 | |
1062 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1085 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1063 | cmdbuf_ptr = cmdbuf_base; |
1086 | cmdbuf_ptr = cmdbuf_base; |
1064 | cmdbuf_endp = cmdbuf_ptr + n; |
1087 | cmdbuf_endp = cmdbuf_ptr + n; |
1065 | |
1088 | |
1066 | n = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); |
1089 | ssize_t r = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); |
1067 | |
1090 | |
1068 | if (n > 0) |
1091 | if (r > 0) |
1069 | { |
1092 | { |
1070 | cmdbuf_endp += n; |
1093 | cmdbuf_endp += r; |
1071 | return true; |
1094 | return true; |
1072 | } |
1095 | } |
1073 | else if (n < 0 && errno != EAGAIN) |
1096 | else if (r < 0 && (errno == EAGAIN || errno == EINTR)) |
|
|
1097 | { |
|
|
1098 | #if HAVE_SCHED_YIELD |
|
|
1099 | sched_yield (); |
|
|
1100 | #endif |
|
|
1101 | } |
|
|
1102 | else |
|
|
1103 | { |
|
|
1104 | pty_ev.stop (); |
|
|
1105 | |
|
|
1106 | if (!OPTION (Opt_hold)) |
1074 | destroy (); |
1107 | destroy (); |
|
|
1108 | } |
1075 | |
1109 | |
1076 | return false; |
1110 | return false; |
1077 | } |
1111 | } |
1078 | |
1112 | |
1079 | void |
1113 | void |
… | |
… | |
1099 | recolour_cursor (); |
1133 | recolour_cursor (); |
1100 | |
1134 | |
1101 | #ifdef POINTER_BLANK |
1135 | #ifdef POINTER_BLANK |
1102 | hidden_pointer = 0; |
1136 | hidden_pointer = 0; |
1103 | |
1137 | |
1104 | if (options & Opt_pointerBlank) |
1138 | if (OPTION (Opt_pointerBlank)) |
1105 | pointer_ev.start (NOW + pointerBlankDelay); |
1139 | pointer_ev.start (NOW + pointerBlankDelay); |
1106 | #endif |
1140 | #endif |
1107 | } |
1141 | } |
1108 | |
1142 | |
1109 | #ifdef POINTER_BLANK |
1143 | #ifdef POINTER_BLANK |
1110 | void |
1144 | void |
1111 | rxvt_term::pointer_blank () |
1145 | rxvt_term::pointer_blank () |
1112 | { |
1146 | { |
1113 | if (! (options & Opt_pointerBlank)) |
1147 | if (! OPTION (Opt_pointerBlank)) |
1114 | return; |
1148 | return; |
1115 | |
1149 | |
1116 | XDefineCursor (display->display, vt, display->blank_cursor); |
1150 | XDefineCursor (display->display, vt, display->blank_cursor); |
1117 | XFlush (display->display); |
1151 | XFlush (display->display); |
1118 | |
1152 | |
… | |
… | |
1216 | |
1250 | |
1217 | SET_R (this); |
1251 | SET_R (this); |
1218 | SET_LOCALE (locale); |
1252 | SET_LOCALE (locale); |
1219 | |
1253 | |
1220 | #if defined(CURSOR_BLINK) |
1254 | #if defined(CURSOR_BLINK) |
1221 | if ((options & Opt_cursorBlink) && ev.type == KeyPress) |
1255 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1222 | { |
1256 | { |
1223 | if (hidden_cursor) |
1257 | if (hidden_cursor) |
1224 | { |
1258 | { |
1225 | hidden_cursor = 0; |
1259 | hidden_cursor = 0; |
1226 | want_refresh = 1; |
1260 | want_refresh = 1; |
… | |
… | |
1229 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1263 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1230 | } |
1264 | } |
1231 | #endif |
1265 | #endif |
1232 | |
1266 | |
1233 | #if defined(POINTER_BLANK) |
1267 | #if defined(POINTER_BLANK) |
1234 | if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) |
1268 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1235 | { |
1269 | { |
1236 | if (ev.type == MotionNotify |
1270 | if (ev.type == MotionNotify |
1237 | || ev.type == ButtonPress |
1271 | || ev.type == ButtonPress |
1238 | || ev.type == ButtonRelease) |
1272 | || ev.type == ButtonRelease) |
1239 | if (hidden_pointer) |
1273 | if (hidden_pointer) |
… | |
… | |
1435 | seen_resize = 1; |
1469 | seen_resize = 1; |
1436 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1470 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1437 | } |
1471 | } |
1438 | |
1472 | |
1439 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1473 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1440 | if (options & Opt_transparent) |
1474 | if (OPTION (Opt_transparent)) |
1441 | check_our_parents (); |
1475 | check_our_parents (); |
1442 | #endif |
1476 | #endif |
1443 | } |
1477 | } |
1444 | break; |
1478 | break; |
1445 | |
1479 | |
… | |
… | |
1601 | } |
1635 | } |
1602 | |
1636 | |
1603 | scroll_selection_lines = Pixel2Height (dist) |
1637 | scroll_selection_lines = Pixel2Height (dist) |
1604 | / SELECTION_SCROLL_LINE_SPEEDUP |
1638 | / SELECTION_SCROLL_LINE_SPEEDUP |
1605 | + 1; |
1639 | + 1; |
1606 | MIN_IT (scroll_selection_lines, |
1640 | min_it (scroll_selection_lines, |
1607 | SELECTION_SCROLL_MAX_LINES); |
1641 | SELECTION_SCROLL_MAX_LINES); |
1608 | } |
1642 | } |
1609 | else |
1643 | else |
1610 | { |
1644 | { |
1611 | /* we are within the text window, so we |
1645 | /* we are within the text window, so we |
… | |
… | |
1654 | IMSetStatusPosition (); |
1688 | IMSetStatusPosition (); |
1655 | XSetICFocus (Input_Context); |
1689 | XSetICFocus (Input_Context); |
1656 | } |
1690 | } |
1657 | #endif |
1691 | #endif |
1658 | #if CURSOR_BLINK |
1692 | #if CURSOR_BLINK |
1659 | if (options & Opt_cursorBlink) |
1693 | if (OPTION (Opt_cursorBlink)) |
1660 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1694 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1661 | #endif |
1695 | #endif |
1662 | #if OFF_FOCUS_FADING |
1696 | #if OFF_FOCUS_FADING |
1663 | if (rs[Rs_fade]) |
1697 | if (rs[Rs_fade]) |
1664 | { |
1698 | { |
… | |
… | |
1686 | #if USE_XIM |
1720 | #if USE_XIM |
1687 | if (Input_Context != NULL) |
1721 | if (Input_Context != NULL) |
1688 | XUnsetICFocus (Input_Context); |
1722 | XUnsetICFocus (Input_Context); |
1689 | #endif |
1723 | #endif |
1690 | #if CURSOR_BLINK |
1724 | #if CURSOR_BLINK |
1691 | if (options & Opt_cursorBlink) |
1725 | if (OPTION (Opt_cursorBlink)) |
1692 | cursor_blink_ev.stop (); |
1726 | cursor_blink_ev.stop (); |
1693 | hidden_cursor = 0; |
1727 | hidden_cursor = 0; |
1694 | #endif |
1728 | #endif |
1695 | #if OFF_FOCUS_FADING |
1729 | #if OFF_FOCUS_FADING |
1696 | if (rs[Rs_fade]) |
1730 | if (rs[Rs_fade]) |
… | |
… | |
1720 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1754 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1721 | return; |
1755 | return; |
1722 | |
1756 | |
1723 | /* FALLTHROUGH */ |
1757 | /* FALLTHROUGH */ |
1724 | case ReparentNotify: |
1758 | case ReparentNotify: |
1725 | if ((options & Opt_transparent) && check_our_parents () && am_transparent) |
1759 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1726 | want_refresh = want_full_refresh = 1; |
1760 | want_refresh = want_full_refresh = 1; |
1727 | break; |
1761 | break; |
1728 | } |
1762 | } |
1729 | } |
1763 | } |
1730 | #endif |
1764 | #endif |
… | |
… | |
2072 | |
2106 | |
2073 | v = ev.button == Button4 ? UP : DN; |
2107 | v = ev.button == Button4 ? UP : DN; |
2074 | |
2108 | |
2075 | if (ev.state & ShiftMask) |
2109 | if (ev.state & ShiftMask) |
2076 | i = 1; |
2110 | i = 1; |
2077 | else if (options & Opt_mouseWheelScrollPage) |
2111 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2078 | i = nrow - 1; |
2112 | i = nrow - 1; |
2079 | else |
2113 | else |
2080 | i = 5; |
2114 | i = 5; |
2081 | |
2115 | |
2082 | # ifdef MOUSE_SLIP_WHEELING |
2116 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2368 | XWindowAttributes wattr, wrootattr; |
2402 | XWindowAttributes wattr, wrootattr; |
2369 | dDisp; |
2403 | dDisp; |
2370 | |
2404 | |
2371 | pchanged = 0; |
2405 | pchanged = 0; |
2372 | |
2406 | |
2373 | if (!(options & Opt_transparent)) |
2407 | if (!OPTION (Opt_transparent)) |
2374 | return pchanged; /* Don't try any more */ |
2408 | return pchanged; /* Don't try any more */ |
2375 | |
2409 | |
2376 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2410 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2377 | rootdepth = wrootattr.depth; |
2411 | rootdepth = wrootattr.depth; |
2378 | |
2412 | |
… | |
… | |
2452 | nh += sy; |
2486 | nh += sy; |
2453 | ny = -sy; |
2487 | ny = -sy; |
2454 | sy = 0; |
2488 | sy = 0; |
2455 | } |
2489 | } |
2456 | |
2490 | |
2457 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
2491 | min_it (nw, (unsigned int) (wrootattr.width - sx)); |
2458 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
2492 | min_it (nh, (unsigned int) (wrootattr.height - sy)); |
2459 | |
2493 | |
2460 | XSync (disp, False); |
2494 | XSync (disp, False); |
2461 | allowedxerror = -1; |
2495 | allowedxerror = -1; |
2462 | image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2496 | image = XGetImage (disp, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2463 | |
2497 | |
… | |
… | |
2656 | if (ch == C0_LF) |
2690 | if (ch == C0_LF) |
2657 | nlines++; |
2691 | nlines++; |
2658 | |
2692 | |
2659 | refresh_count++; |
2693 | refresh_count++; |
2660 | |
2694 | |
2661 | if (!(options & Opt_jumpScroll) |
2695 | if (!OPTION (Opt_jumpScroll) |
2662 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2696 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2663 | { |
2697 | { |
2664 | refreshnow = true; |
2698 | refreshnow = true; |
2665 | ch = NOCHAR; |
2699 | ch = NOCHAR; |
2666 | break; |
2700 | break; |
… | |
… | |
2700 | * the number of pages between refreshes is refresh_limit, which |
2734 | * the number of pages between refreshes is refresh_limit, which |
2701 | * is incremented here because we must be doing flat-out scrolling. |
2735 | * is incremented here because we must be doing flat-out scrolling. |
2702 | */ |
2736 | */ |
2703 | if (refreshnow) |
2737 | if (refreshnow) |
2704 | { |
2738 | { |
2705 | if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2739 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2706 | refresh_limit++; |
2740 | refresh_limit++; |
2707 | else |
2741 | else |
2708 | { |
2742 | { |
2709 | flag = true; |
2743 | flag = true; |
2710 | scr_refresh (refresh_type); |
2744 | scr_refresh (refresh_type); |
… | |
… | |
3352 | |
3386 | |
3353 | case CSI_SD: /* 8.3.114: (1) SCROLL DOWN */ |
3387 | case CSI_SD: /* 8.3.114: (1) SCROLL DOWN */ |
3354 | arg[0] = -arg[0]; |
3388 | arg[0] = -arg[0]; |
3355 | /* FALLTHROUGH */ |
3389 | /* FALLTHROUGH */ |
3356 | case CSI_SU: /* 8.3.148: (1) SCROLL UP */ |
3390 | case CSI_SU: /* 8.3.148: (1) SCROLL UP */ |
3357 | scr_scroll_text (screen.tscroll, screen.bscroll, arg[0], 0); |
3391 | scr_scroll_text (screen.tscroll, screen.bscroll, arg[0]); |
3358 | break; |
3392 | break; |
3359 | |
3393 | |
3360 | case CSI_DA: /* 8.3.24: (0) DEVICE ATTRIBUTES */ |
3394 | case CSI_DA: /* 8.3.24: (0) DEVICE ATTRIBUTES */ |
3361 | tt_write ((const unsigned char *)VT100_ANS, |
3395 | tt_write ((const unsigned char *)VT100_ANS, |
3362 | (unsigned int) (sizeof (VT100_ANS) - 1)); |
3396 | (unsigned int) (sizeof (VT100_ANS) - 1)); |
… | |
… | |
3374 | break; |
3408 | break; |
3375 | case 6: /* CPR requested */ |
3409 | case 6: /* CPR requested */ |
3376 | scr_report_position (); |
3410 | scr_report_position (); |
3377 | break; |
3411 | break; |
3378 | case 7: /* unofficial extension */ |
3412 | case 7: /* unofficial extension */ |
3379 | if (options & Opt_insecure) |
3413 | if (OPTION (Opt_insecure)) |
3380 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3414 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3381 | break; |
3415 | break; |
3382 | case 8: /* unofficial extension */ |
3416 | case 8: /* unofficial extension */ |
3383 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3417 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3384 | break; |
3418 | break; |
… | |
… | |
3548 | break; |
3582 | break; |
3549 | case 20: /* report icon label */ |
3583 | case 20: /* report icon label */ |
3550 | { |
3584 | { |
3551 | char *s; |
3585 | char *s; |
3552 | XGetIconName (disp, parent[0], &s); |
3586 | XGetIconName (disp, parent[0], &s); |
3553 | 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 */ |
3554 | XFree (s); |
3588 | XFree (s); |
3555 | } |
3589 | } |
3556 | break; |
3590 | break; |
3557 | case 21: /* report window title */ |
3591 | case 21: /* report window title */ |
3558 | { |
3592 | { |
3559 | char *s; |
3593 | char *s; |
3560 | XFetchName (disp, parent[0], &s); |
3594 | XFetchName (disp, parent[0], &s); |
3561 | tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3595 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3562 | XFree (s); |
3596 | XFree (s); |
3563 | } |
3597 | } |
3564 | break; |
3598 | break; |
3565 | } |
3599 | } |
3566 | } |
3600 | } |
… | |
… | |
3842 | // TODO, when secure mode? |
3876 | // TODO, when secure mode? |
3843 | break; |
3877 | break; |
3844 | |
3878 | |
3845 | #ifdef MENUBAR |
3879 | #ifdef MENUBAR |
3846 | case URxvt_Menu: |
3880 | case URxvt_Menu: |
3847 | if (options & Opt_insecure) |
3881 | if (OPTION (Opt_insecure)) |
3848 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3882 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3849 | break; |
3883 | break; |
3850 | #endif |
3884 | #endif |
3851 | #if 0 |
3885 | #if 0 |
3852 | case XTerm_dumpscreen: /* no error notices */ |
3886 | case XTerm_dumpscreen: /* no error notices */ |
… | |
… | |
3868 | case URxvt_italicFont: |
3902 | case URxvt_italicFont: |
3869 | case URxvt_boldItalicFont: |
3903 | case URxvt_boldItalicFont: |
3870 | #endif |
3904 | #endif |
3871 | if (query) |
3905 | if (query) |
3872 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3906 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3873 | (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3907 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3874 | ? fontset[op - URxvt_font]->fontdesc : "", |
3908 | ? fontset[op - URxvt_font]->fontdesc : "", |
3875 | resp); |
3909 | resp); |
3876 | else |
3910 | else |
3877 | { |
3911 | { |
3878 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3912 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3884 | break; |
3918 | break; |
3885 | |
3919 | |
3886 | #if ENABLE_FRILLS |
3920 | #if ENABLE_FRILLS |
3887 | case URxvt_locale: |
3921 | case URxvt_locale: |
3888 | if (query) |
3922 | if (query) |
3889 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3923 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); |
3890 | else |
3924 | else |
3891 | { |
3925 | { |
3892 | set_locale (str); |
3926 | set_locale (str); |
3893 | pty.set_utf8_mode (enc_utf8); |
3927 | pty.set_utf8_mode (enc_utf8); |
3894 | init_xlocale (); |
3928 | init_xlocale (); |
… | |
… | |
4022 | } |
4056 | } |
4023 | |
4057 | |
4024 | /* extra handling for values with state unkept */ |
4058 | /* extra handling for values with state unkept */ |
4025 | switch (arg[i]) |
4059 | switch (arg[i]) |
4026 | { |
4060 | { |
|
|
4061 | #if ENABLE_STYLES |
|
|
4062 | case 1021: |
|
|
4063 | if (mode) |
|
|
4064 | SET_OPTION (Opt_intensityStyles); |
|
|
4065 | else |
|
|
4066 | CLR_OPTION (Opt_intensityStyles); |
|
|
4067 | |
|
|
4068 | want_refresh = 1; |
|
|
4069 | want_full_refresh = 1; |
|
|
4070 | break; |
|
|
4071 | #endif |
4027 | case 1048: /* alternative cursor save */ |
4072 | case 1048: /* alternative cursor save */ |
4028 | case 1049: |
4073 | case 1049: |
4029 | if (options & Opt_secondaryScreen) |
4074 | if (OPTION (Opt_secondaryScreen)) |
4030 | if (mode == 0) |
4075 | if (mode == 0) |
4031 | scr_cursor (RESTORE); |
4076 | scr_cursor (RESTORE); |
4032 | else if (mode == 1) |
4077 | else if (mode == 1) |
4033 | scr_cursor (SAVE); |
4078 | scr_cursor (SAVE); |
4034 | break; |
4079 | break; |
… | |
… | |
4049 | case 3: /* 80/132 */ |
4094 | case 3: /* 80/132 */ |
4050 | if (priv_modes & PrivMode_132OK) |
4095 | if (priv_modes & PrivMode_132OK) |
4051 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4096 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4052 | break; |
4097 | break; |
4053 | case 4: /* smooth scrolling */ |
4098 | case 4: /* smooth scrolling */ |
4054 | if (state) |
4099 | if (!state) |
4055 | options &= ~Opt_jumpScroll; |
4100 | SET_OPTION (Opt_jumpScroll); |
4056 | else |
4101 | else |
4057 | options |= Opt_jumpScroll; |
4102 | CLR_OPTION (Opt_jumpScroll); |
4058 | break; |
4103 | break; |
4059 | case 5: /* reverse video */ |
4104 | case 5: /* reverse video */ |
4060 | scr_rvideo_mode (state); |
4105 | scr_rvideo_mode (state); |
4061 | break; |
4106 | break; |
4062 | case 6: /* relative/absolute origins */ |
4107 | case 6: /* relative/absolute origins */ |
… | |
… | |
4103 | #if 0 |
4148 | #if 0 |
4104 | case 1001: |
4149 | case 1001: |
4105 | break; /* X11 mouse highlighting */ |
4150 | break; /* X11 mouse highlighting */ |
4106 | #endif |
4151 | #endif |
4107 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4152 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4108 | if (state) |
4153 | if (!state) |
4109 | options &= ~Opt_scrollTtyOutput; |
4154 | SET_OPTION (Opt_scrollTtyOutput); |
4110 | else |
4155 | else |
4111 | options |= Opt_scrollTtyOutput; |
4156 | CLR_OPTION (Opt_scrollTtyOutput); |
4112 | break; |
4157 | break; |
4113 | case 1011: /* scroll to bottom on key press */ |
4158 | case 1011: /* scroll to bottom on key press */ |
4114 | if (state) |
4159 | if (state) |
4115 | options |= Opt_scrollTtyKeypress; |
4160 | SET_OPTION (Opt_scrollTtyKeypress); |
4116 | else |
4161 | else |
4117 | options &= ~Opt_scrollTtyKeypress; |
4162 | CLR_OPTION (Opt_scrollTtyKeypress); |
4118 | break; |
4163 | break; |
4119 | case 1047: /* secondary screen w/ clearing last */ |
4164 | case 1047: /* secondary screen w/ clearing last */ |
4120 | if (options & Opt_secondaryScreen) |
4165 | if (OPTION (Opt_secondaryScreen)) |
4121 | if (current_screen != PRIMARY) |
4166 | if (current_screen != PRIMARY) |
4122 | scr_erase_screen (2); |
4167 | scr_erase_screen (2); |
4123 | scr_change_screen (state); |
4168 | scr_change_screen (state); |
4124 | break; |
4169 | break; |
4125 | case 1049: /* secondary screen w/ clearing first */ |
4170 | case 1049: /* secondary screen w/ clearing first */ |
4126 | scr_change_screen (state); |
4171 | scr_change_screen (state); |
4127 | if (options & Opt_secondaryScreen) |
4172 | if (OPTION (Opt_secondaryScreen)) |
4128 | if (current_screen != PRIMARY) |
4173 | if (current_screen != PRIMARY) |
4129 | scr_erase_screen (2); |
4174 | scr_erase_screen (2); |
4130 | break; |
4175 | break; |
4131 | default: |
4176 | default: |
4132 | break; |
4177 | break; |
… | |
… | |
4282 | case 106: |
4327 | case 106: |
4283 | case 107: |
4328 | case 107: |
4284 | scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); |
4329 | scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); |
4285 | break; |
4330 | break; |
4286 | #endif |
4331 | #endif |
4287 | |
|
|
4288 | } |
4332 | } |
4289 | } |
4333 | } |
4290 | } |
4334 | } |
4291 | /*}}} */ |
4335 | /*}}} */ |
4292 | |
4336 | |
… | |
… | |
4373 | } |
4417 | } |
4374 | |
4418 | |
4375 | memmove (v_buffer, v_buffer + written, v_buflen); |
4419 | memmove (v_buffer, v_buffer + written, v_buflen); |
4376 | } |
4420 | } |
4377 | else if (written != -1 || (errno != EAGAIN && errno != EINTR)) |
4421 | else if (written != -1 || (errno != EAGAIN && errno != EINTR)) |
4378 | // original code just ignores this... |
4422 | pty_ev.set (EVENT_READ); |
4379 | destroy (); |
|
|
4380 | } |
4423 | } |
4381 | |
4424 | |
4382 | /*----------------------- end-of-file (C source) -----------------------*/ |
4425 | /*----------------------- end-of-file (C source) -----------------------*/ |
4383 | |
4426 | |