Commit e6ab9d30 authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

Make sure that all calls use the extended structures which are a

superset of the regular structures.
parent 9f295f12
...@@ -1109,6 +1109,12 @@ static UINT XFONT_GetFontMetric( const fontInfo* pfi, const LPENUMLOGFONTEX16 pL ...@@ -1109,6 +1109,12 @@ static UINT XFONT_GetFontMetric( const fontInfo* pfi, const LPENUMLOGFONTEX16 pL
lstrcpynA( plf->lfFaceName, pfi->df.dfFace, LF_FACESIZE ); lstrcpynA( plf->lfFaceName, pfi->df.dfFace, LF_FACESIZE );
#undef plf #undef plf
/* FIXME: fill in rest of plF values
lstrcpynA(plF->elfFullName, , LF_FULLFACESIZE);
lstrcpynA(plF->elfStyle, , LF_FACESIZE);
lstrcpynA(plF->elfScript, , LF_FACESIZE);
*/
pTM->tmAscent = pfi->df.dfAscent; pTM->tmAscent = pfi->df.dfAscent;
pTM->tmDescent = pTM->tmHeight - pTM->tmAscent; pTM->tmDescent = pTM->tmHeight - pTM->tmAscent;
pTM->tmInternalLeading = pfi->df.dfInternalLeading; pTM->tmInternalLeading = pfi->df.dfInternalLeading;
...@@ -2996,7 +3002,7 @@ BOOL X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf, ...@@ -2996,7 +3002,7 @@ BOOL X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
release the crit section, font list will release the crit section, font list will
have to be retraversed on return */ have to be retraversed on return */
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm, if( (b = (*proc)( &lf, &tm,
XFONT_GetFontMetric( pfi, &lf, &tm ), lp )) ) XFONT_GetFontMetric( pfi, &lf, &tm ), lp )) )
bRet = b; bRet = b;
else break; else break;
...@@ -3008,7 +3014,7 @@ BOOL X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf, ...@@ -3008,7 +3014,7 @@ BOOL X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
{ {
if(pfr->fi) if(pfr->fi)
{ {
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm, if( (b = (*proc)( &lf, &tm,
XFONT_GetFontMetric( pfr->fi, &lf, &tm ), lp )) ) XFONT_GetFontMetric( pfr->fi, &lf, &tm ), lp )) )
bRet = b; bRet = b;
else break; else break;
......
...@@ -165,7 +165,7 @@ typedef struct tagDC ...@@ -165,7 +165,7 @@ typedef struct tagDC
/* Device functions for the Wine driver interface */ /* Device functions for the Wine driver interface */
typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM); typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEX16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
typedef struct tagDC_FUNCS typedef struct tagDC_FUNCS
{ {
......
...@@ -201,7 +201,7 @@ typedef struct ...@@ -201,7 +201,7 @@ typedef struct
typedef struct typedef struct
{ {
LPLOGFONTW lpLogFontParam; LPLOGFONTW lpLogFontParam;
FONTENUMPROCW lpEnumFunc; FONTENUMPROCEXW lpEnumFunc;
LPARAM lpData; LPARAM lpData;
LPNEWTEXTMETRICEXW lpTextMetric; LPNEWTEXTMETRICEXW lpTextMetric;
......
...@@ -36,7 +36,7 @@ typedef struct ...@@ -36,7 +36,7 @@ typedef struct
typedef struct typedef struct
{ {
LPLOGFONTW lpLogFontParam; LPLOGFONTW lpLogFontParam;
FONTENUMPROCW lpEnumFunc; FONTENUMPROCEXW lpEnumFunc;
LPARAM lpData; LPARAM lpData;
LPNEWTEXTMETRICEXW lpTextMetric; LPNEWTEXTMETRICEXW lpTextMetric;
...@@ -132,6 +132,22 @@ void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 ) ...@@ -132,6 +132,22 @@ void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 )
lstrcpynAtoW( font32->lfFaceName, font16->lfFaceName, LF_FACESIZE ); lstrcpynAtoW( font32->lfFaceName, font16->lfFaceName, LF_FACESIZE );
} }
void FONT_EnumLogFontEx16To32A( const LPENUMLOGFONTEX16 font16, LPENUMLOGFONTEXA font32 )
{
FONT_LogFont16To32A( (LPLOGFONT16)font16, (LPLOGFONTA)font32);
lstrcpynA( font32->elfFullName, font16->elfFullName, LF_FULLFACESIZE );
lstrcpynA( font32->elfStyle, font16->elfStyle, LF_FACESIZE );
lstrcpynA( font32->elfScript, font16->elfScript, LF_FACESIZE );
}
void FONT_EnumLogFontEx16To32W( const LPENUMLOGFONTEX16 font16, LPENUMLOGFONTEXW font32 )
{
FONT_LogFont16To32W( (LPLOGFONT16)font16, (LPLOGFONTW)font32);
lstrcpynAtoW( font32->elfFullName, font16->elfFullName, LF_FULLFACESIZE );
lstrcpynAtoW( font32->elfStyle, font16->elfStyle, LF_FACESIZE );
lstrcpynAtoW( font32->elfScript, font16->elfScript, LF_FACESIZE );
}
/*********************************************************************** /***********************************************************************
* TEXTMETRIC conversion functions. * TEXTMETRIC conversion functions.
*/ */
...@@ -429,7 +445,7 @@ INT FONT_GetObjectW( FONTOBJ *font, INT count, LPSTR buffer ) ...@@ -429,7 +445,7 @@ INT FONT_GetObjectW( FONTOBJ *font, INT count, LPSTR buffer )
* Called by the device driver layer to pass font info * Called by the device driver layer to pass font info
* down to the application. * down to the application.
*/ */
static INT FONT_EnumInstance16( LPENUMLOGFONT16 plf, static INT FONT_EnumInstance16( LPENUMLOGFONTEX16 plf,
LPNEWTEXTMETRIC16 ptm, UINT16 fType, LPARAM lp ) LPNEWTEXTMETRIC16 ptm, UINT16 fType, LPARAM lp )
{ {
#define pfe ((fontEnum16*)lp) #define pfe ((fontEnum16*)lp)
...@@ -448,7 +464,7 @@ static INT FONT_EnumInstance16( LPENUMLOGFONT16 plf, ...@@ -448,7 +464,7 @@ static INT FONT_EnumInstance16( LPENUMLOGFONT16 plf,
/*********************************************************************** /***********************************************************************
* FONT_EnumInstance * FONT_EnumInstance
*/ */
static INT FONT_EnumInstance( LPENUMLOGFONT16 plf, static INT FONT_EnumInstance( LPENUMLOGFONTEX16 plf,
LPNEWTEXTMETRIC16 ptm, UINT16 fType, LPARAM lp ) LPNEWTEXTMETRIC16 ptm, UINT16 fType, LPARAM lp )
{ {
/* lfCharSet is at the same offset in both LOGFONT32A and LOGFONT32W */ /* lfCharSet is at the same offset in both LOGFONT32A and LOGFONT32W */
...@@ -461,17 +477,21 @@ static INT FONT_EnumInstance( LPENUMLOGFONT16 plf, ...@@ -461,17 +477,21 @@ static INT FONT_EnumInstance( LPENUMLOGFONT16 plf,
if( pfe->dwFlags & ENUM_UNICODE ) if( pfe->dwFlags & ENUM_UNICODE )
{ {
FONT_LogFont16To32W( &plf->elfLogFont, (LPLOGFONTW)(pfe->lpLogFont) ); FONT_EnumLogFontEx16To32W( plf, pfe->lpLogFont );
FONT_TextMetric16to32W( (LPTEXTMETRIC16)ptm, (LPTEXTMETRICW)(pfe->lpTextMetric) ); FONT_TextMetric16to32W( (LPTEXTMETRIC16)ptm, (LPTEXTMETRICW)(pfe->lpTextMetric) );
return pfe->lpEnumFunc( pfe->lpLogFont, pfe->lpTextMetric, fType, pfe->lpData );
} }
else else
{ {
FONT_LogFont16To32A( &plf->elfLogFont, (LPLOGFONTA)pfe->lpLogFont ); ENUMLOGFONTEXA logfont;
FONT_EnumLogFontEx16To32A( plf, &logfont);
FONT_TextMetric16to32A( (LPTEXTMETRIC16)ptm, (LPTEXTMETRICA)pfe->lpTextMetric ); FONT_TextMetric16to32A( (LPTEXTMETRIC16)ptm, (LPTEXTMETRICA)pfe->lpTextMetric );
}
return pfe->lpEnumFunc( (LPENUMLOGFONTW)pfe->lpLogFont, return pfe->lpEnumFunc( (LPENUMLOGFONTEXW)&logfont,
(LPNEWTEXTMETRICW)pfe->lpTextMetric, fType, pfe->lpData ); pfe->lpTextMetric, fType, pfe->lpData );
}
} }
#undef pfe #undef pfe
return 1; return 1;
...@@ -519,7 +539,7 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf, ...@@ -519,7 +539,7 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
/*********************************************************************** /***********************************************************************
* FONT_EnumFontFamiliesEx * FONT_EnumFontFamiliesEx
*/ */
static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, FONTENUMPROCW efproc, static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, FONTENUMPROCEXW efproc,
LPARAM lParam, DWORD dwUnicode) LPARAM lParam, DWORD dwUnicode)
{ {
DC* dc = (DC*) GDI_GetObjPtr( hDC, DC_MAGIC ); DC* dc = (DC*) GDI_GetObjPtr( hDC, DC_MAGIC );
...@@ -563,8 +583,7 @@ INT WINAPI EnumFontFamiliesExW( HDC hDC, LPLOGFONTW plf, ...@@ -563,8 +583,7 @@ INT WINAPI EnumFontFamiliesExW( HDC hDC, LPLOGFONTW plf,
FONTENUMPROCEXW efproc, FONTENUMPROCEXW efproc,
LPARAM lParam, DWORD dwFlags ) LPARAM lParam, DWORD dwFlags )
{ {
return FONT_EnumFontFamiliesEx( hDC, plf, (FONTENUMPROCW)efproc, return FONT_EnumFontFamiliesEx( hDC, plf, efproc, lParam, ENUM_UNICODE );
lParam, ENUM_UNICODE );
} }
/*********************************************************************** /***********************************************************************
...@@ -575,7 +594,7 @@ INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf, ...@@ -575,7 +594,7 @@ INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf,
LPARAM lParam, DWORD dwFlags) LPARAM lParam, DWORD dwFlags)
{ {
return FONT_EnumFontFamiliesEx( hDC, (LPLOGFONTW)plf, return FONT_EnumFontFamiliesEx( hDC, (LPLOGFONTW)plf,
(FONTENUMPROCW)efproc, lParam, 0); (FONTENUMPROCEXW)efproc, lParam, 0);
} }
/*********************************************************************** /***********************************************************************
...@@ -606,7 +625,7 @@ INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily, ...@@ -606,7 +625,7 @@ INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily,
else lf.lfFaceName[0] = lf.lfFaceName[1] = '\0'; else lf.lfFaceName[0] = lf.lfFaceName[1] = '\0';
return FONT_EnumFontFamiliesEx( hDC, (LPLOGFONTW)&lf, return FONT_EnumFontFamiliesEx( hDC, (LPLOGFONTW)&lf,
(FONTENUMPROCW)efproc, lpData, 0 ); (FONTENUMPROCEXW)efproc, lpData, 0 );
} }
/*********************************************************************** /***********************************************************************
...@@ -621,7 +640,8 @@ INT WINAPI EnumFontFamiliesW( HDC hDC, LPCWSTR lpFamily, ...@@ -621,7 +640,8 @@ INT WINAPI EnumFontFamiliesW( HDC hDC, LPCWSTR lpFamily,
if( lpFamily ) lstrcpynW( lf.lfFaceName, lpFamily, LF_FACESIZE ); if( lpFamily ) lstrcpynW( lf.lfFaceName, lpFamily, LF_FACESIZE );
else lf.lfFaceName[0] = 0; else lf.lfFaceName[0] = 0;
return FONT_EnumFontFamiliesEx( hDC, &lf, efproc, lpData, ENUM_UNICODE ); return FONT_EnumFontFamiliesEx( hDC, &lf, (FONTENUMPROCEXW)efproc,
lpData, ENUM_UNICODE );
} }
/*********************************************************************** /***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment