… | |
… | |
227 | # if !UNICODE3 |
227 | # if !UNICODE3 |
228 | if (ch >= 0x10000) |
228 | if (ch >= 0x10000) |
229 | ch = 0xfffd; |
229 | ch = 0xfffd; |
230 | # endif |
230 | # endif |
231 | scr_overlay_set (11, y, ch, r); |
231 | scr_overlay_set (11, y, ch, r); |
|
|
232 | |
|
|
233 | if (WCWIDTH (ch) >= 2) |
232 | scr_overlay_set (12, y, NOCHAR, r); |
234 | scr_overlay_set (12, y, NOCHAR, r); |
233 | } |
235 | } |
234 | |
236 | |
|
|
237 | // { |
|
|
238 | // char buf[4+4+3+1]; |
|
|
239 | // snprintf (buf, sizeof (buf), "(%.4d|%.4d)", x, y); |
|
|
240 | // scr_overlay_set (0, 0, buf); |
|
|
241 | // } |
235 | scr_overlay_set (0, len , attr); |
242 | scr_overlay_set (0, len , attr); |
236 | scr_overlay_set (0, len + 1, fname); |
243 | scr_overlay_set (0, len + 1, fname); |
237 | |
244 | |
238 | free (fname); |
245 | free (fname); |
239 | |
246 | |
… | |
… | |
1164 | } |
1171 | } |
1165 | |
1172 | |
1166 | void |
1173 | void |
1167 | rxvt_term::pointer_unblank () |
1174 | rxvt_term::pointer_unblank () |
1168 | { |
1175 | { |
1169 | XDefineCursor (display->display, vt, TermWin_cursor); |
1176 | XDefineCursor (xdisp, vt, TermWin_cursor); |
1170 | recolour_cursor (); |
1177 | recolour_cursor (); |
1171 | |
1178 | |
1172 | #ifdef POINTER_BLANK |
1179 | #ifdef POINTER_BLANK |
1173 | hidden_pointer = 0; |
1180 | hidden_pointer = 0; |
1174 | |
1181 | |
… | |
… | |
1182 | rxvt_term::pointer_blank () |
1189 | rxvt_term::pointer_blank () |
1183 | { |
1190 | { |
1184 | if (!OPTION (Opt_pointerBlank)) |
1191 | if (!OPTION (Opt_pointerBlank)) |
1185 | return; |
1192 | return; |
1186 | |
1193 | |
1187 | XDefineCursor (display->display, vt, display->blank_cursor); |
1194 | XDefineCursor (xdisp, vt, display->blank_cursor); |
1188 | XFlush (display->display); |
1195 | XFlush (xdisp); |
1189 | |
1196 | |
1190 | hidden_pointer = 1; |
1197 | hidden_pointer = 1; |
1191 | } |
1198 | } |
1192 | |
1199 | |
1193 | void |
1200 | void |
… | |
… | |
2455 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
2462 | 0L, 1L, False, XA_PIXMAP, &atype, &aformat, |
2456 | &nitems, &bytes_after, &prop) == Success); |
2463 | &nitems, &bytes_after, &prop) == Success); |
2457 | |
2464 | |
2458 | if (!i || prop == NULL |
2465 | if (!i || prop == NULL |
2459 | #if TINTING |
2466 | #if TINTING |
2460 | || !rs[Rs_color + Color_tint] |
2467 | || !ISSET_PIXCOLOR (Color_tint) |
2461 | #endif |
2468 | #endif |
2462 | ) |
2469 | ) |
2463 | have_pixmap = 0; |
2470 | have_pixmap = 0; |
2464 | else |
2471 | else |
2465 | { |
2472 | { |
… | |
… | |
2531 | XFreePixmap (xdisp, pixmap); |
2538 | XFreePixmap (xdisp, pixmap); |
2532 | |
2539 | |
2533 | #if TINTING |
2540 | #if TINTING |
2534 | if (ISSET_PIXCOLOR (Color_tint)) |
2541 | if (ISSET_PIXCOLOR (Color_tint)) |
2535 | { |
2542 | { |
2536 | unsigned short rm, gm, bm; |
|
|
2537 | int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
2543 | int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100; |
2538 | |
2544 | |
|
|
2545 | rgba c; |
2539 | pix_colors_focused[Color_tint].get (this, rm, gm, bm); |
2546 | pix_colors_focused [Color_tint].get (this, c); |
2540 | |
2547 | |
2541 | ShadeXImage (this, image, shade, rm, gm, bm); |
2548 | ShadeXImage (this, image, shade, c.r, c.g, c.b); |
2542 | } |
2549 | } |
2543 | #endif |
2550 | #endif |
2544 | |
2551 | |
2545 | pixmap = XCreatePixmap (xdisp, vt, szHint.width, szHint.height, image->depth); |
2552 | pixmap = XCreatePixmap (xdisp, vt, szHint.width, szHint.height, image->depth); |
2546 | gc = XCreateGC (xdisp, vt, 0UL, &gcvalue); |
2553 | gc = XCreateGC (xdisp, vt, 0UL, &gcvalue); |
… | |
… | |
2567 | * InheritPixmap transparency |
2574 | * InheritPixmap transparency |
2568 | */ |
2575 | */ |
2569 | for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
2576 | for (i = 1; i < (int) (sizeof (parent) / sizeof (Window)); i++) |
2570 | { |
2577 | { |
2571 | oldp = parent[i]; |
2578 | oldp = parent[i]; |
2572 | XQueryTree (xdisp, parent[i - 1], &root, |
2579 | XQueryTree (xdisp, parent[i - 1], &root, &parent[i], &list, &n); |
2573 | &parent[i], &list, &n); |
|
|
2574 | XFree (list); |
2580 | XFree (list); |
2575 | |
2581 | |
2576 | if (parent[i] == display->root) |
2582 | if (parent[i] == display->root) |
2577 | { |
2583 | { |
2578 | if (oldp != None) |
2584 | if (oldp != None) |
… | |
… | |
2586 | } |
2592 | } |
2587 | |
2593 | |
2588 | n = 0; |
2594 | n = 0; |
2589 | |
2595 | |
2590 | if (pchanged) |
2596 | if (pchanged) |
2591 | { |
|
|
2592 | for (; n < (unsigned int)i; n++) |
2597 | for (; n < (unsigned int)i; n++) |
2593 | { |
2598 | { |
2594 | XGetWindowAttributes (xdisp, parent[n], &wattr); |
2599 | XGetWindowAttributes (xdisp, parent[n], &wattr); |
|
|
2600 | |
2595 | if (wattr.depth != rootdepth || wattr.c_class == InputOnly) |
2601 | if (wattr.depth != rootdepth || wattr.c_class == InputOnly) |
2596 | { |
2602 | { |
2597 | n = (int) (sizeof (parent) / sizeof (Window)) + 1; |
2603 | n = (int) (sizeof (parent) / sizeof (Window)) + 1; |
2598 | break; |
2604 | break; |
2599 | } |
2605 | } |
2600 | } |
2606 | } |
2601 | } |
|
|
2602 | |
2607 | |
2603 | if (n > (int) (sizeof (parent) / sizeof (parent[0]))) |
2608 | if (n > (sizeof (parent) / sizeof (parent[0]))) |
2604 | { |
2609 | { |
2605 | XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]); |
2610 | XSetWindowBackground (xdisp, parent[0], pix_colors_focused[Color_border]); |
2606 | XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]); |
2611 | XSetWindowBackground (xdisp, vt, pix_colors_focused[Color_bg]); |
2607 | am_transparent = 0; |
2612 | am_transparent = 0; |
2608 | /* XXX: also turn off Opt_transparent? */ |
2613 | /* XXX: also turn off Opt_transparent? */ |
… | |
… | |
3084 | scr_charset_set (2, (unsigned int)cmd_getc ()); |
3089 | scr_charset_set (2, (unsigned int)cmd_getc ()); |
3085 | break; |
3090 | break; |
3086 | case '+': |
3091 | case '+': |
3087 | scr_charset_set (3, (unsigned int)cmd_getc ()); |
3092 | scr_charset_set (3, (unsigned int)cmd_getc ()); |
3088 | break; |
3093 | break; |
3089 | #if ENABLE_FRILLS |
3094 | #if !ENABLE_MINIMAL |
3090 | case '6': |
3095 | case '6': |
3091 | scr_backindex (); |
3096 | scr_backindex (); |
3092 | break; |
3097 | break; |
3093 | #endif |
3098 | #endif |
3094 | case '7': |
3099 | case '7': |
3095 | scr_cursor (SAVE); |
3100 | scr_cursor (SAVE); |
3096 | break; |
3101 | break; |
3097 | case '8': |
3102 | case '8': |
3098 | scr_cursor (RESTORE); |
3103 | scr_cursor (RESTORE); |
3099 | break; |
3104 | break; |
3100 | #if ENABLE_FRILLS |
3105 | #if !ENABLE_MINIMAL |
3101 | case '9': |
3106 | case '9': |
3102 | scr_forwardindex (); |
3107 | scr_forwardindex (); |
3103 | break; |
3108 | break; |
3104 | #endif |
3109 | #endif |
3105 | case '=': |
3110 | case '=': |
… | |
… | |
3278 | { |
3283 | { |
3279 | case '>': |
3284 | case '>': |
3280 | if (ch == CSI_DA) /* secondary device attributes */ |
3285 | if (ch == CSI_DA) /* secondary device attributes */ |
3281 | { |
3286 | { |
3282 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
3287 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
3283 | // 'U' for rxvt-unicode <= 7.2, and Mm85 (e.g. 7385 for 7.3) for later versions. |
3288 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
3284 | // |
3289 | // |
3285 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
3290 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
3286 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
3291 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
3287 | // that we do not support xterm mouse reporting (should be 95 when we do). |
3292 | // that we do not support xterm mouse reporting (should be 95 when we do). |
3288 | // |
3293 | // |
3289 | tt_printf ("\033[>%c%c85;94;0c", VERSION[0], VERSION[1]); |
3294 | tt_printf ("\033[>%d;94;0c", 'U'); |
3290 | } |
3295 | } |
3291 | break; |
3296 | break; |
3292 | case '?': |
3297 | case '?': |
3293 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
3298 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
3294 | process_terminal_mode (ch, priv, nargs, arg); |
3299 | process_terminal_mode (ch, priv, nargs, arg); |
… | |
… | |
3498 | break; |
3503 | break; |
3499 | case CSI_75: |
3504 | case CSI_75: |
3500 | scr_cursor (RESTORE); |
3505 | scr_cursor (RESTORE); |
3501 | break; |
3506 | break; |
3502 | |
3507 | |
3503 | #if ENABLE_FRILLS |
3508 | #if !ENABLE_MINIMAL |
3504 | case CSI_74: |
3509 | case CSI_74: |
3505 | process_window_ops (arg, nargs); |
3510 | process_window_ops (arg, nargs); |
3506 | break; |
3511 | break; |
3507 | #endif |
3512 | #endif |
3508 | |
3513 | |
… | |
… | |
3515 | break; |
3520 | break; |
3516 | } |
3521 | } |
3517 | } |
3522 | } |
3518 | /*}}} */ |
3523 | /*}}} */ |
3519 | |
3524 | |
3520 | #if ENABLE_FRILLS |
3525 | #if !ENABLE_MINIMAL |
3521 | /* ARGSUSED */ |
3526 | /* ARGSUSED */ |
3522 | void |
3527 | void |
3523 | rxvt_term::process_window_ops (const int *args, unsigned int nargs) |
3528 | rxvt_term::process_window_ops (const int *args, unsigned int nargs) |
3524 | { |
3529 | { |
3525 | int x, y; |
3530 | int x, y; |
… | |
… | |
3566 | default: |
3571 | default: |
3567 | if (args[0] >= 24) /* set height (chars) */ |
3572 | if (args[0] >= 24) /* set height (chars) */ |
3568 | set_widthheight ((unsigned int)width, |
3573 | set_widthheight ((unsigned int)width, |
3569 | (unsigned int) (args[1] * fheight)); |
3574 | (unsigned int) (args[1] * fheight)); |
3570 | break; |
3575 | break; |
3571 | |
|
|
3572 | |
3576 | |
3573 | /* |
3577 | /* |
3574 | * reports - some output format copied from XTerm |
3578 | * reports - some output format copied from XTerm |
3575 | */ |
3579 | */ |
3576 | case 11: /* report window state */ |
3580 | case 11: /* report window state */ |
… | |
… | |
3714 | void |
3718 | void |
3715 | rxvt_term::process_color_seq (int report, int color, const char *str, char resp) |
3719 | rxvt_term::process_color_seq (int report, int color, const char *str, char resp) |
3716 | { |
3720 | { |
3717 | if (str[0] == '?' && !str[1]) |
3721 | if (str[0] == '?' && !str[1]) |
3718 | { |
3722 | { |
3719 | unsigned short r, g, b; |
3723 | rgba c; |
3720 | pix_colors_focused[color].get (this, r, g, b); |
3724 | pix_colors_focused[color].get (this, c); |
|
|
3725 | |
|
|
3726 | #if XFT |
|
|
3727 | if (c.a != rgba::MAX_CC) |
|
|
3728 | tt_printf ("\033]%d;rgba:%04x/%04x/%04x/%04x%c", report, c.a, c.r, c.g, c.b, resp); |
|
|
3729 | else |
|
|
3730 | #endif |
3721 | tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, r, g, b, resp); |
3731 | tt_printf ("\033]%d;rgb:%04x/%04x/%04x%c", report, c.r, c.g, c.b, resp); |
3722 | } |
3732 | } |
3723 | else |
3733 | else |
3724 | set_window_color (color, str); |
3734 | set_window_color (color, str); |
3725 | } |
3735 | } |
3726 | |
3736 | |
… | |
… | |
3767 | &nitems, &bytes_after, &value) == Success |
3777 | &nitems, &bytes_after, &value) == Success |
3768 | && actual_type != None |
3778 | && actual_type != None |
3769 | && actual_format == 8) |
3779 | && actual_format == 8) |
3770 | str = (const char *)(value); |
3780 | str = (const char *)(value); |
3771 | |
3781 | |
3772 | tt_printf ("\033]%d;%s%c", XTerm_property, str, resp); |
3782 | tt_printf ("\033]%d;%s%c", op, str, resp); |
3773 | |
3783 | |
3774 | XFree (value); |
3784 | XFree (value); |
3775 | } |
3785 | } |
3776 | else |
3786 | else |
3777 | { |
3787 | { |
… | |
… | |
3801 | break; |
3811 | break; |
3802 | |
3812 | |
3803 | if ((buf = strchr (name, ';')) != NULL) |
3813 | if ((buf = strchr (name, ';')) != NULL) |
3804 | *buf++ = '\0'; |
3814 | *buf++ = '\0'; |
3805 | |
3815 | |
3806 | if (name[0] == '?' && !name[1]) |
3816 | process_color_seq (op, color, name, resp); |
3807 | { |
|
|
3808 | unsigned short r, g, b; |
|
|
3809 | pix_colors_focused[color].get (this, r, g, b); |
|
|
3810 | tt_printf ("\033]%d;%d;rgb:%04x/%04x/%04x%c", XTerm_Color, color, r, g, b, resp); |
|
|
3811 | } |
|
|
3812 | else |
|
|
3813 | set_window_color (color, name); |
|
|
3814 | } |
3817 | } |
3815 | break; |
3818 | break; |
3816 | case XTerm_Color00: |
3819 | case XTerm_Color00: |
3817 | process_color_seq (XTerm_Color00, Color_fg, str, resp); |
3820 | process_color_seq (op, Color_fg, str, resp); |
3818 | break; |
3821 | break; |
3819 | case XTerm_Color01: |
3822 | case XTerm_Color01: |
3820 | process_color_seq (XTerm_Color01, Color_bg, str, resp); |
3823 | process_color_seq (op, Color_bg, str, resp); |
3821 | break; |
3824 | break; |
3822 | #ifndef NO_CURSORCOLOR |
3825 | #ifndef NO_CURSORCOLOR |
3823 | case XTerm_Color_cursor: |
3826 | case XTerm_Color_cursor: |
3824 | process_color_seq (XTerm_Color_cursor, Color_cursor, str, resp); |
3827 | process_color_seq (op, Color_cursor, str, resp); |
3825 | break; |
3828 | break; |
3826 | #endif |
3829 | #endif |
3827 | case XTerm_Color_pointer_fg: |
3830 | case XTerm_Color_pointer_fg: |
3828 | process_color_seq (XTerm_Color_pointer_fg, Color_pointer_fg, str, resp); |
3831 | process_color_seq (op, Color_pointer_fg, str, resp); |
3829 | break; |
3832 | break; |
3830 | case XTerm_Color_pointer_bg: |
3833 | case XTerm_Color_pointer_bg: |
3831 | process_color_seq (XTerm_Color_pointer_bg, Color_pointer_bg, str, resp); |
3834 | process_color_seq (op, Color_pointer_bg, str, resp); |
3832 | break; |
3835 | break; |
3833 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3836 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3834 | case XTerm_Color_RV: |
3837 | case XTerm_Color_RV: |
3835 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3838 | process_color_seq (op, Color_RV, str, resp); |
3836 | break; |
3839 | break; |
3837 | case Rxvt_Color_BD: |
3840 | case Rxvt_Color_BD: |
3838 | case URxvt_Color_BD: |
3841 | case URxvt_Color_BD: |
3839 | process_color_seq (op, Color_BD, str, resp); |
3842 | process_color_seq (op, Color_BD, str, resp); |
3840 | break; |
3843 | break; |
3841 | case Rxvt_Color_UL: |
3844 | case Rxvt_Color_UL: |
3842 | case URxvt_Color_UL: |
3845 | case URxvt_Color_UL: |
3843 | process_color_seq (op, Color_UL, str, resp); |
3846 | process_color_seq (op, Color_UL, str, resp); |
3844 | break; |
3847 | break; |
3845 | case URxvt_Color_IT: |
3848 | case URxvt_Color_IT: |
3846 | process_color_seq (URxvt_Color_IT, Color_IT, str, resp); |
3849 | process_color_seq (op, Color_IT, str, resp); |
3847 | break; |
3850 | break; |
3848 | #endif |
3851 | #endif |
3849 | #if TRANSPARENT && TINTING |
3852 | #if TRANSPARENT && TINTING |
3850 | case URxvt_Color_tint: |
3853 | case URxvt_Color_tint: |
3851 | process_color_seq (URxvt_Color_tint, Color_tint, str, resp); |
3854 | process_color_seq (op, Color_tint, str, resp); |
|
|
3855 | |
3852 | check_our_parents (); |
3856 | check_our_parents (); |
|
|
3857 | |
3853 | if (am_transparent) |
3858 | if (am_transparent) |
3854 | want_full_refresh = want_refresh = 1; |
3859 | want_full_refresh = want_refresh = 1; |
|
|
3860 | |
3855 | break; |
3861 | break; |
3856 | #endif |
3862 | #endif |
3857 | |
3863 | |
3858 | case Rxvt_Pixmap: |
3864 | case Rxvt_Pixmap: |
3859 | { |
3865 | { |
… | |
… | |
3930 | allocated.push_back ((void *)res); |
3936 | allocated.push_back ((void *)res); |
3931 | set_fonts (); |
3937 | set_fonts (); |
3932 | } |
3938 | } |
3933 | break; |
3939 | break; |
3934 | |
3940 | |
3935 | #if ENABLE_FRILLS |
3941 | case URxvt_version: |
|
|
3942 | if (query) |
|
|
3943 | tt_printf ("\33]%d;rxvt-unicode;%-.20s;%c;%c%c", |
|
|
3944 | op, |
|
|
3945 | rs[Rs_name], VERSION[0], VERSION[2], |
|
|
3946 | resp); |
|
|
3947 | break; |
|
|
3948 | |
|
|
3949 | #if !ENABLE_MINIMAL |
3936 | case URxvt_locale: |
3950 | case URxvt_locale: |
3937 | if (query) |
3951 | if (query) |
3938 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); |
3952 | tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); |
3939 | else |
3953 | else |
3940 | { |
3954 | { |
3941 | set_locale (str); |
3955 | set_locale (str); |
3942 | pty->set_utf8_mode (enc_utf8); |
3956 | pty->set_utf8_mode (enc_utf8); |
3943 | init_xlocale (); |
3957 | init_xlocale (); |
… | |
… | |
4304 | scr_color (Color_bg, Color_bg); |
4318 | scr_color (Color_bg, Color_bg); |
4305 | break; |
4319 | break; |
4306 | |
4320 | |
4307 | //case 50: // not variable spacing |
4321 | //case 50: // not variable spacing |
4308 | |
4322 | |
4309 | #if ENABLE_FRILLS |
4323 | #if !ENABLE_MINIMAL |
4310 | case 90: |
4324 | case 90: |
4311 | case 91: /* set bright fg color */ |
4325 | case 91: /* set bright fg color */ |
4312 | case 92: |
4326 | case 92: |
4313 | case 93: |
4327 | case 93: |
4314 | case 94: |
4328 | case 94: |