… | |
… | |
2400 | else |
2400 | else |
2401 | font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back); |
2401 | font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back); |
2402 | |
2402 | |
2403 | if (rend & RS_Uline && font->descent > 1 && fore != back) |
2403 | if (rend & RS_Uline && font->descent > 1 && fore != back) |
2404 | { |
2404 | { |
|
|
2405 | #if ENABLE_FRILLS |
|
|
2406 | if (ISSET_PIXCOLOR (Color_underline)) |
|
|
2407 | XSetForeground (display->display, TermWin.gc, pix_colors[Color_underline]); |
|
|
2408 | else |
|
|
2409 | #endif |
2405 | XSetForeground (display->display, TermWin.gc, pix_colors[fore]); |
2410 | XSetForeground (display->display, TermWin.gc, pix_colors[fore]); |
|
|
2411 | |
2406 | XDrawLine (display->display, drawBuffer, TermWin.gc, |
2412 | XDrawLine (display->display, drawBuffer, TermWin.gc, |
2407 | xpixel, ypixel + font->ascent + 1, |
2413 | xpixel, ypixel + font->ascent + 1, |
2408 | xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); |
2414 | xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); |
2409 | } |
2415 | } |
2410 | } /* for (col....) */ |
2416 | } /* for (col....) */ |
… | |
… | |
2656 | /* ------------------------------------------------------------------------- */ |
2662 | /* ------------------------------------------------------------------------- */ |
2657 | /* |
2663 | /* |
2658 | * Paste a selection direct to the command fd |
2664 | * Paste a selection direct to the command fd |
2659 | */ |
2665 | */ |
2660 | void |
2666 | void |
2661 | rxvt_term::paste (const unsigned char *data, unsigned int len) |
2667 | rxvt_term::paste (unsigned char *data, unsigned int len) |
2662 | { |
2668 | { |
2663 | unsigned int i, j, n; |
|
|
2664 | unsigned char *ds = (unsigned char *)rxvt_malloc (PASTE_SIZE); |
|
|
2665 | |
|
|
2666 | /* convert normal newline chars into common keyboard Return key sequence */ |
2669 | /* convert normal newline chars into common keyboard Return key sequence */ |
2667 | for (i = 0; i < len; i += PASTE_SIZE) |
2670 | for (unsigned int i = 0; i < len; i++) |
2668 | { |
|
|
2669 | n = min (len - i, PASTE_SIZE); |
|
|
2670 | memcpy (ds, data + i, n); |
|
|
2671 | |
|
|
2672 | for (j = 0; j < n; j++) |
|
|
2673 | if (ds[j] == C0_LF) |
2671 | if (data[i] == C0_LF) |
2674 | ds[j] = C0_CR; |
2672 | data[i] = C0_CR; |
2675 | |
2673 | |
2676 | tt_write (ds, (int)n); |
2674 | tt_write (data, len); |
2677 | } |
|
|
2678 | |
|
|
2679 | free (ds); |
|
|
2680 | } |
2675 | } |
2681 | |
2676 | |
2682 | /* ------------------------------------------------------------------------- */ |
2677 | /* ------------------------------------------------------------------------- */ |
2683 | /* |
2678 | /* |
2684 | * Respond to a notification that a primary selection has been sent |
2679 | * Respond to a notification that a primary selection has been sent |
… | |
… | |
2714 | |
2709 | |
2715 | unsigned long bytes_after; |
2710 | unsigned long bytes_after; |
2716 | XTextProperty ct; |
2711 | XTextProperty ct; |
2717 | |
2712 | |
2718 | if (XGetWindowProperty (display->display, win, prop, |
2713 | if (XGetWindowProperty (display->display, win, prop, |
2719 | 0, (long)(PROP_SIZE / 4), |
2714 | 0, PROP_SIZE / 4, |
2720 | delete_prop, AnyPropertyType, |
2715 | delete_prop, AnyPropertyType, |
2721 | &ct.encoding, &ct.format, |
2716 | &ct.encoding, &ct.format, |
2722 | &ct.nitems, &bytes_after, |
2717 | &ct.nitems, &bytes_after, |
2723 | &ct.value) != Success) |
2718 | &ct.value) != Success) |
2724 | { |
2719 | { |
… | |
… | |
2731 | |
2726 | |
2732 | if (bytes_after) |
2727 | if (bytes_after) |
2733 | { |
2728 | { |
2734 | // fetch and append remaining data |
2729 | // fetch and append remaining data |
2735 | XTextProperty ct2; |
2730 | XTextProperty ct2; |
2736 | unsigned long bytes_after2; |
|
|
2737 | |
2731 | |
2738 | if (XGetWindowProperty (display->display, win, prop, |
2732 | if (XGetWindowProperty (display->display, win, prop, |
2739 | ct.nitems / 4, (long) (bytes_after + 3) / 4, |
2733 | ct.nitems / 4, (bytes_after + 3) / 4, |
2740 | delete_prop, AnyPropertyType, |
2734 | delete_prop, AnyPropertyType, |
2741 | &ct2.encoding, &ct2.format, |
2735 | &ct2.encoding, &ct2.format, |
2742 | &ct2.nitems, &bytes_after2, |
2736 | &ct2.nitems, &bytes_after, |
2743 | &ct2.value) != Success) |
2737 | &ct2.value) != Success) |
2744 | goto bailout; |
2738 | goto bailout; |
2745 | |
2739 | |
2746 | // realloc should be compatible to XFree, here, and elsewhere, too |
2740 | // realloc should be compatible to XFree, here, and elsewhere, too |
2747 | ct.value = (unsigned char *)realloc (ct.value, ct.nitems + bytes_after); |
2741 | ct.value = (unsigned char *)realloc (ct.value, ct.nitems + ct2.nitems + 1); |
2748 | memcpy (ct.value + ct.nitems, ct2.value, ct2.nitems); |
2742 | memcpy (ct.value + ct.nitems, ct2.value, ct2.nitems + 1); |
2749 | ct.nitems += ct2.nitems; |
2743 | ct.nitems += ct2.nitems; |
2750 | |
2744 | |
2751 | XFree (ct2.value); |
2745 | XFree (ct2.value); |
2752 | } |
2746 | } |
2753 | else if (delete_prop) |
|
|
2754 | XDeleteProperty (display->display, win, prop); |
|
|
2755 | |
2747 | |
2756 | if (ct.value == 0) |
2748 | if (ct.value == 0) |
2757 | goto bailout; |
2749 | goto bailout; |
2758 | |
2750 | |
2759 | if (ct.encoding == xa[XA_INCR]) |
2751 | if (ct.encoding == xa[XA_INCR]) |