MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / Style_StrGetAlpha

Function Style_StrGetAlpha

src/Styles.c:2566–2585  ·  view source on GitHub ↗

============================================================================= Style_StrGetAlpha()

Source from the content-addressed store, hash-verified

2564// Style_StrGetAlpha()
2565//
2566BOOL Style_StrGetAlpha ( LPCWSTR lpszStyle, int *i )
2567{
2568 WCHAR tch[256];
2569 WCHAR *p;
2570 int iValue;
2571 int itok;
2572 if ( p = StrStrI ( lpszStyle, L"alpha:" ) ) {
2573 lstrcpy ( tch, p + CSTRLEN ( L"alpha:" ) );
2574 if ( p = StrChr ( tch, L';' ) ) {
2575 *p = L'\0';
2576 }
2577 TrimString ( tch );
2578 itok = swscanf ( tch, L"%i", &iValue );
2579 if ( itok == 1 ) {
2580 *i = min ( max ( SC_ALPHA_TRANSPARENT, iValue ), SC_ALPHA_OPAQUE );
2581 return TRUE;
2582 }
2583 }
2584 return FALSE;
2585}
2586
2587
2588//=============================================================================

Callers 4

Style_SetLexerFunction · 0.85
Style_SelectFontFunction · 0.85
Style_SelectColorFunction · 0.85

Calls 1

TrimStringFunction · 0.85

Tested by

no test coverage detected