fixing a hack that was done for beta1. It is now possible to control the font size, color, and shadowing for the text on the blue background in the installer via the config.ini. affects only windows. r=sgehani

This commit is contained in:
ssu%netscape.com 2000-03-17 02:38:13 +00:00
Родитель 14a440936a
Коммит 6fd78127b3
4 изменённых файлов: 174 добавлений и 81 удалений

Просмотреть файл

@ -55,18 +55,21 @@ Program Folder Path=[COMMON_PROGRAMS]
; Setup Type 3 - fourth radio button (usually the Custom option)
Default Setup Type=Setup Type 0
; Default Font Size is 32
; Default Font Color is WHITE (of BLACK and GREEN)
; Default Font Shadow is TRUE
Setup Title0=Mozilla Seamonkey Setup
Setup Title0 Font Size=
Setup Title0 Font Color=
Setup Title0 Font Shadow=TRUE
Setup Title1=Build $Version$
Setup Title0 Font Size=
Setup Title0 Font Color=
Setup Title0 Font Shadow=TRUE
Setup Title1 Font Size=12
Setup Title1 Font Color=BLACK
Setup Title1 Font Shadow=FALSE
Setup Title2=
Setup Title0 Font Size=
Setup Title0 Font Color=
Setup Title0 Font Shadow=TRUE
Setup Title2 Font Size=
Setup Title2 Font Color=
Setup Title2 Font Shadow=TRUE
; HKey: valid decryptable setup keys are [Mozilla Seamonkey CurrentVersion]
; and [Mozilla Seamonkey CurrentVersion].

Просмотреть файл

@ -286,25 +286,31 @@ HRESULT Initialize(HINSTANCE hInstance)
return(0);
}
void OutputSetupTitleHack(HDC hDC)
void OutputSetupTitle(HDC hDC)
{
COLORREF crTitle;
HFONT hfontTmp;
HFONT hfontTmp0;
HFONT hfontTmp1;
HFONT hfontTmp2;
HFONT hfontOld;
int nHeightOffset;
int nHeight;
int nHeight0;
int nHeight1;
int nHeight2;
int iLine0x;
int iLine0y;
int iLine1x;
int iLine1y;
int iLine2x;
int iLine2y;
int iShadowOffset;
SetBkMode(hDC, TRANSPARENT);
nHeightOffset = -MulDiv(36, GetDeviceCaps(hDC, LOGPIXELSY), 72);
nHeight = -MulDiv(12, GetDeviceCaps(hDC, LOGPIXELSY), 72);
hfontTmp = CreateFont(nHeight,
/*
* Setup Title Line 0
*/
nHeight0 = -MulDiv(sgProduct.iSetupTitle0FontSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
hfontTmp0 = CreateFont(nHeight0,
0,
0,
0,
@ -318,47 +324,75 @@ void OutputSetupTitleHack(HDC hDC)
PROOF_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"");
if(hfontTmp)
if(hfontTmp0)
hfontOld = SelectObject(hDC, hfontTmp0);
iLine0x = 20;
iLine0y = 20;
/* draw shadow */
if(sgProduct.bSetupTitle0FontShadow == TRUE)
{
hfontOld = SelectObject(hDC, hfontTmp);
/* Set shadow color to black and draw shadow */
SetTextColor(hDC, 0);
iShadowOffset = (int)(sgProduct.iSetupTitle0FontSize / 6);
TextOut(hDC, iLine0x + iShadowOffset, iLine0y + iShadowOffset, sgProduct.szSetupTitle0, lstrlen(sgProduct.szSetupTitle0));
}
crTitle = GetTextColor(hDC);
iLine0x = 23;
iLine0y = 30;
iLine1x = iLine0x;
iLine1y = iLine0y - nHeightOffset + 5;
iLine2x = iLine1x;
iLine2y = iLine1y - nHeightOffset + 5;
/* Set font color and draw; color format is 0x00bbggrr - where b is blue, g is green, and r is red */
/* 0x00088808 - green */
SetTextColor(hDC, sgProduct.crSetupTitle0FontColor);
/* Set shadow color to black and draw shadow */
if(SetTextColor(hDC, 0) == CLR_INVALID)
PrintError("Invalid Color", ERROR_CODE_SHOW);
/* draw text */
TextOut(hDC, iLine0x, iLine0y, sgProduct.szSetupTitle0, lstrlen(sgProduct.szSetupTitle0));
/*
* Setup Title Line 1
*/
nHeight1 = -MulDiv(sgProduct.iSetupTitle1FontSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
hfontTmp1 = CreateFont(nHeight1,
0,
0,
0,
FW_BOLD,
0,
0,
0,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
0,
PROOF_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"");
if(hfontTmp1)
SelectObject(hDC, hfontTmp1);
iLine1x = iLine0x;
iLine1y = iLine0y - nHeight0 + 5;
/* draw shadow */
if(sgProduct.bSetupTitle1FontShadow == TRUE)
{
/* Set shadow color to black and draw shadow */
SetTextColor(hDC, 0);
iShadowOffset = (int)(sgProduct.iSetupTitle1FontSize / 6);
TextOut(hDC, iLine1x + iShadowOffset, iLine1y + iShadowOffset, sgProduct.szSetupTitle1, lstrlen(sgProduct.szSetupTitle1));
}
/* Set font color and draw; color format is 0x00bbggrr - where b is blue, g is green, and r is red */
/* 0x00088808 - green */
SetTextColor(hDC, sgProduct.crSetupTitle1FontColor);
/* draw text */
TextOut(hDC, iLine1x, iLine1y, sgProduct.szSetupTitle1, lstrlen(sgProduct.szSetupTitle1));
SelectObject(hDC, hfontOld);
DeleteObject(hfontTmp);
}
void OutputSetupTitle(HDC hDC)
{
COLORREF crTitle;
HFONT hfontTmp;
HFONT hfontOld;
int nHeight;
int iLine0x;
int iLine0y;
int iLine1x;
int iLine1y;
int iLine2x;
int iLine2y;
SetBkMode(hDC, TRANSPARENT);
nHeight = -MulDiv(36, GetDeviceCaps(hDC, LOGPIXELSY), 72);
hfontTmp = CreateFont(nHeight,
/*
* Setup Title Line 2
*/
nHeight2 = -MulDiv(sgProduct.iSetupTitle2FontSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
hfontTmp2 = CreateFont(nHeight2,
0,
0,
0,
@ -372,42 +406,33 @@ void OutputSetupTitle(HDC hDC)
PROOF_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"");
if(hfontTmp)
{
hfontOld = SelectObject(hDC, hfontTmp);
}
if(hfontTmp2)
SelectObject(hDC, hfontTmp2);
crTitle = GetTextColor(hDC);
iLine0x = 20;
iLine0y = 20;
iLine1x = iLine0x;
iLine1y = iLine0y - nHeight + 5;
iLine2x = iLine1x;
iLine2y = iLine1y - nHeight + 5;
/* Set shadow color to black and draw shadow */
if(SetTextColor(hDC, 0) == CLR_INVALID)
PrintError("Invalid Color", ERROR_CODE_SHOW);
iLine2y = iLine1y - nHeight1+ 5;
/* draw shadow */
TextOut(hDC, iLine0x + 5, iLine0y + 5, sgProduct.szSetupTitle0, lstrlen(sgProduct.szSetupTitle0));
// TextOut(hDC, iLine1x + 5, iLine1y + 5, sgProduct.szSetupTitle1, lstrlen(sgProduct.szSetupTitle1));
TextOut(hDC, iLine2x + 5, iLine2y + 5, sgProduct.szSetupTitle2, lstrlen(sgProduct.szSetupTitle2));
if(sgProduct.bSetupTitle2FontShadow == TRUE)
{
/* Set shadow color to black and draw shadow */
SetTextColor(hDC, 0);
iShadowOffset = (int)(sgProduct.iSetupTitle2FontSize / 6);
TextOut(hDC, iLine2x + iShadowOffset, iLine2y + iShadowOffset, sgProduct.szSetupTitle2, lstrlen(sgProduct.szSetupTitle2));
}
/* Set font color and draw; color format is 0x00bbggrr - where b is blue, g is green, and r is red */
/* 0x00088808 - green */
if(SetTextColor(hDC, 0x00EEEEEE) == CLR_INVALID)
PrintError("Invalid Color", ERROR_CODE_SHOW);
SetTextColor(hDC, sgProduct.crSetupTitle2FontColor);
/* draw text */
TextOut(hDC, iLine0x, iLine0y, sgProduct.szSetupTitle0, lstrlen(sgProduct.szSetupTitle0));
// TextOut(hDC, iLine1x, iLine1y, sgProduct.szSetupTitle1, lstrlen(sgProduct.szSetupTitle1));
TextOut(hDC, iLine2x, iLine2y, sgProduct.szSetupTitle2, lstrlen(sgProduct.szSetupTitle2));
SelectObject(hDC, hfontOld);
DeleteObject(hfontTmp);
OutputSetupTitleHack(hDC);
DeleteObject(hfontTmp0);
DeleteObject(hfontTmp1);
DeleteObject(hfontTmp2);
}
HRESULT SdArchives(LPSTR szFileIdi, LPSTR szDownloadDir)
@ -2922,6 +2947,21 @@ BOOL CheckLegacy()
return(FALSE);
}
COLORREF DecryptFontColor(LPSTR szColor)
{
if((szColor == NULL) || (*szColor == '\0'))
return(0x00EEEEEE);
if(lstrcmpi(szColor, "WHITE") == 0)
return(0x00EEEEEE);
else if(lstrcmpi(szColor, "BLACK") == 0)
return(0x00000000);
else if(lstrcmpi(szColor, "GREEN") == 0)
return(0x00088808);
return(0x00EEEEEE);
}
HRESULT ParseConfigIni(LPSTR lpszCmdLine)
{
HDC hdc;
@ -2994,6 +3034,47 @@ HRESULT ParseConfigIni(LPSTR lpszCmdLine)
GetPrivateProfileString("General", "Setup Title1", "", sgProduct.szSetupTitle1, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("General", "Setup Title2", "", sgProduct.szSetupTitle2, MAX_BUF, szFileIniConfig);
/* get setup title font color */
GetPrivateProfileString("General", "Setup Title0 Font Color", "", szBuf, sizeof(szBuf), szFileIniConfig);
sgProduct.crSetupTitle0FontColor = DecryptFontColor(szBuf);
GetPrivateProfileString("General", "Setup Title1 Font Color", "", szBuf, sizeof(szBuf), szFileIniConfig);
sgProduct.crSetupTitle1FontColor = DecryptFontColor(szBuf);
GetPrivateProfileString("General", "Setup Title2 Font Color", "", szBuf, sizeof(szBuf), szFileIniConfig);
sgProduct.crSetupTitle2FontColor = DecryptFontColor(szBuf);
/* get setup title font size */
sgProduct.iSetupTitle0FontSize = 32;
sgProduct.iSetupTitle1FontSize = 32;
sgProduct.iSetupTitle2FontSize = 32;
GetPrivateProfileString("General", "Setup Title0 Font Size", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(*szBuf != '\0')
sgProduct.iSetupTitle0FontSize = atoi(szBuf);
GetPrivateProfileString("General", "Setup Title1 Font Size", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(*szBuf != '\0')
sgProduct.iSetupTitle1FontSize = atoi(szBuf);
GetPrivateProfileString("General", "Setup Title2 Font Size", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(*szBuf != '\0')
sgProduct.iSetupTitle2FontSize = atoi(szBuf);
/* get setup title font shadow */
GetPrivateProfileString("General", "Setup Title0 Font Shadow", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(lstrcmpi(szBuf, "FALSE") == 0)
sgProduct.bSetupTitle0FontShadow = FALSE;
else
sgProduct.bSetupTitle0FontShadow = TRUE;
GetPrivateProfileString("General", "Setup Title1 Font Shadow", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(lstrcmpi(szBuf, "FALSE") == 0)
sgProduct.bSetupTitle1FontShadow = FALSE;
else
sgProduct.bSetupTitle1FontShadow = TRUE;
GetPrivateProfileString("General", "Setup Title2 Font Shadow", "", szBuf, sizeof(szBuf), szFileIniConfig);
if(lstrcmpi(szBuf, "FALSE") == 0)
sgProduct.bSetupTitle2FontShadow = FALSE;
else
sgProduct.bSetupTitle2FontShadow = TRUE;
/* Welcome dialog */
GetPrivateProfileString("Dialog Welcome", "Show Dialog", "", szShowDialog, MAX_BUF, szFileIniConfig);
GetPrivateProfileString("Dialog Welcome", "Title", "", diWelcome.szTitle, MAX_BUF, szFileIniConfig);

Просмотреть файл

@ -106,7 +106,6 @@ HRESULT ParseSetupIni(void);
HRESULT GetConfigIni(void);
void CleanTempFiles(void);
void OutputSetupTitle(HDC hDC);
void OutputSetupTitleHack(HDC hDC);
HRESULT SdArchives(LPSTR szFileIdi, LPSTR szDownloadDir);
HRESULT RetrieveArchives(void);
/* HRESULT SmartUpdateJars(void); */
@ -149,6 +148,7 @@ void TranslateVersionStr(LPSTR szVersion, verBlock *vbVersion);
BOOL GetFileVersion(LPSTR szFile, verBlock *vbVersion);
BOOL CheckLegacy(void);
int CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew);
COLORREF DecryptFontColor(LPSTR szColor);
BOOL bSDInit;

Просмотреть файл

@ -230,16 +230,25 @@ typedef struct dlgReboot
typedef struct setupStruct
{
DWORD dwMode;
DWORD dwCustomType;
LPSTR szPath;
LPSTR szProductName;
LPSTR szProgramFolderName;
LPSTR szProgramFolderPath;
LPSTR szAlternateArchiveSearchPath;
LPSTR szSetupTitle0;
LPSTR szSetupTitle1;
LPSTR szSetupTitle2;
DWORD dwMode;
DWORD dwCustomType;
LPSTR szPath;
LPSTR szProductName;
LPSTR szProgramFolderName;
LPSTR szProgramFolderPath;
LPSTR szAlternateArchiveSearchPath;
LPSTR szSetupTitle0;
COLORREF crSetupTitle0FontColor;
int iSetupTitle0FontSize;
BOOL bSetupTitle0FontShadow;
LPSTR szSetupTitle1;
COLORREF crSetupTitle1FontColor;
int iSetupTitle1FontSize;
BOOL bSetupTitle1FontShadow;
LPSTR szSetupTitle2;
COLORREF crSetupTitle2FontColor;
int iSetupTitle2FontSize;
BOOL bSetupTitle2FontShadow;
} setupGen;
typedef struct sinfoSmartDownload