… | |
… | |
25 | * - extensive modifications |
25 | * - extensive modifications |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
27 | * Copyright (c) 2001 Marius Gedminas |
27 | * Copyright (c) 2001 Marius Gedminas |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
30 | * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com> |
30 | * Copyright (c) 2003-2005 Marc Lehmann <pcg@goof.com> |
31 | * |
31 | * |
32 | * This program is free software; you can redistribute it and/or modify |
32 | * This program is free software; you can redistribute it and/or modify |
33 | * it under the terms of the GNU General Public License as published by |
33 | * it under the terms of the GNU General Public License as published by |
34 | * the Free Software Foundation; either version 2 of the License, or |
34 | * the Free Software Foundation; either version 2 of the License, or |
35 | * (at your option) any later version. |
35 | * (at your option) any later version. |
… | |
… | |
117 | XK_Escape, 0x238b, |
117 | XK_Escape, 0x238b, |
118 | XK_Undo, 0x238c, |
118 | XK_Undo, 0x238c, |
119 | XK_Print, 0x2399, |
119 | XK_Print, 0x2399, |
120 | |
120 | |
121 | XK_space, 0x2423, |
121 | XK_space, 0x2423, |
|
|
122 | |
|
|
123 | #ifdef XK_KP_Begin |
|
|
124 | XK_KP_Prior, 0x21de, |
|
|
125 | XK_KP_Next, 0x21df, |
|
|
126 | XK_KP_Begin, 0x2320, |
|
|
127 | XK_KP_Insert, 0x2380, |
|
|
128 | XK_KP_Delete, 0x2326, |
122 | XK_KP_Space, 0x2422, |
129 | XK_KP_Space, 0x2422, |
|
|
130 | #endif |
123 | 0, |
131 | 0, |
124 | }; |
132 | }; |
125 | |
133 | |
126 | void |
134 | void |
127 | rxvt_term::iso14755_54 (int x, int y) |
135 | rxvt_term::iso14755_54 (int x, int y) |
… | |
… | |
155 | void |
163 | void |
156 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r) |
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r) |
157 | { |
165 | { |
158 | rxvt_fontset *fs = FONTSET (r); |
166 | rxvt_fontset *fs = FONTSET (r); |
159 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
160 | wchar_t *chr, *alloc, ch2; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
161 | int len; |
169 | int len; |
|
|
170 | |
|
|
171 | fname = rxvt_utf8towcs (f->name); |
162 | |
172 | |
163 | #if ENABLE_COMBINING |
173 | #if ENABLE_COMBINING |
164 | if (IS_COMPOSE (ch)) |
174 | if (IS_COMPOSE (ch)) |
165 | { |
175 | { |
166 | len = rxvt_composite.expand (ch, 0); |
176 | len = rxvt_composite.expand (ch, 0); |
… | |
… | |
175 | alloc = 0; |
185 | alloc = 0; |
176 | chr = &ch2; |
186 | chr = &ch2; |
177 | len = 1; |
187 | len = 1; |
178 | } |
188 | } |
179 | |
189 | |
180 | int width = strlen (f->name); |
190 | int width = wcswidth (fname, wcslen (fname)); |
181 | |
191 | |
182 | scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); |
192 | scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); |
183 | |
193 | |
184 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
194 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
185 | |
195 | |
… | |
… | |
198 | #endif |
208 | #endif |
199 | scr_overlay_set (11, y, ch, r); |
209 | scr_overlay_set (11, y, ch, r); |
200 | scr_overlay_set (12, y, NOCHAR, r); |
210 | scr_overlay_set (12, y, NOCHAR, r); |
201 | } |
211 | } |
202 | |
212 | |
203 | scr_overlay_set (0, len, f->name); |
213 | scr_overlay_set (0, len, fname); |
|
|
214 | |
|
|
215 | free (fname); |
204 | |
216 | |
205 | #if ENABLE_COMBINING |
217 | #if ENABLE_COMBINING |
206 | if (alloc) |
218 | if (alloc) |
207 | delete [] alloc; |
219 | delete [] alloc; |
208 | #endif |
220 | #endif |
… | |
… | |
276 | * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an |
288 | * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an |
277 | * escape sequence to toggle the Keypad. |
289 | * escape sequence to toggle the Keypad. |
278 | * |
290 | * |
279 | * Always permit `shift' to override the current setting |
291 | * Always permit `shift' to override the current setting |
280 | */ |
292 | */ |
281 | shft = (ev.state & ShiftMask); |
293 | shft = ev.state & ShiftMask; |
282 | ctrl = (ev.state & ControlMask); |
294 | ctrl = ev.state & ControlMask; |
283 | meta = (ev.state & ModMetaMask); |
295 | meta = ev.state & ModMetaMask; |
284 | |
296 | |
285 | if (numlock_state || (ev.state & ModNumLockMask)) |
297 | if (numlock_state || (ev.state & ModNumLockMask)) |
286 | { |
298 | { |
287 | numlock_state = (ev.state & ModNumLockMask); |
299 | numlock_state = (ev.state & ModNumLockMask); |
288 | PrivMode ((!numlock_state), PrivMode_aplKP); |
300 | PrivMode ((!numlock_state), PrivMode_aplKP); |
… | |
… | |
308 | |
320 | |
309 | // the XOpenIM manpage lies about hardcoding the locale |
321 | // the XOpenIM manpage lies about hardcoding the locale |
310 | // at the point of XOpenIM, so temporarily switch locales |
322 | // at the point of XOpenIM, so temporarily switch locales |
311 | if (rs[Rs_imLocale]) |
323 | if (rs[Rs_imLocale]) |
312 | SET_LOCALE (rs[Rs_imLocale]); |
324 | SET_LOCALE (rs[Rs_imLocale]); |
|
|
325 | |
313 | // assume wchar_t == unicode or better |
326 | // assume wchar_t == unicode or better |
314 | len = XwcLookupString (Input_Context, &ev, wkbuf, |
327 | len = XwcLookupString (Input_Context, &ev, wkbuf, |
315 | KBUFSZ, &keysym, &status_return); |
328 | KBUFSZ, &keysym, &status_return); |
|
|
329 | |
316 | if (rs[Rs_imLocale]) |
330 | if (rs[Rs_imLocale]) |
317 | SET_LOCALE (locale); |
331 | SET_LOCALE (locale); |
318 | |
332 | |
319 | if (status_return == XLookupChars |
333 | if (status_return == XLookupChars |
320 | || status_return == XLookupBoth) |
334 | || status_return == XLookupBoth) |
… | |
… | |
512 | else |
526 | else |
513 | strcpy (kbuf, key_backspace); |
527 | strcpy (kbuf, key_backspace); |
514 | break; |
528 | break; |
515 | #endif |
529 | #endif |
516 | #ifndef NO_DELETE_KEY |
530 | #ifndef NO_DELETE_KEY |
|
|
531 | # ifdef XK_KP_Prior |
|
|
532 | case XK_KP_Delete: |
|
|
533 | /* allow shift to override */ |
|
|
534 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
|
|
535 | { |
|
|
536 | strcpy (kbuf, "\033On"); |
|
|
537 | break; |
|
|
538 | } |
|
|
539 | /* FALLTHROUGH */ |
|
|
540 | # endif |
517 | case XK_Delete: |
541 | case XK_Delete: |
518 | strcpy (kbuf, key_delete); |
542 | strcpy (kbuf, key_delete); |
519 | break; |
543 | break; |
520 | #endif |
544 | #endif |
521 | case XK_Tab: |
545 | case XK_Tab: |
… | |
… | |
624 | #ifdef XK_KP_Begin |
648 | #ifdef XK_KP_Begin |
625 | case XK_KP_Begin: |
649 | case XK_KP_Begin: |
626 | strcpy (kbuf, "\033Ou"); |
650 | strcpy (kbuf, "\033Ou"); |
627 | break; |
651 | break; |
628 | |
652 | |
629 | case XK_KP_Insert: |
|
|
630 | strcpy (kbuf, "\033Op"); |
|
|
631 | break; |
|
|
632 | |
|
|
633 | case XK_KP_Delete: |
|
|
634 | strcpy (kbuf, "\033On"); |
|
|
635 | break; |
|
|
636 | #endif |
653 | #endif |
637 | case XK_KP_F1: /* "\033OP" */ |
654 | case XK_KP_F1: /* "\033OP" */ |
638 | case XK_KP_F2: /* "\033OQ" */ |
655 | case XK_KP_F2: /* "\033OQ" */ |
639 | case XK_KP_F3: /* "\033OR" */ |
656 | case XK_KP_F3: /* "\033OR" */ |
640 | case XK_KP_F4: /* "\033OS" */ |
657 | case XK_KP_F4: /* "\033OS" */ |
… | |
… | |
672 | break; |
689 | break; |
673 | |
690 | |
674 | case XK_Find: |
691 | case XK_Find: |
675 | strcpy (kbuf, "\033[1~"); |
692 | strcpy (kbuf, "\033[1~"); |
676 | break; |
693 | break; |
|
|
694 | |
|
|
695 | #ifdef XK_KP_End |
|
|
696 | case XK_KP_Insert: |
|
|
697 | /* allow shift to override */ |
|
|
698 | if ((priv_modes & PrivMode_aplKP) ? !shft : shft) |
|
|
699 | { |
|
|
700 | strcpy (kbuf, "\033Op"); |
|
|
701 | break; |
|
|
702 | } |
|
|
703 | /* FALLTHROUGH */ |
|
|
704 | #endif |
677 | case XK_Insert: |
705 | case XK_Insert: |
678 | strcpy (kbuf, "\033[2~"); |
706 | strcpy (kbuf, "\033[2~"); |
679 | break; |
707 | break; |
680 | #ifdef DXK_Remove /* support for DEC remove like key */ |
708 | #ifdef DXK_Remove /* support for DEC remove like key */ |
681 | case DXK_Remove: |
709 | case DXK_Remove: |
… | |
… | |
1308 | button_release (ev.xbutton); |
1336 | button_release (ev.xbutton); |
1309 | break; |
1337 | break; |
1310 | |
1338 | |
1311 | case ClientMessage: |
1339 | case ClientMessage: |
1312 | if (ev.xclient.format == 32 |
1340 | if (ev.xclient.format == 32 |
|
|
1341 | && ev.xclient.message_type == xa[XA_WM_PROTOCOLS]) |
|
|
1342 | { |
1313 | && (Atom)ev.xclient.data.l[0] == xa[XA_WMDELETEWINDOW]) |
1343 | if (ev.xclient.data.l[0] == xa[XA_WM_DELETE_WINDOW]) |
1314 | destroy (); |
1344 | destroy (); |
|
|
1345 | #if ENABLE_EWMH |
|
|
1346 | else if (ev.xclient.data.l[0] == xa[XA_NET_WM_PING]) |
|
|
1347 | XSendEvent (disp, ev.xclient.window = display->root, |
|
|
1348 | False, SubstructureRedirectMask | SubstructureNotifyMask, |
|
|
1349 | &ev); |
|
|
1350 | #endif |
|
|
1351 | } |
|
|
1352 | #if ENABLE_XEMBED |
|
|
1353 | else if (ev.xclient.format == 32 && ev.xclient.message_type == xa[XA_XEMBED]) |
|
|
1354 | { |
|
|
1355 | if (ev.xclient.data.l[1] == XEMBED_FOCUS_IN) |
|
|
1356 | focus_in (); |
|
|
1357 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
|
|
1358 | focus_out (); |
|
|
1359 | } |
|
|
1360 | #endif |
1315 | #ifdef OFFIX_DND |
1361 | #ifdef OFFIX_DND |
1316 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1362 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1317 | else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] |
1363 | else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] |
1318 | && (ev.xclient.data.l[0] == DndFile |
1364 | && (ev.xclient.data.l[0] == DndFile |
1319 | || ev.xclient.data.l[0] == DndDir |
1365 | || ev.xclient.data.l[0] == DndDir |
1320 | || ev.xclient.data.l[0] == DndLink)) |
1366 | || ev.xclient.data.l[0] == DndLink)) |
1321 | { |
1367 | { |
1322 | /* Get Dnd data */ |
1368 | /* Get Dnd data */ |
1323 | Atom ActualType; |
1369 | Atom ActualType; |
1324 | int ActualFormat; |
1370 | int ActualFormat; |
1325 | unsigned char *data; |
1371 | unsigned char *data; |
… | |
… | |
1368 | break; |
1414 | break; |
1369 | } |
1415 | } |
1370 | break; |
1416 | break; |
1371 | |
1417 | |
1372 | case FocusIn: |
1418 | case FocusIn: |
1373 | if (!TermWin.focus) |
1419 | focus_in (); |
1374 | { |
|
|
1375 | TermWin.focus = 1; |
|
|
1376 | want_refresh = 1; |
|
|
1377 | #ifdef USE_XIM |
|
|
1378 | if (Input_Context != NULL) |
|
|
1379 | { |
|
|
1380 | IMSetStatusPosition (); |
|
|
1381 | XSetICFocus (Input_Context); |
|
|
1382 | } |
|
|
1383 | #endif |
|
|
1384 | #ifdef CURSOR_BLINK |
|
|
1385 | if (options & Opt_cursorBlink) |
|
|
1386 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
|
|
1387 | #endif |
|
|
1388 | #ifdef OFF_FOCUS_FADING |
|
|
1389 | if (rs[Rs_fade]) |
|
|
1390 | { |
|
|
1391 | pix_colors = pix_colors_focused; |
|
|
1392 | scr_recolour (); |
|
|
1393 | } |
|
|
1394 | #endif |
|
|
1395 | |
|
|
1396 | } |
|
|
1397 | break; |
1420 | break; |
1398 | |
1421 | |
1399 | case FocusOut: |
1422 | case FocusOut: |
1400 | if (TermWin.focus) |
1423 | focus_out (); |
1401 | { |
|
|
1402 | TermWin.focus = 0; |
|
|
1403 | want_refresh = 1; |
|
|
1404 | |
|
|
1405 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1406 | iso14755buf = 0; |
|
|
1407 | #endif |
|
|
1408 | #if ENABLE_OVERLAY |
|
|
1409 | scr_overlay_off (); |
|
|
1410 | #endif |
|
|
1411 | #ifdef USE_XIM |
|
|
1412 | if (Input_Context != NULL) |
|
|
1413 | XUnsetICFocus (Input_Context); |
|
|
1414 | #endif |
|
|
1415 | #ifdef CURSOR_BLINK |
|
|
1416 | if (options & Opt_cursorBlink) |
|
|
1417 | cursor_blink_ev.stop (); |
|
|
1418 | hidden_cursor = 0; |
|
|
1419 | #endif |
|
|
1420 | #ifdef OFF_FOCUS_FADING |
|
|
1421 | if (rs[Rs_fade]) |
|
|
1422 | { |
|
|
1423 | pix_colors = pix_colors_unfocused; |
|
|
1424 | scr_recolour (); |
|
|
1425 | } |
|
|
1426 | #endif |
|
|
1427 | } |
|
|
1428 | break; |
1424 | break; |
1429 | |
1425 | |
1430 | case ConfigureNotify: |
1426 | case ConfigureNotify: |
1431 | if (ev.xconfigure.window == TermWin.parent[0]) |
1427 | if (ev.xconfigure.window == TermWin.parent[0]) |
1432 | { |
1428 | { |
… | |
… | |
1646 | scr_refresh (refresh_type); |
1642 | scr_refresh (refresh_type); |
1647 | refresh_limit = 0; |
1643 | refresh_limit = 0; |
1648 | scrollbar_show (1); |
1644 | scrollbar_show (1); |
1649 | } |
1645 | } |
1650 | break; |
1646 | break; |
|
|
1647 | } |
|
|
1648 | } |
|
|
1649 | |
|
|
1650 | void |
|
|
1651 | rxvt_term::focus_in () |
|
|
1652 | { |
|
|
1653 | if (!TermWin.focus) |
|
|
1654 | { |
|
|
1655 | TermWin.focus = 1; |
|
|
1656 | want_refresh = 1; |
|
|
1657 | #ifdef USE_XIM |
|
|
1658 | if (Input_Context != NULL) |
|
|
1659 | { |
|
|
1660 | IMSetStatusPosition (); |
|
|
1661 | XSetICFocus (Input_Context); |
|
|
1662 | } |
|
|
1663 | #endif |
|
|
1664 | #ifdef CURSOR_BLINK |
|
|
1665 | if (options & Opt_cursorBlink) |
|
|
1666 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
|
|
1667 | #endif |
|
|
1668 | #ifdef OFF_FOCUS_FADING |
|
|
1669 | if (rs[Rs_fade]) |
|
|
1670 | { |
|
|
1671 | pix_colors = pix_colors_focused; |
|
|
1672 | scr_recolour (); |
|
|
1673 | } |
|
|
1674 | #endif |
|
|
1675 | } |
|
|
1676 | } |
|
|
1677 | |
|
|
1678 | void |
|
|
1679 | rxvt_term::focus_out () |
|
|
1680 | { |
|
|
1681 | if (TermWin.focus) |
|
|
1682 | { |
|
|
1683 | TermWin.focus = 0; |
|
|
1684 | want_refresh = 1; |
|
|
1685 | |
|
|
1686 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1687 | iso14755buf = 0; |
|
|
1688 | #endif |
|
|
1689 | #if ENABLE_OVERLAY |
|
|
1690 | scr_overlay_off (); |
|
|
1691 | #endif |
|
|
1692 | #ifdef USE_XIM |
|
|
1693 | if (Input_Context != NULL) |
|
|
1694 | XUnsetICFocus (Input_Context); |
|
|
1695 | #endif |
|
|
1696 | #ifdef CURSOR_BLINK |
|
|
1697 | if (options & Opt_cursorBlink) |
|
|
1698 | cursor_blink_ev.stop (); |
|
|
1699 | hidden_cursor = 0; |
|
|
1700 | #endif |
|
|
1701 | #ifdef OFF_FOCUS_FADING |
|
|
1702 | if (rs[Rs_fade]) |
|
|
1703 | { |
|
|
1704 | pix_colors = pix_colors_unfocused; |
|
|
1705 | scr_recolour (); |
|
|
1706 | } |
|
|
1707 | #endif |
1651 | } |
1708 | } |
1652 | } |
1709 | } |
1653 | |
1710 | |
1654 | #if TRANSPARENT |
1711 | #if TRANSPARENT |
1655 | void |
1712 | void |
… | |
… | |
2580 | // some window managers resize the window early, and these programs |
2637 | // some window managers resize the window early, and these programs |
2581 | // then sometimes get the size wrong. |
2638 | // then sometimes get the size wrong. |
2582 | // unfortunately other programs are even more buggy and dislike |
2639 | // unfortunately other programs are even more buggy and dislike |
2583 | // being sent SIGWINCH, so only do it when we were in fact being |
2640 | // being sent SIGWINCH, so only do it when we were in fact being |
2584 | // resized. |
2641 | // resized. |
2585 | if (seen_resize) |
2642 | if (seen_resize && cmd_pid) |
2586 | kill (-cmd_pid, SIGWINCH); |
2643 | kill (-cmd_pid, SIGWINCH); |
2587 | } |
2644 | } |
2588 | |
2645 | |
2589 | /* Read a text string from the input buffer */ |
2646 | /* Read a text string from the input buffer */ |
2590 | unicode_t buf[UBUFSIZ]; |
2647 | unicode_t buf[UBUFSIZ]; |
2591 | bool refreshnow = false; |
2648 | bool refreshnow = false; |
2592 | int nlines = 0; |
2649 | int nlines = 0; |
2593 | unicode_t *str = buf; |
2650 | unicode_t *str = buf; |
|
|
2651 | unicode_t *eol = str + min (TermWin.ncol, UBUFSIZ); |
2594 | |
2652 | |
2595 | for (;;) |
2653 | for (;;) |
2596 | { |
2654 | { |
2597 | if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)) |
2655 | if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)) |
2598 | break; |
2656 | break; |
2599 | |
2657 | |
2600 | *str++ = ch; |
2658 | *str++ = ch; |
2601 | |
2659 | |
2602 | if (ch == C0_LF) |
2660 | if (ch == C0_LF || str >= eol) |
2603 | { |
2661 | { |
|
|
2662 | if (ch == C0_LF) |
2604 | nlines++; |
2663 | nlines++; |
|
|
2664 | |
2605 | refresh_count++; |
2665 | refresh_count++; |
2606 | |
2666 | |
2607 | if (!(options & Opt_jumpScroll) |
2667 | if (!(options & Opt_jumpScroll) |
2608 | || (refresh_count >= refresh_limit * (TermWin.nrow - 1))) |
2668 | || (refresh_count >= refresh_limit * (TermWin.nrow - 1))) |
2609 | { |
2669 | { |
… | |
… | |
2616 | if (nlines >= TermWin.nrow - 1) |
2676 | if (nlines >= TermWin.nrow - 1) |
2617 | { |
2677 | { |
2618 | scr_add_lines (buf, nlines, str - buf); |
2678 | scr_add_lines (buf, nlines, str - buf); |
2619 | nlines = 0; |
2679 | nlines = 0; |
2620 | str = buf; |
2680 | str = buf; |
|
|
2681 | eol = str + min (TermWin.ncol, UBUFSIZ); |
2621 | } |
2682 | } |
2622 | } |
|
|
2623 | |
2683 | |
2624 | if (str >= buf + UBUFSIZ) |
2684 | if (str >= eol) |
2625 | { |
2685 | { |
|
|
2686 | if (eol >= buf + UBUFSIZ) |
|
|
2687 | { |
2626 | ch = NOCHAR; |
2688 | ch = NOCHAR; |
2627 | break; |
2689 | break; |
|
|
2690 | } |
|
|
2691 | else |
|
|
2692 | eol = min (eol + TermWin.ncol, buf + UBUFSIZ); |
|
|
2693 | } |
|
|
2694 | |
2628 | } |
2695 | } |
2629 | |
2696 | |
2630 | seq_begin = cmdbuf_ptr; |
2697 | seq_begin = cmdbuf_ptr; |
2631 | ch = next_char (); |
2698 | ch = next_char (); |
2632 | } |
2699 | } |
… | |
… | |
3537 | else if (ch < 0x20) |
3604 | else if (ch < 0x20) |
3538 | return NULL; /* other control character - exit */ |
3605 | return NULL; /* other control character - exit */ |
3539 | |
3606 | |
3540 | seen_esc = false; |
3607 | seen_esc = false; |
3541 | |
3608 | |
3542 | if (n >= sizeof (string) - 1) |
3609 | if (n >= STRING_MAX - 1) |
3543 | // stop at some sane length |
3610 | // stop at some sane length |
3544 | return NULL; |
3611 | return NULL; |
3545 | |
3612 | |
3546 | if (ch == C0_SYN) |
3613 | if (ch == C0_SYN) |
3547 | string[n++] = cmd_get8 (); |
3614 | string[n++] = cmd_get8 (); |
… | |
… | |
3615 | set_window_color (color, str); |
3682 | set_window_color (color, str); |
3616 | } |
3683 | } |
3617 | |
3684 | |
3618 | /* |
3685 | /* |
3619 | * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) |
3686 | * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) |
3620 | * 0 = change iconName/title |
|
|
3621 | * 1 = change iconName |
|
|
3622 | * 2 = change title |
|
|
3623 | * 4 = change color |
|
|
3624 | * 10 = change fg color |
|
|
3625 | * 11 = change bg color |
|
|
3626 | * 12 = change text color |
|
|
3627 | * 13 = change mouse foreground color |
|
|
3628 | * 17 = change highlight character colour |
|
|
3629 | * 18 = change bold character color |
|
|
3630 | * 19 = change underlined character color |
|
|
3631 | * 46 = change logfile (not implemented) |
|
|
3632 | * 50 = change font |
|
|
3633 | * |
|
|
3634 | * rxvt extensions: |
|
|
3635 | * 20 = bg pixmap |
|
|
3636 | * 39 = change default fg color |
|
|
3637 | * 49 = change default bg color |
|
|
3638 | * 55 = dump scrollback buffer and all of screen |
|
|
3639 | * 701 = change locale |
|
|
3640 | * 702 = find font |
|
|
3641 | * 703 = menu |
|
|
3642 | */ |
3687 | */ |
3643 | void |
3688 | void |
3644 | rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) |
3689 | rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) |
3645 | { |
3690 | { |
3646 | int changed = 0; |
3691 | int changed = 0; |
… | |
… | |
3745 | break; |
3790 | break; |
3746 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3791 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3747 | case XTerm_Color_BD: |
3792 | case XTerm_Color_BD: |
3748 | process_color_seq (XTerm_Color_BD, Color_BD, str, resp); |
3793 | process_color_seq (XTerm_Color_BD, Color_BD, str, resp); |
3749 | break; |
3794 | break; |
3750 | case XTerm_Color_IT: |
|
|
3751 | process_color_seq (XTerm_Color_IT, Color_IT, str, resp); |
|
|
3752 | break; |
|
|
3753 | case XTerm_Color_UL: |
3795 | case XTerm_Color_UL: |
3754 | process_color_seq (XTerm_Color_UL, Color_UL, str, resp); |
3796 | process_color_seq (XTerm_Color_UL, Color_UL, str, resp); |
3755 | break; |
3797 | break; |
3756 | case XTerm_Color_RV: |
3798 | case XTerm_Color_RV: |
3757 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3799 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3758 | break; |
3800 | break; |
|
|
3801 | case URxvt_Color_IT: |
|
|
3802 | process_color_seq (URxvt_Color_IT, Color_IT, str, resp); |
|
|
3803 | break; |
3759 | #endif |
3804 | #endif |
3760 | #if TRANSPARENT && TINTING |
3805 | #if TRANSPARENT && TINTING |
3761 | case XTerm_Color_tint: |
3806 | case URxvt_Color_tint: |
3762 | process_color_seq (XTerm_Color_tint, Color_tint, str, resp); |
3807 | process_color_seq (URxvt_Color_tint, Color_tint, str, resp); |
3763 | check_our_parents (); |
3808 | check_our_parents (); |
3764 | if (am_transparent) |
3809 | if (am_transparent) |
3765 | want_full_refresh = want_refresh = 1; |
3810 | want_full_refresh = want_refresh = 1; |
3766 | break; |
3811 | break; |
3767 | #endif |
3812 | #endif |
… | |
… | |
3801 | |
3846 | |
3802 | case XTerm_logfile: |
3847 | case XTerm_logfile: |
3803 | // TODO, when secure mode? |
3848 | // TODO, when secure mode? |
3804 | break; |
3849 | break; |
3805 | |
3850 | |
|
|
3851 | #ifdef MENUBAR |
|
|
3852 | case URxvt_Menu: |
|
|
3853 | if (options & Opt_insecure) |
|
|
3854 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
|
|
3855 | break; |
|
|
3856 | #endif |
|
|
3857 | #if 0 |
|
|
3858 | case XTerm_dumpscreen: /* no error notices */ |
|
|
3859 | { |
|
|
3860 | int fd; |
|
|
3861 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
|
|
3862 | { |
|
|
3863 | scr_dump (fd); |
|
|
3864 | close (fd); |
|
|
3865 | } |
|
|
3866 | } |
|
|
3867 | break; |
|
|
3868 | #endif |
3806 | case XTerm_font: |
3869 | case XTerm_font: |
3807 | op = URxvt_font; |
3870 | op = URxvt_font; |
3808 | case URxvt_font: |
3871 | case URxvt_font: |
3809 | #if ENABLE_STYLES |
3872 | #if ENABLE_STYLES |
3810 | case URxvt_boldFont: |
3873 | case URxvt_boldFont: |
… | |
… | |
3825 | set_fonts (); |
3888 | set_fonts (); |
3826 | } |
3889 | } |
3827 | break; |
3890 | break; |
3828 | |
3891 | |
3829 | #if ENABLE_FRILLS |
3892 | #if ENABLE_FRILLS |
3830 | case XTerm_locale: |
3893 | case URxvt_locale: |
3831 | if (query) |
3894 | if (query) |
3832 | tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); |
3895 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3833 | else |
3896 | else |
3834 | { |
3897 | { |
3835 | set_locale (str); |
3898 | set_locale (str); |
3836 | pty.set_utf8_mode (enc_utf8); |
3899 | pty.set_utf8_mode (enc_utf8); |
3837 | # ifdef USE_XIM |
|
|
3838 | im_cb (); |
3900 | init_xlocale (); |
3839 | # endif |
|
|
3840 | } |
3901 | } |
3841 | break; |
3902 | break; |
3842 | #endif |
|
|
3843 | |
3903 | |
3844 | #ifdef MENUBAR |
3904 | case URxvt_view_up: |
3845 | case XTerm_Menu: |
3905 | case URxvt_view_down: |
3846 | if (options & Opt_insecure) |
3906 | int lines = atoi (str); |
3847 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3907 | |
3848 | break; |
3908 | if (lines) |
3849 | #endif |
3909 | scr_page (op == URxvt_view_up ? UP : DN, lines); |
3850 | #if 0 |
|
|
3851 | case XTerm_dumpscreen: /* no error notices */ |
|
|
3852 | { |
3910 | else |
3853 | int fd; |
|
|
3854 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
|
|
3855 | { |
3911 | { |
3856 | scr_dump (fd); |
3912 | scr_erase_savelines (); |
3857 | close (fd); |
|
|
3858 | } |
3913 | } |
3859 | } |
3914 | |
3860 | break; |
3915 | break; |
3861 | #endif |
3916 | #endif |
3862 | } |
3917 | } |
3863 | } |
3918 | } |
3864 | /*----------------------------------------------------------------------*/ |
3919 | /*----------------------------------------------------------------------*/ |