mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
Merge pull request #3376 from RaiKoHoff/Dev_RC1
Support Scintilla's new feature: indicator stroke width
This commit is contained in:
commit
c26e1376e3
@ -679,25 +679,32 @@ bool VerifyContrast(COLORREF cr1,COLORREF cr2)
|
||||
// IsFontAvailable()
|
||||
// Test if a certain font is installed on the system
|
||||
//
|
||||
static int CALLBACK EnumFontsProc(CONST LOGFONT *plf,CONST TEXTMETRIC *ptm,DWORD FontType,LPARAM lParam)
|
||||
{
|
||||
static int CALLBACK EnumFontFamExProcFound(CONST LOGFONT *plf, CONST TEXTMETRIC *ptm, DWORD FontType, LPARAM lParam) {
|
||||
|
||||
UNREFERENCED_PARAMETER(plf);
|
||||
UNREFERENCED_PARAMETER(ptm);
|
||||
UNREFERENCED_PARAMETER(FontType);
|
||||
*((PBOOL)lParam) = true;
|
||||
return 0;
|
||||
*((bool*)lParam) = true;
|
||||
return 0; // stop further enumerating
|
||||
}
|
||||
|
||||
bool IsFontAvailable(LPCWSTR lpszFontName)
|
||||
{
|
||||
BOOL fFound = FALSE;
|
||||
HDC const hDC = GetDC(NULL);
|
||||
EnumFonts(hDC,lpszFontName,EnumFontsProc,(LPARAM)&fFound);
|
||||
ReleaseDC(NULL,hDC);
|
||||
bool IsFontAvailable(LPCWSTR lpszFontName) {
|
||||
|
||||
bool fFound = FALSE;
|
||||
|
||||
LOGFONT lf = { 0 };
|
||||
StringCchCopy(lf.lfFaceName, LF_FACESIZE, lpszFontName);
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
|
||||
HDC hDC = GetDC(NULL);
|
||||
EnumFontFamiliesEx(hDC, &lf, EnumFontFamExProcFound, (LPARAM)&fFound, 0);
|
||||
ReleaseDC(NULL, hDC);
|
||||
|
||||
return fFound;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// IsCmdEnabled()
|
||||
@ -2378,7 +2385,7 @@ size_t NormalizeColumnVector(LPSTR chStrg_in, LPWSTR wchStrg_out, size_t iCount)
|
||||
//=============================================================================
|
||||
//
|
||||
// Char2FloatW()
|
||||
// Locale indpendant simple character to tloat conversion
|
||||
// Locale indpendant simple character to float conversion
|
||||
//
|
||||
bool Char2FloatW(WCHAR* wnumber, float* fresult)
|
||||
{
|
||||
|
||||
@ -2259,7 +2259,7 @@ LRESULT MsgCreate(HWND hwnd, WPARAM wParam,LPARAM lParam)
|
||||
return -1LL;
|
||||
}
|
||||
|
||||
Style_SetDefaultLexer(Globals.hwndEdit);
|
||||
//~ Style_SetDefaultLexer(Globals.hwndEdit); -- done by WM_THEMECHANGED
|
||||
|
||||
Encoding_Current(Settings.DefaultEncoding);
|
||||
|
||||
@ -5533,15 +5533,15 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
SendWMSize(hwnd, NULL);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_CUSTOMIZETB:
|
||||
SendMessage(Globals.hwndToolbar,TB_CUSTOMIZE,0,0);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_TOGGLETB:
|
||||
Settings.ToolBarTheme = (Settings.ToolBarTheme + 1) % 3;
|
||||
SendMessage(hwnd, WM_THEMECHANGED, 0, 0);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_CUSTOMIZETB:
|
||||
SendMessage(Globals.hwndToolbar,TB_CUSTOMIZE,0,0);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_LOADTHEMETB:
|
||||
if (SelectExternalToolBar(hwnd)) {
|
||||
SendMessage(hwnd, WM_THEMECHANGED, 0, 0);
|
||||
|
||||
@ -529,8 +529,11 @@ DeclareSciCallV1(SetHotspotSigleLine, SETHOTSPOTSINGLELINE, bool, singleline);
|
||||
DeclareSciCallV1(SetViewWS, SETVIEWWS, int, wspc);
|
||||
DeclareSciCallV1(SetViewEOL, SETVIEWEOL, bool, eols);
|
||||
|
||||
DeclareSciCallV2(StyleSetFont, STYLESETFONT, int, style, const char *, fontname);
|
||||
|
||||
DeclareSciCallR2(StyleGetFont, STYLEGETFONT, int, int, style, char*, fontname);
|
||||
DeclareSciCallV2(StyleSetFont, STYLESETFONT, int, style, const char*, fontname);
|
||||
DeclareSciCallV2(StyleSetWeight, STYLESETWEIGHT, int, style, int, weight);
|
||||
DeclareSciCallV2(StyleSetItalic, STYLESETITALIC, int, style, bool, oblique);
|
||||
DeclareSciCallV1(SetFontQuality, SETFONTQUALITY, int, qual);
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
|
||||
1049
src/Styles.c
1049
src/Styles.c
File diff suppressed because it is too large
Load Diff
18
src/Styles.h
18
src/Styles.h
@ -73,19 +73,23 @@ void Style_SetExtraLineSpace(HWND hwnd, LPWSTR lpszStyle, int cch);
|
||||
bool Style_GetFileFilterStr(LPWSTR lpszFilter, int cchFilter, LPWSTR lpszDefExt, int cchExt, bool bSaveAs);
|
||||
bool Style_StrGetFontName(LPCWSTR lpszStyle,LPWSTR lpszFont,int cchFont);
|
||||
bool Style_StrGetFontStyle(LPCWSTR lpszStyle,LPWSTR lpszFontStyle,int cchFontStyle);
|
||||
bool Style_StrGetFontQuality(LPCWSTR lpszStyle,LPWSTR lpszQuality,int cchQuality);
|
||||
bool Style_StrGetFontQuality(LPCWSTR lpszStyle, LPWSTR lpszQuality, int cchQuality, int *iSciQuality_out);
|
||||
bool Style_StrGetCharSet(LPCWSTR lpszStyle,int* i);
|
||||
bool Style_StrGetSizeInt(LPCWSTR lpszStyle, int* i);
|
||||
bool Style_StrGetSize(LPCWSTR lpszStyle,float* f);
|
||||
bool Style_StrGetSizeFloat(LPCWSTR lpszStyle,float* f);
|
||||
bool Style_StrGetSizeStr(LPCWSTR lpszStyle,LPWSTR lpszSize,int cchSize);
|
||||
void Style_AppendSizeAttribute(LPWSTR lpszSize, int cchSize, const float fFontSize, const float fBaseFontSize);
|
||||
bool Style_StrGetWeightValue(LPCWSTR lpszWeight, int *weight);
|
||||
void Style_AppendWeightAttribute(LPWSTR lpszWeight, int cchSize, int fontWeight);
|
||||
bool Style_StrGetColor(LPCWSTR lpszStyle, COLOR_LAYER layer, COLORREF *rgb, bool useDefault);
|
||||
bool Style_StrGetCase(LPCWSTR lpszStyle,int* i);
|
||||
bool Style_StrGetStrokeWidth(int indicID, LPCWSTR lpszStyle, int *piStrokeWidth);
|
||||
bool Style_StrGetCase(LPCWSTR lpszStyle, int *i);
|
||||
bool Style_StrGetAlpha(LPCWSTR lpszStyle, int* iOutValue, bool bAlpha1st);
|
||||
bool Style_GetIndicatorType(LPWSTR lpszStyle,int cchSize,int* idx);
|
||||
void Style_CopyStyles_IfNotDefined(LPCWSTR lpszStyleSrc,LPWSTR lpszStyleDest,int cchSizeDest,bool);
|
||||
bool Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,LPCWSTR sLexerName,LPCWSTR sStyleName,bool,bool,bool,bool);
|
||||
void Style_CopyStyles_IfNotDefined(LPCWSTR lpszStyleSrc,LPWSTR lpszStyleDest,int cchSizeDest);
|
||||
bool Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,LPCWSTR sLexerName,LPCWSTR sStyleName,bool,bool);
|
||||
bool Style_SelectColor(HWND hwnd,bool,LPWSTR lpszStyle,int cchStyle,bool);
|
||||
void Style_SetStyles(HWND hwnd,int iStyle,LPCWSTR lpszStyle,bool);
|
||||
void Style_SetStyles(HWND hwnd,const int iStyle,LPCWSTR lpszStyle);
|
||||
bool Style_IsCurLexerStandard();
|
||||
float Style_GetBaseFontSize();
|
||||
void Style_SetMultiEdgeLine(const int colVec[], const size_t count);
|
||||
@ -100,8 +104,6 @@ INT_PTR CALLBACK Styles_ConfigDlgProc(HWND,UINT,WPARAM,LPARAM);
|
||||
HWND Style_CustomizeSchemesDlg(HWND hwnd);
|
||||
INT_PTR CALLBACK Style_SelectLexerDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam);
|
||||
void Style_SelectLexerDlg(HWND hwnd);
|
||||
bool Style_StrGetWeightValue(LPCWSTR lpszWeight,int* weight);
|
||||
void Style_AppendWeightStr(LPWSTR lpszWeight, int cchSize, int fontWeight);
|
||||
|
||||
|
||||
inline void Style_PrintfCchColor(LPWSTR buffer, const size_t cch, LPCWSTR prefix, COLOR_LAYER layer, COLORREF color)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user