From aa6ad3be633f66f9e216bd07cb873ace5cbcba08 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Sat, 22 Sep 2018 13:15:19 +0200 Subject: [PATCH] + add: Customize Scheme's Default Style for Inline-IME color --- language/common_res.h | 2 + language/np3_af_za/lexer_af_za.rc | Bin 35368 -> 35568 bytes language/np3_de_de/lexer_de_de.rc | Bin 35372 -> 35572 bytes language/np3_en_gb/lexer_en_gb.rc | Bin 35434 -> 35634 bytes language/np3_en_us/lexer_en_us.rc | Bin 32168 -> 32368 bytes language/np3_es_es/lexer_es_es.rc | Bin 35468 -> 35668 bytes language/np3_fr_fr/lexer_fr_fr.rc | Bin 35354 -> 35554 bytes language/np3_ja_jp/lexer_ja_jp.rc | Bin 32244 -> 32444 bytes language/np3_nl_nl/lexer_nl_nl.rc | Bin 32168 -> 32368 bytes language/np3_zh_cn/lexer_zh_cn.rc | Bin 34068 -> 34268 bytes src/Edit.c | 6 +-- src/Notepad3.c | 2 +- src/SciCall.h | 2 +- src/Styles.c | 71 ++++++------------------------ src/Styles.h | 3 -- 15 files changed, 21 insertions(+), 65 deletions(-) diff --git a/language/common_res.h b/language/common_res.h index e6015d95e..f86af4cf0 100644 --- a/language/common_res.h +++ b/language/common_res.h @@ -927,5 +927,7 @@ #define IDS_LEX_STR_63349 63349 #define IDS_LEX_STR_63350 63350 #define IDS_LEX_STR_63351 63351 +#define IDS_LEX_STR_63352 63352 +#define IDS_LEX_STR_63353 63353 #endif //_COMMON_RES_H_ diff --git a/language/np3_af_za/lexer_af_za.rc b/language/np3_af_za/lexer_af_za.rc index 3961710aa4d3620056dad07acd6ba2465acbc467..2a82faa8a6edebce1f02a871a348ac4686620afc 100644 GIT binary patch delta 96 zcmZ26h3UgorVVe}ChyBrnVitZGWk)V(BuSP9zk6OPX=EGR|W+JXNG)+9ESYKj&=Hs jrjre8g(oLya>#lz>SEX7jyvA!Y!6Itl3j diff --git a/language/np3_de_de/lexer_de_de.rc b/language/np3_de_de/lexer_de_de.rc index 8ab2de343bc20ac586bb0847bf8ad5545abd749f..e99714f9ddd2038face3eeeb894db519022a788f 100644 GIT binary patch delta 106 zcmZ28h3U&wrVYQ^CO0&xF`F_NO%4(A*jpX$>7W2%AmmD#*oNR#E>-Euvs6d t!g%sT4dKZG87ztlKoxlmISiRVGL->CJwxhbMRw82^Vp>}E46bm0{{$;8NUDk delta 18 acmew|m1)fsrVYQ^CTpy@yG#8%S;KMR`o-Y@_E`uk7FM}(C0)sO{K10sri~9P^ t#tf#D74wBBPe|jC^<>Cn$YIC?lBo=6Y8mn;PjnHVyn|h8b3nTkGXT}y8vg(Q delta 18 acmdlqjp@}CrVSeHlb7-GZT{D8!VCaVQwQw; diff --git a/language/np3_en_us/lexer_en_us.rc b/language/np3_en_us/lexer_en_us.rc index bd86276f6693ec4aee69a423384fdf19aef5ea93..03173aceda0e5fdc0633de177f54410d9b37722a 100644 GIT binary patch delta 96 zcmZ4SoAJXR#tj)&lM`H37>y@?G!&hjAjdNKjSC0AE`uk7FM}(C0)sO{K10sri(&de k6^!9P6)GIEo(y>mISiRVGL->MB}4vXL0j?7WmQJZ0I9hd@Bjb+ delta 18 acmezHhjGPk#tj)&lUJ~7Y>udwUmZ( delta 18 acmcaIjj3lU(*~3F$@_BoHgk1&F#`Zih6h;y diff --git a/language/np3_fr_fr/lexer_fr_fr.rc b/language/np3_fr_fr/lexer_fr_fr.rc index f8d7bbadafed364d4ff0fa6e969c80cd2f87550c..a7fc4b7edf52c6efea47baff5f8e71056cc74c68 100644 GIT binary patch delta 96 zcmbO=h3U~$rVX#!CKoiRO)fGQn(W}iGC9tdi(i+)lfjq4l|g~QnIWGcXY$5ILuOM3 nxWnLsj?0Zko4{^URx@yT=8r8Wz-b1(w{USb&y delta 18 acmaDfm1))#rVX#!CUbD{Z9dSh#0&sY9S58M diff --git a/language/np3_ja_jp/lexer_ja_jp.rc b/language/np3_ja_jp/lexer_ja_jp.rc index 21cb18850c25220ad6d14e2002c1eda18be4ae02..cffa2e9b3f72985d31deaa624a141a9aa7781d13 100644 GIT binary patch delta 112 zcmezJn{m%y#tjFmCcg?)VKrtjWiXn&Fti}wc3`UdJ=Zj9>=fT0R%izi2%izkOz~Ib~&yX|uevu)g p>Ew$g!sB)aZezf!;lFiQyI`y19cQlcH|P>e5TQZ834wH8d(4U delta 22 ecmcc9%`~NpX~Vw8$sSyMlkc!gZC=-;#|!{*R0$9O diff --git a/src/Edit.c b/src/Edit.c index 10cbbed30..3640ab61d 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -6773,7 +6773,7 @@ void EditUpdateUrlHotspots(HWND hwnd, DocPos startPos, DocPos endPos, bool bActi // mark this match SciCall_StartStyling(iPos); if (bActiveHotspot) - SciCall_SetStyling((DocPosCR)mlen, (char)Style_GetHotspotStyleID()); + SciCall_SetStyling((DocPosCR)mlen, Style_GetHotspotStyleID()); else EditFinalizeStyling(hwnd, endPos); @@ -6852,7 +6852,7 @@ void EditHideNotMarkedLineRange(HWND hwnd, DocPos iStartPos, DocPos iEndPos, boo const DocPos begPos = SciCall_PositionFromLine(iStartLine); const DocPos lnLen = SciCall_LineLength(iStartLine); SciCall_StartStyling(begPos); - SciCall_SetStyling((DocPosCR)lnLen, (char)Style_GetInvisibleStyleID()); + SciCall_SetStyling((DocPosCR)lnLen, Style_GetInvisibleStyleID()); } int level = baseLevel; @@ -6868,7 +6868,7 @@ void EditHideNotMarkedLineRange(HWND hwnd, DocPos iStartPos, DocPos iEndPos, boo const DocPos begPos = SciCall_PositionFromLine(iLine); const DocPos lnLen = SciCall_LineLength(iLine); SciCall_StartStyling(begPos); - SciCall_SetStyling((DocPosCR)lnLen, (char)Style_GetInvisibleStyleID()); + SciCall_SetStyling((DocPosCR)lnLen, Style_GetInvisibleStyleID()); if (level == baseLevel) { SciCall_SetFoldLevel(iLine - 1, SC_FOLDLEVELHEADERFLAG | level++); diff --git a/src/Notepad3.c b/src/Notepad3.c index 7fce86305..3fb0bdcfe 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -5925,7 +5925,7 @@ void OpenHotSpotURL(DocPos position, bool bForceBrowser) { char const cStyle = SciCall_GetStyleAt(position); - if (cStyle != (char)Style_GetHotspotStyleID()) { return; } + if ((int)cStyle != Style_GetHotspotStyleID()) { return; } if (!SciCall_StyleGetHotspot(Style_GetHotspotStyleID())) { return; } // get left most position of style diff --git a/src/SciCall.h b/src/SciCall.h index b79e6eb70..af4a0b406 100644 --- a/src/SciCall.h +++ b/src/SciCall.h @@ -326,7 +326,7 @@ DeclareSciCallV1(SetWrapMode, SETWRAPMODE, int, mode) DeclareSciCallR1(StyleGetFore, STYLEGETFORE, COLORREF, char, style) DeclareSciCallR1(StyleGetBack, STYLEGETBACK, COLORREF, char, style) DeclareSciCallR1(GetStyleAt, GETSTYLEAT, char, DocPos, position) -DeclareSciCallV2(SetStyling, SETSTYLING, DocPosCR, length, char, style) +DeclareSciCallV2(SetStyling, SETSTYLING, DocPosCR, length, int, style) DeclareSciCallV1(StartStyling, STARTSTYLING, DocPos, position) DeclareSciCallR0(GetEndStyled, GETENDSTYLED, DocPos) DeclareSciCallR1(StyleGetHotspot, STYLEGETHOTSPOT, bool, int, iStyle) diff --git a/src/Styles.c b/src/Styles.c index 8a5ecef64..010ffb470 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -75,32 +75,6 @@ bool ChooseFontDirectWrite(HWND hwnd, const WCHAR* localeName, UINT dpi, LPCHOOS // ---------------------------------------------------------------------------- - -typedef enum { - STY_DEFAULT = 0, - STY_MARGIN = 1, - STY_BRACE_OK = 2, - STY_BRACE_BAD = 3, - STY_CTRL_CHR = 4, - STY_INDENT_GUIDE = 5, - STY_SEL_TXT = 6, - STY_WHITESPACE = 7, - STY_CUR_LN_BCK = 8, - STY_CARET = 9, - STY_LONG_LN_MRK = 10, - STY_X_LN_SPACE = 11, - STY_BOOK_MARK = 12, - STY_MARK_OCC = 13, - STY_URL_HOTSPOT = 14, - STY_INVISIBLE = 15, - STY_READONLY = 16 - - // MAX = 127 -} -LexDefaultStyles; - - - // This array holds all the lexers... // Don't forget to change the number of the lexer for HTML and XML // in Notepad2.c ParseCommandLine() if you change this array! @@ -758,6 +732,20 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) } SendMessage(hwnd, SCI_INDICSETSTYLE, INDIC_NP3_MARK_OCCURANCE, iValue); + + // Inline-IME Color + #define _SC_INDIC_IME_INPUT (INDIC_IME + 0) + #define _SC_INDIC_IME_TARGET (INDIC_IME + 1) + #define _SC_INDIC_IME_CONVERTED (INDIC_IME + 2) + #define _SC_INDIC_IME_UNKNOWN INDIC_IME_MAX + + if (Style_StrGetColor(true, pCurrentStandard->Styles[STY_IME_COLOR].szValue, &dColor)) { // IME foregr + SendMessage(hwnd, SCI_INDICSETFORE, _SC_INDIC_IME_INPUT, dColor); + SendMessage(hwnd, SCI_INDICSETFORE, _SC_INDIC_IME_TARGET, dColor); + SendMessage(hwnd, SCI_INDICSETFORE, _SC_INDIC_IME_CONVERTED, dColor); + SendMessage(hwnd, SCI_INDICSETFORE, _SC_INDIC_IME_UNKNOWN, dColor); + } + // More default values... if (pLexNew != &lexANSI) { @@ -1064,16 +1052,6 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) -//============================================================================= -// -// Style_GetHotspotStyleID() -// -int Style_GetHotspotStyleID() -{ - return (STYLE_MAX - STY_URL_HOTSPOT); -} - - //============================================================================= // // Style_SetUrlHotSpot() @@ -1120,16 +1098,6 @@ void Style_SetUrlHotSpot(HWND hwnd, bool bHotSpot) } -//============================================================================= -// -// Style_GetInvisibleStyleID() -// -int Style_GetInvisibleStyleID() -{ - //return STYLE_FOLDDISPLAYTEXT; - return (STYLE_MAX - STY_INVISIBLE); -} - //============================================================================= // @@ -1145,17 +1113,6 @@ void Style_SetInvisible(HWND hwnd, bool bInvisible) } - -//============================================================================= -// -// Style_GetReadonlyStyleID() -// -int Style_GetReadonlyStyleID() -{ - return (STYLE_MAX - STY_READONLY); -} - - //============================================================================= // // Style_SetInvisible() diff --git a/src/Styles.h b/src/Styles.h index 08b605a4d..92bf95e47 100644 --- a/src/Styles.h +++ b/src/Styles.h @@ -82,9 +82,6 @@ INT_PTR CALLBACK Styles_ConfigDlgProc(HWND,UINT,WPARAM,LPARAM); HWND Style_CustomizeSchemesDlg(HWND); INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND,UINT,WPARAM,LPARAM); void Style_SelectLexerDlg(HWND); -int Style_GetHotspotStyleID(); -int Style_GetInvisibleStyleID(); -int Style_GetReadonlyStyleID(); bool Style_StrGetWeightValue(LPCWSTR,int*); void Style_AppendWeightStr(LPWSTR, int, int);