Module: wine Branch: master Commit: d02d35a7b1ed3805390213a19fb5b83082cac1b8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d02d35a7b1ed3805390213a19f...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Oct 16 09:47:43 2014 +0400
dwrite: Create IDWriteFontFace2 instance for IDWriteFont.
---
dlls/dwrite/analyzer.c | 2 -- dlls/dwrite/bidi.c | 1 - dlls/dwrite/dwrite_private.h | 4 +++- dlls/dwrite/font.c | 31 ++++++++++++------------------- dlls/dwrite/gdiinterop.c | 1 - dlls/dwrite/layout.c | 1 - dlls/dwrite/main.c | 4 +--- dlls/dwrite/opentype.c | 1 - dlls/dwrite/shape.c | 1 - 9 files changed, 16 insertions(+), 30 deletions(-)
diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 1a05335..46cf3b5 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -21,8 +21,6 @@
#define COBJMACROS
-#include "dwrite.h" -#include "dwrite_2.h" #include "dwrite_private.h" #include "scripts.h"
diff --git a/dlls/dwrite/bidi.c b/dlls/dwrite/bidi.c index 8e8daf6..48a7a06 100644 --- a/dlls/dwrite/bidi.c +++ b/dlls/dwrite/bidi.c @@ -48,7 +48,6 @@ #include "wine/debug.h" #include "wine/list.h"
-#include "dwrite_1.h" #include "dwrite_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(bidi); diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 4b54a35..88ca127 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include "dwrite_2.h" + #include "wine/debug.h" #include "wine/unicode.h"
@@ -103,7 +105,7 @@ extern HRESULT get_system_fontcollection(IDWriteFontCollection**) DECLSPEC_HIDDE extern HRESULT get_textanalyzer(IDWriteTextAnalyzer**) DECLSPEC_HIDDEN; extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) DECLSPEC_HIDDEN; extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN; -extern HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE facetype, UINT32 files_number, IDWriteFontFile* const* font_files, UINT32 index, DWRITE_FONT_SIMULATIONS sim_flags, IDWriteFontFace **font_face) DECLSPEC_HIDDEN; +extern HRESULT font_create_fontface(IDWriteFactory*,DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace2 **) DECLSPEC_HIDDEN;
/* Opentype font table functions */ extern HRESULT opentype_analyze_font(IDWriteFontFileStream*,UINT32*,DWRITE_FONT_FILE_TYPE*,DWRITE_FONT_FACE_TYPE*,BOOL*) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 9a2c636..fc13941 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -20,8 +20,6 @@
#define COBJMACROS
-#include "dwrite.h" -#include "dwrite_2.h" #include "dwrite_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dwrite); @@ -93,7 +91,7 @@ struct dwrite_font {
BOOL is_system; IDWriteFontFamily *family; - IDWriteFontFace *face; + IDWriteFontFace2 *face;
struct dwrite_font_data *data; }; @@ -689,7 +687,7 @@ static const IDWriteFontFace2Vtbl dwritefontfacevtbl = { dwritefontface2_GetRecommendedRenderingMode };
-static HRESULT create_system_fontface(struct dwrite_font *font, IDWriteFontFace **face) +static HRESULT create_system_fontface(struct dwrite_font *font, IDWriteFontFace2 **face) { struct dwrite_fontface *This;
@@ -722,7 +720,7 @@ static HRESULT create_system_fontface(struct dwrite_font *font, IDWriteFontFace This->logfont.lfWeight = font->data->weight; strcpyW(This->logfont.lfFaceName, font->data->facename);
- *face = (IDWriteFontFace*)&This->IDWriteFontFace2_iface; + *face = &This->IDWriteFontFace2_iface;
return S_OK; } @@ -736,7 +734,7 @@ HRESULT convert_fontface_to_logfont(IDWriteFontFace *face, LOGFONTW *logfont) return S_OK; }
-static HRESULT get_fontface_from_font(struct dwrite_font *font, IDWriteFontFace **fontface) +static HRESULT get_fontface_from_font(struct dwrite_font *font, IDWriteFontFace2 **fontface) { *fontface = NULL;
@@ -788,7 +786,7 @@ static ULONG WINAPI dwritefont_Release(IDWriteFont2 *iface)
if (!ref) { - if (This->face) IDWriteFontFace_Release(This->face); + if (This->face) IDWriteFontFace2_Release(This->face); if (This->family) IDWriteFontFamily_Release(This->family); _free_font_data(This->data); heap_free(This); @@ -868,7 +866,7 @@ static void WINAPI dwritefont_GetMetrics(IDWriteFont2 *iface, DWRITE_FONT_METRIC static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont2 *iface, UINT32 value, BOOL *exists) { struct dwrite_font *This = impl_from_IDWriteFont2(iface); - IDWriteFontFace *fontface; + IDWriteFontFace2 *fontface; UINT16 index; HRESULT hr;
@@ -881,7 +879,7 @@ static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont2 *iface, UINT32 value, return hr;
index = 0; - hr = IDWriteFontFace_GetGlyphIndices(fontface, &value, 1, &index); + hr = IDWriteFontFace2_GetGlyphIndices(fontface, &value, 1, &index); if (FAILED(hr)) return hr;
@@ -896,7 +894,7 @@ static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont2 *iface, IDWriteFont
TRACE("(%p)->(%p)\n", This, face);
- hr = get_fontface_from_font(This, face); + hr = get_fontface_from_font(This, (IDWriteFontFace2**)face); if (hr == S_OK) IDWriteFontFace_AddRef(*face);
@@ -918,8 +916,7 @@ static void WINAPI dwritefont1_GetPanose(IDWriteFont2 *iface, DWRITE_PANOSE *pan static HRESULT WINAPI dwritefont1_GetUnicodeRanges(IDWriteFont2 *iface, UINT32 max_count, DWRITE_UNICODE_RANGE *ranges, UINT32 *count) { struct dwrite_font *This = impl_from_IDWriteFont2(iface); - IDWriteFontFace2 *fontface2; - IDWriteFontFace *fontface; + IDWriteFontFace2 *fontface; HRESULT hr;
TRACE("(%p)->(%u %p %p)\n", This, max_count, ranges, count); @@ -928,11 +925,7 @@ static HRESULT WINAPI dwritefont1_GetUnicodeRanges(IDWriteFont2 *iface, UINT32 m if (FAILED(hr)) return hr;
- IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2); - hr = IDWriteFontFace2_GetUnicodeRanges(fontface2, max_count, ranges, count); - IDWriteFontFace2_Release(fontface2); - - return hr; + return IDWriteFontFace2_GetUnicodeRanges(fontface, max_count, ranges, count); }
static HRESULT WINAPI dwritefont1_IsMonospacedFont(IDWriteFont2 *iface) @@ -1652,7 +1645,7 @@ HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_ke return S_OK; }
-HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE facetype, UINT32 files_number, IDWriteFontFile* const* font_files, UINT32 index, DWRITE_FONT_SIMULATIONS sim_flags, IDWriteFontFace **font_face) +HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE facetype, UINT32 files_number, IDWriteFontFile* const* font_files, UINT32 index, DWRITE_FONT_SIMULATIONS sim_flags, IDWriteFontFace2 **font_face) { int i; struct dwrite_fontface *This; @@ -1706,7 +1699,7 @@ HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE facety This->data->simulations = sim_flags; This->is_system = FALSE;
- *font_face = (IDWriteFontFace*)&This->IDWriteFontFace2_iface; + *font_face = &This->IDWriteFontFace2_iface;
return S_OK; } diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index 7c20110..c3c2b11 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -25,7 +25,6 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" -#include "dwrite_1.h" #include "dwrite_private.h"
#include "wine/debug.h" diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 0afd466..86ddf3c 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -25,7 +25,6 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" -#include "dwrite_2.h" #include "dwrite_private.h" #include "wine/list.h"
diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index 0e0f5c5..50ad539 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -27,8 +27,6 @@ #include "winuser.h"
#include "initguid.h" -#include "dwrite.h" -#include "dwrite_2.h"
#include "dwrite_private.h" #include "wine/debug.h" @@ -609,7 +607,7 @@ static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory *iface, { struct dwritefactory *This = impl_from_IDWriteFactory(iface); TRACE("(%p)->(%d %u %p %u 0x%x %p)\n", This, facetype, files_number, font_files, index, sim_flags, font_face); - return font_create_fontface(iface, facetype, files_number, font_files, index, sim_flags, font_face); + return font_create_fontface(iface, facetype, files_number, font_files, index, sim_flags, (IDWriteFontFace2**)font_face); }
static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory *iface, IDWriteRenderingParams **params) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index b17e8ac..a11b2fb 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -20,7 +20,6 @@
#define COBJMACROS
-#include "dwrite_1.h" #include "dwrite_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dwrite); diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c index ba306c7..00c9548 100644 --- a/dlls/dwrite/shape.c +++ b/dlls/dwrite/shape.c @@ -21,7 +21,6 @@
#define COBJMACROS
-#include "dwrite_1.h" #include "dwrite_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dwrite);