Alexandre Julliard : gdi32: Implement GdiRealizationInfo as a standard driver entry point.

Alexandre Julliard julliard at winehq.org
Wed Oct 26 12:35:46 CDT 2011


Module: wine
Branch: master
Commit: 7fbb16d4ba9c4d36f6ac990e0e3823a12f1df742
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7fbb16d4ba9c4d36f6ac990e0e3823a12f1df742

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Oct 21 11:40:35 2011 +0200

gdi32: Implement GdiRealizationInfo as a standard driver entry point.

---

 dlls/gdi32/font.c        |    7 ++++---
 dlls/gdi32/freetype.c    |   27 +++++++++++++++------------
 dlls/gdi32/gdi_private.h |    1 -
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 700fc27..cda41dc 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -3397,11 +3397,12 @@ BOOL WINAPI FontIsLinked(HDC hdc)
 BOOL WINAPI GdiRealizationInfo(HDC hdc, realization_info_t *info)
 {
     DC *dc = get_dc_ptr(hdc);
-    BOOL ret = FALSE;
+    PHYSDEV dev;
+    BOOL ret;
 
     if (!dc) return FALSE;
-    if (dc->gdiFont) ret = WineEngRealizationInfo(dc->gdiFont, info);
+    dev = GET_DC_PHYSDEV( dc, pGdiRealizationInfo );
+    ret = dev->funcs->pGdiRealizationInfo( dev, info );
     release_dc_ptr(dc);
-
     return ret;
 }
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 81115ea..dee97ad 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6831,17 +6831,26 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
 }
 
 /*************************************************************
- *     WineEngRealizationInfo
+ * freetype_GdiRealizationInfo
  */
-BOOL WineEngRealizationInfo(GdiFont *font, realization_info_t *info)
+static BOOL freetype_GdiRealizationInfo( PHYSDEV dev, void *ptr )
 {
-    FIXME("(%p, %p): stub!\n", font, info);
+    struct freetype_physdev *physdev = get_freetype_dev( dev );
+    realization_info_t *info = ptr;
+
+    if (!physdev->font)
+    {
+        dev = GET_NEXT_PHYSDEV( dev, pGdiRealizationInfo );
+        return dev->funcs->pGdiRealizationInfo( dev, ptr );
+    }
+
+    FIXME("(%p, %p): stub!\n", physdev->font, info);
 
     info->flags = 1;
-    if(FT_IS_SCALABLE(font->ft_face))
+    if(FT_IS_SCALABLE(physdev->font->ft_face))
         info->flags |= 2;
 
-    info->cache_num = font->cache_num;
+    info->cache_num = physdev->font->cache_num;
     info->unknown2 = -1;
     return TRUE;
 }
@@ -7141,7 +7150,7 @@ static const struct gdi_dc_funcs freetype_funcs =
     freetype_FontIsLinked,              /* pFontIsLinked */
     NULL,                               /* pFrameRgn */
     NULL,                               /* pGdiComment */
-    NULL,                               /* pGdiRealizationInfo */
+    freetype_GdiRealizationInfo,        /* pGdiRealizationInfo */
     freetype_GetCharABCWidths,          /* pGetCharABCWidths */
     freetype_GetCharABCWidthsI,         /* pGetCharABCWidthsI */
     freetype_GetCharWidth,              /* pGetCharWidth */
@@ -7285,10 +7294,4 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
     return TRUE;
 }
 
-BOOL WineEngRealizationInfo(GdiFont *font, realization_info_t *info)
-{
-    ERR("called but we don't have FreeType\n");
-    return FALSE;
-}
-
 #endif /* HAVE_FREETYPE */
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index f9c86d0..a506756 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 BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN;
 extern BOOL WineEngInit(void) DECLSPEC_HIDDEN;
-extern BOOL WineEngRealizationInfo(GdiFont*, realization_info_t*) DECLSPEC_HIDDEN;
 extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN;
 
 /* gdiobj.c */




More information about the wine-cvs mailing list