下線属性(Underline属性)の文字表示をできるようにした
- シーケンス SGR 4(下線属性)
- URL文字属性とは異なる属性
@@ -175,9 +175,7 @@ | ||
175 | 175 | static COLORREF BGVTBoldColor[2]; |
176 | 176 | static COLORREF BGVTBlinkColor[2]; |
177 | 177 | static COLORREF BGVTReverseColor[2]; |
178 | -/* begin - ishizaki */ | |
179 | -static COLORREF BGURLColor[2]; | |
180 | -/* end - ishizaki */ | |
178 | +static COLORREF BGURLColor[2]; // URL色とUnderline属性色を兼用 | |
181 | 179 | |
182 | 180 | static RECT BGPrevRect; |
183 | 181 | static BOOL BGReverseText; |
@@ -1385,10 +1383,8 @@ | ||
1385 | 1383 | BGVTReverseColor[0] = BGGetColor("VTReverseFore", BGVTReverseColor[0], file); |
1386 | 1384 | BGVTReverseColor[1] = BGGetColor("VTReverseBack", BGVTReverseColor[1], file); |
1387 | 1385 | |
1388 | - /* begin - ishizaki */ | |
1389 | 1386 | BGURLColor[0] = BGGetColor("URLFore", BGURLColor[0], file); |
1390 | 1387 | BGURLColor[1] = BGGetColor("URLBack", BGURLColor[1], file); |
1391 | - /* end - ishizaki */ | |
1392 | 1388 | } |
1393 | 1389 | |
1394 | 1390 | /** |
@@ -2021,8 +2017,13 @@ | ||
2021 | 2017 | } |
2022 | 2018 | |
2023 | 2019 | /* Underline */ |
2024 | - VTlf.lfUnderline = 1; | |
2025 | - VTFont[AttrUnder] = CreateFontIndirect(&VTlf); | |
2020 | + if (ts.FontFlag & FF_URLUNDERLINE) { | |
2021 | + VTlf.lfUnderline = 1; | |
2022 | + VTFont[AttrUnder] = CreateFontIndirect(&VTlf); | |
2023 | + } | |
2024 | + else { | |
2025 | + VTFont[AttrUnder] = VTFont[0]; | |
2026 | + } | |
2026 | 2027 | |
2027 | 2028 | if (ts.FontFlag & FF_BOLD) { |
2028 | 2029 | /* Bold */ |
@@ -2594,6 +2595,7 @@ | ||
2594 | 2595 | |
2595 | 2596 | #define isURLColored(x) ((ts.ColorFlag & CF_URLCOLOR) && ((x).Attr & AttrURL)) |
2596 | 2597 | #define isURLUnderlined(x) ((ts.FontFlag & FF_URLUNDERLINE) && ((x).Attr & AttrURL)) |
2598 | +#define isUnderlined(x) (/*(ts.ColorFlag & CF_UNDERLINE) &&*/ ((x).Attr & AttrUnder)) | |
2597 | 2599 | #define isBoldColored(x) ((ts.ColorFlag & CF_BOLDCOLOR) && ((x).Attr & AttrBold)) |
2598 | 2600 | #define isBlinkColored(x) ((ts.ColorFlag & CF_BLINKCOLOR) && ((x).Attr & AttrBlink)) |
2599 | 2601 | #define isReverseColored(x) ((ts.ColorFlag & CF_REVERSECOLOR) && ((x).Attr & AttrReverse)) |
@@ -2637,7 +2639,15 @@ | ||
2637 | 2639 | BackColor = ts.VTBoldColor[1]; |
2638 | 2640 | #endif |
2639 | 2641 | } |
2640 | - /* begin - ishizaki */ | |
2642 | + else if (isUnderlined(Attr)) { | |
2643 | +#ifdef ALPHABLEND_TYPE2 | |
2644 | + TextColor = BGURLColor[0]; | |
2645 | + BackColor = BGURLColor[1]; | |
2646 | +#else | |
2647 | + TextColor = ts.URLColor[0]; | |
2648 | + BackColor = ts.URLColor[1]; | |
2649 | +#endif | |
2650 | + } | |
2641 | 2651 | else if (isURLColored(Attr)) { |
2642 | 2652 | #ifdef ALPHABLEND_TYPE2 // AKASI |
2643 | 2653 | TextColor = BGURLColor[0]; |
@@ -2647,7 +2657,6 @@ | ||
2647 | 2657 | BackColor = ts.URLColor[1]; |
2648 | 2658 | #endif |
2649 | 2659 | } |
2650 | - /* end - ishizaki */ | |
2651 | 2660 | else { |
2652 | 2661 | if (isForeColored(Attr)) { |
2653 | 2662 | TextColor = ANSIColor[Attr.Fore]; |
@@ -2693,26 +2702,33 @@ | ||
2693 | 2702 | TextColor = ANSIColor[Attr.Fore]; |
2694 | 2703 | } |
2695 | 2704 | } |
2705 | +#ifdef ALPHABLEND_TYPE2 // AKASI | |
2696 | 2706 | else if (isBlinkColored(Attr)) |
2697 | -#ifdef ALPHABLEND_TYPE2 // AKASI | |
2698 | 2707 | TextColor = BGVTBlinkColor[0]; |
2699 | 2708 | else if (isBoldColored(Attr)) |
2700 | 2709 | TextColor = BGVTBoldColor[0]; |
2710 | + else if (isUnderlined(Attr)) | |
2711 | + TextColor = BGURLColor[0]; | |
2701 | 2712 | else if (isURLColored(Attr)) |
2702 | 2713 | TextColor = BGURLColor[0]; |
2703 | 2714 | else { |
2704 | 2715 | TextColor = BGVTColor[0]; |
2716 | + NoReverseColor = 1; | |
2717 | + } | |
2705 | 2718 | #else |
2719 | + else if (isBlinkColored(Attr)) | |
2706 | 2720 | TextColor = ts.VTBlinkColor[0]; |
2707 | 2721 | else if (isBoldColored(Attr)) |
2708 | 2722 | TextColor = ts.VTBoldColor[0]; |
2723 | + else if (isUnderlined(Attr)) | |
2724 | + TextColor = ts.URLColor[0]; | |
2709 | 2725 | else if (isURLColored(Attr)) |
2710 | 2726 | TextColor = ts.URLColor[0]; |
2711 | 2727 | else { |
2712 | 2728 | TextColor = ts.VTColor[0]; |
2713 | -#endif | |
2714 | 2729 | NoReverseColor = 1; |
2715 | 2730 | } |
2731 | +#endif | |
2716 | 2732 | if (isBackColored(Attr)) { |
2717 | 2733 | if (Attr.Back<8 && (ts.ColorFlag&CF_PCBOLD16)) { |
2718 | 2734 | if (((Attr.Attr&AttrBlink)!=0) == (Attr.Back!=0)) { |
@@ -2729,28 +2745,37 @@ | ||
2729 | 2745 | BackColor = ANSIColor[Attr.Back]; |
2730 | 2746 | } |
2731 | 2747 | } |
2748 | +#ifdef ALPHABLEND_TYPE2 // AKASI | |
2732 | 2749 | else if (isBlinkColored(Attr)) |
2733 | -#ifdef ALPHABLEND_TYPE2 // AKASI | |
2734 | 2750 | BackColor = BGVTBlinkColor[1]; |
2735 | 2751 | else if (isBoldColored(Attr)) |
2736 | 2752 | BackColor = BGVTBoldColor[1]; |
2753 | + else if (isUnderlined(Attr)) | |
2754 | + BackColor = BGURLColor[1]; | |
2737 | 2755 | else if (isURLColored(Attr)) |
2738 | 2756 | BackColor = BGURLColor[1]; |
2739 | 2757 | else { |
2740 | 2758 | BackColor = BGVTColor[1]; |
2759 | + if (NoReverseColor == 1) { | |
2760 | + NoReverseColor = !(ts.ColorFlag & CF_REVERSECOLOR); | |
2761 | + } | |
2762 | + } | |
2741 | 2763 | #else |
2764 | + else if (isBlinkColored(Attr)) | |
2742 | 2765 | BackColor = ts.VTBlinkColor[1]; |
2743 | 2766 | else if (isBoldColored(Attr)) |
2744 | 2767 | BackColor = ts.VTBoldColor[1]; |
2768 | + else if (isUnderlined(Attr)) | |
2769 | + BackColor = ts.URLColor[1]; | |
2745 | 2770 | else if (isURLColored(Attr)) |
2746 | 2771 | BackColor = ts.URLColor[1]; |
2747 | 2772 | else { |
2748 | 2773 | BackColor = ts.VTColor[1]; |
2749 | -#endif | |
2750 | 2774 | if (NoReverseColor == 1) { |
2751 | 2775 | NoReverseColor = !(ts.ColorFlag & CF_REVERSECOLOR); |
2752 | 2776 | } |
2753 | 2777 | } |
2778 | +#endif | |
2754 | 2779 | } |
2755 | 2780 | #ifdef USE_NORMAL_BGCOLOR_REJECT |
2756 | 2781 | if (ts.UseNormalBGColor) { |
@@ -602,7 +602,7 @@ | ||
602 | 602 | CommBinaryOut(&cv, str, l); |
603 | 603 | } |
604 | 604 | |
605 | -void SendOSCstr(char *str, int len, char TermChar) { | |
605 | +static void SendOSCstr(char *str, int len, char TermChar) { | |
606 | 606 | size_t l; |
607 | 607 | |
608 | 608 | if (str == NULL || len < 0) |
@@ -2621,7 +2621,7 @@ | ||
2621 | 2621 | } |
2622 | 2622 | } |
2623 | 2623 | |
2624 | -void CSSetAttr() // SGR | |
2624 | +static void CSSetAttr(void) // SGR | |
2625 | 2625 | { |
2626 | 2626 | UpdateStr(); |
2627 | 2627 | ParseSGRParams(&CharAttr, NULL, 1); |
@@ -5044,7 +5044,7 @@ | ||
5044 | 5044 | return colornum; |
5045 | 5045 | } |
5046 | 5046 | |
5047 | -void XsProcColor(int mode, unsigned int ColorNumber, char *ColorSpec, BYTE TermChar) { | |
5047 | +static void XsProcColor(int mode, unsigned int ColorNumber, char *ColorSpec, BYTE TermChar) { | |
5048 | 5048 | COLORREF color; |
5049 | 5049 | char StrBuff[256]; |
5050 | 5050 | unsigned int colornum; |