Module: wine Branch: master Commit: 1740f34ffbafc3f250a225ffbdb1d859726711d6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1740f34ffbafc3f250a225ffbd...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Oct 20 16:55:16 2011 +0200
gdi32: Implement GetTextCharsetInfo as a standard driver entry point.
---
dlls/gdi32/font.c | 11 ++++------- dlls/gdi32/freetype.c | 24 ++++++++++++++---------- dlls/gdi32/gdi_private.h | 1 - 3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 5e55e31..38ad477 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -472,10 +472,7 @@ HFONT WINAPI CreateFontW( INT height, INT width, INT esc, static void update_font_code_page( DC *dc ) { CHARSETINFO csi; - int charset = DEFAULT_CHARSET; - - if (dc->gdiFont) - charset = WineEngGetTextCharsetInfo( dc->gdiFont, NULL, 0 ); + int charset = GetTextCharsetInfo( dc->hSelf, NULL, 0 );
/* Hmm, nicely designed api this one! */ if (TranslateCharsetInfo( ULongToPtr(charset), &csi, TCI_SRCCHARSET) ) @@ -3261,12 +3258,12 @@ UINT WINAPI GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE fs, DWORD flags) { UINT ret = DEFAULT_CHARSET; DC *dc = get_dc_ptr(hdc); + PHYSDEV dev;
if (dc) { - if (dc->gdiFont) - ret = WineEngGetTextCharsetInfo(dc->gdiFont, fs, flags); - + dev = GET_DC_PHYSDEV( dc, pGetTextCharsetInfo ); + ret = dev->funcs->pGetTextCharsetInfo( dev, fs, flags ); release_dc_ptr( dc ); }
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 5d5e8a5..31f52b8 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6602,10 +6602,20 @@ INT WineEngGetTextFace(GdiFont *font, INT count, LPWSTR str) return n; }
-UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) +/************************************************************* + * freetype_GetTextCharsetInfo + */ +static UINT freetype_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD flags ) { - if (fs) *fs = font->fs; - return font->charset; + struct freetype_physdev *physdev = get_freetype_dev( dev ); + + if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetTextCharsetInfo ); + return dev->funcs->pGetTextCharsetInfo( dev, fs, flags ); + } + if (fs) *fs = physdev->font->fs; + return physdev->font->charset; }
BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) @@ -7119,7 +7129,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pGetPixel */ NULL, /* pGetPixelFormat */ NULL, /* pGetSystemPaletteEntries */ - NULL, /* pGetTextCharsetInfo */ + freetype_GetTextCharsetInfo, /* pGetTextCharsetInfo */ freetype_GetTextExtentExPoint, /* pGetTextExtentExPoint */ NULL, /* pGetTextExtentExPointI */ NULL, /* pGetTextFace */ @@ -7249,12 +7259,6 @@ HANDLE WineEngAddFontMemResourceEx(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD return NULL; }
-UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) -{ - FIXME("(%p, %p, %u): stub\n", font, fs, flags); - return DEFAULT_CHARSET; -} - BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) { return FALSE; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 3e9cad6..365d158 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -294,7 +294,6 @@ extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN; -extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) DECLSPEC_HIDDEN; extern BOOL WineEngGetTextExtentExPointI(GdiFont*, const WORD *, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN; extern INT WineEngGetTextFace(GdiFont*, INT, LPWSTR) DECLSPEC_HIDDEN; extern BOOL WineEngFontIsLinked(GdiFont*) DECLSPEC_HIDDEN;