From cb1e749aa9ac421629cf8d443b7aac7dfdd2fe72 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 5 Aug 2015 22:05:36 +0200 Subject: Rename dwrite.h, minor cleanups Rename dwrite.h to dwrite_c.h to make the difference between the official header and ours clearer. Also apply minor cleanups to it. Remove the patch against upstream MinGW; it's pointless now. --- dwrite.diff | 293 --------------------- libass/Makefile.am | 2 +- libass/ass_directwrite.c | 6 +- libass/dwrite.h | 668 ---------------------------------------------- libass/dwrite_c.h | 673 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 675 insertions(+), 967 deletions(-) delete mode 100644 dwrite.diff delete mode 100644 libass/dwrite.h create mode 100644 libass/dwrite_c.h diff --git a/dwrite.diff b/dwrite.diff deleted file mode 100644 index 99ee65b..0000000 --- a/dwrite.diff +++ /dev/null @@ -1,293 +0,0 @@ ---- /mnt/ssd/mxe/./usr/i686-w64-mingw32.static/include/dwrite.h 2015-06-24 14:42:38.197360516 +0200 -+++ libass/dwrite.h 2015-07-11 21:29:54.004831430 +0200 -@@ -662,8 +662,8 @@ - #define IDWriteBitmapRenderTarget_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteBitmapRenderTarget_DrawGlyphRun(This,baselineOriginX,baselineOriginY,measuringMode,glyphRun,renderingParams,textColor,blackBoxRect) (This)->lpVtbl->DrawGlyphRun(This,baselineOriginX,baselineOriginY,measuringMode,glyphRun,renderingParams,textColor,blackBoxRect) - #define IDWriteBitmapRenderTarget_GetCurrentTransform(This,transform) (This)->lpVtbl->GetCurrentTransform(This,transform) --#define IDWriteBitmapRenderTarget_GetMemoryDC() (This)->lpVtbl->GetMemoryDC(This) --#define IDWriteBitmapRenderTarget_GetPixelsPerDip() (This)->lpVtbl->GetPixelsPerDip(This) -+#define IDWriteBitmapRenderTarget_GetMemoryDC(This) (This)->lpVtbl->GetMemoryDC(This) -+#define IDWriteBitmapRenderTarget_GetPixelsPerDip(This) (This)->lpVtbl->GetPixelsPerDip(This) - #define IDWriteBitmapRenderTarget_GetSize(This,size) (This)->lpVtbl->GetSize(This,size) - #define IDWriteBitmapRenderTarget_Resize(This,width,height) (This)->lpVtbl->Resize(This,width,height) - #define IDWriteBitmapRenderTarget_SetCurrentTransform(This,transform) (This)->lpVtbl->SetCurrentTransform(This,transform) -@@ -880,12 +880,12 @@ - #define IDWriteFont_GetFontFamily(This,fontFamily) (This)->lpVtbl->GetFontFamily(This,fontFamily) - #define IDWriteFont_GetInformationalStrings(This,informationalStringID,informationalStrings,exists) (This)->lpVtbl->GetInformationalStrings(This,informationalStringID,informationalStrings,exists) - #define IDWriteFont_GetMetrics(This,fontMetrics) (This)->lpVtbl->GetMetrics(This,fontMetrics) --#define IDWriteFont_GetSimulations() (This)->lpVtbl->GetSimulations(This) --#define IDWriteFont_GetStretch() (This)->lpVtbl->GetStretch(This) --#define IDWriteFont_GetStyle() (This)->lpVtbl->GetStyle(This) --#define IDWriteFont_GetWeight() (This)->lpVtbl->GetWeight(This) -+#define IDWriteFont_GetSimulations(This) (This)->lpVtbl->GetSimulations(This) -+#define IDWriteFont_GetStretch(This) (This)->lpVtbl->GetStretch(This) -+#define IDWriteFont_GetStyle(This) (This)->lpVtbl->GetStyle(This) -+#define IDWriteFont_GetWeight(This) (This)->lpVtbl->GetWeight(This) - #define IDWriteFont_HasCharacter(This,unicodeValue,exists) (This)->lpVtbl->HasCharacter(This,unicodeValue,exists) --#define IDWriteFont_IsSymbolFont() (This)->lpVtbl->IsSymbolFont(This) -+#define IDWriteFont_IsSymbolFont(This) (This)->lpVtbl->IsSymbolFont(This) - #endif /*COBJMACROS*/ - - #undef INTERFACE -@@ -925,7 +925,7 @@ - #define IDWriteFontCollection_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteFontCollection_FindFamilyName(This,familyName,index,exists) (This)->lpVtbl->FindFamilyName(This,familyName,index,exists) - #define IDWriteFontCollection_GetFontFamily(This,index,fontFamily) (This)->lpVtbl->GetFontFamily(This,index,fontFamily) --#define IDWriteFontCollection_GetFontFamilyCount() (This)->lpVtbl->GetFontFamilyCount(This) -+#define IDWriteFontCollection_GetFontFamilyCount(This) (This)->lpVtbl->GetFontFamilyCount(This) - #define IDWriteFontCollection_GetFontFromFontFace(This,fontFace,font) (This)->lpVtbl->GetFontFromFontFace(This,fontFace,font) - #endif /*COBJMACROS*/ - -@@ -1020,18 +1020,18 @@ - #define IDWriteFontFace_AddRef(This) (This)->lpVtbl->AddRef(This) - #define IDWriteFontFace_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteFontFace_GetDesignGlyphMetrics(This,glyphIndices,glyphCount,glyphMetrics,isSideways) (This)->lpVtbl->GetDesignGlyphMetrics(This,glyphIndices,glyphCount,glyphMetrics,isSideways) --#define IDWriteFontFace_GetFiles(This,fontFiles) (This)->lpVtbl->GetFiles(This,fontFiles) -+#define IDWriteFontFace_GetFiles(This,fontFiles,b) (This)->lpVtbl->GetFiles(This,fontFiles,b) - #define IDWriteFontFace_GetGdiCompatibleMetrics(This,emSize,pixelsPerDip,transform,fontFaceMetrics) (This)->lpVtbl->GetGdiCompatibleMetrics(This,emSize,pixelsPerDip,transform,fontFaceMetrics) - #define IDWriteFontFace_GetGdiCompatibleGlyphMetrics(This,emSize,pixelsPerDip,transform,useGdiNatural,glyphIndices,glyphCount,glyphMetrics,isSideways) (This)->lpVtbl->GetGdiCompatibleGlyphMetrics(This,emSize,pixelsPerDip,transform,useGdiNatural,glyphIndices,glyphCount,glyphMetrics,isSideways) --#define IDWriteFontFace_GetGlyphCount() (This)->lpVtbl->GetGlyphCount(This) -+#define IDWriteFontFace_GetGlyphCount(This) (This)->lpVtbl->GetGlyphCount(This) - #define IDWriteFontFace_GetGlyphIndices(This,codePoints,codePointCount,glyphIndices) (This)->lpVtbl->GetGlyphIndices(This,codePoints,codePointCount,glyphIndices) - #define IDWriteFontFace_GetGlyphRunOutline(This,emSize,glyphIndices,glyphOffsets,glyphCount,isSideways,isRightToLeft,geometrySink) (This)->lpVtbl->GetGlyphRunOutline(This,emSize,glyphIndices,glyphOffsets,glyphCount,isSideways,isRightToLeft,geometrySink) --#define IDWriteFontFace_GetIndex() (This)->lpVtbl->GetIndex(This) -+#define IDWriteFontFace_GetIndex(This) (This)->lpVtbl->GetIndex(This) - #define IDWriteFontFace_GetMetrics(This,fontFaceMetrics) (This)->lpVtbl->GetMetrics(This,fontFaceMetrics) - #define IDWriteFontFace_GetRecommendedRenderingMode(This,emSize,pixelsPerDip,measuringMode,renderingParams,renderingMode) (This)->lpVtbl->GetRecommendedRenderingMode(This,emSize,pixelsPerDip,measuringMode,renderingParams,renderingMode) --#define IDWriteFontFace_GetSimulations() (This)->lpVtbl->GetSimulations(This) --#define IDWriteFontFace_GetType() (This)->lpVtbl->GetType(This) --#define IDWriteFontFace_IsSymbolFont() (This)->lpVtbl->IsSymbolFont(This) -+#define IDWriteFontFace_GetSimulations(This) (This)->lpVtbl->GetSimulations(This) -+#define IDWriteFontFace_GetType(This) (This)->lpVtbl->GetType(This) -+#define IDWriteFontFace_IsSymbolFont(This) (This)->lpVtbl->IsSymbolFont(This) - #define IDWriteFontFace_ReleaseFontTable(This,tableContext) (This)->lpVtbl->ReleaseFontTable(This,tableContext) - #define IDWriteFontFace_TryGetFontTable(This,openTypeTableTag,tableData,tableSize,tableContext,exists) (This)->lpVtbl->TryGetFontTable(This,openTypeTableTag,tableData,tableSize,tableContext,exists) - #endif /*COBJMACROS*/ -@@ -1067,7 +1067,7 @@ - #define IDWriteFontList_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteFontList_GetFont(This,index,font) (This)->lpVtbl->GetFont(This,index,font) - #define IDWriteFontList_GetFontCollection(This,fontCollection) (This)->lpVtbl->GetFontCollection(This,fontCollection) --#define IDWriteFontList_GetFontCount() (This)->lpVtbl->GetFontCount(This) -+#define IDWriteFontList_GetFontCount(This) (This)->lpVtbl->GetFontCount(This) - #endif /*COBJMACROS*/ - - #undef INTERFACE -@@ -1117,7 +1117,7 @@ - #define IDWriteFontFamily_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteFontFamily_GetFont(This,index,font) (This)->lpVtbl->GetFont(This,index,font) - #define IDWriteFontFamily_GetFontCollection(This,fontCollection) (This)->lpVtbl->GetFontCollection(This,fontCollection) --#define IDWriteFontFamily_GetFontCount() (This)->lpVtbl->GetFontCount(This) -+#define IDWriteFontFamily_GetFontCount(This) (This)->lpVtbl->GetFontCount(This) - #define IDWriteFontFamily_GetFamilyNames(This,names) (This)->lpVtbl->GetFamilyNames(This,names) - #define IDWriteFontFamily_GetFirstMatchingFont(This,weight,stretch,style,matchingFont) (This)->lpVtbl->GetFirstMatchingFont(This,weight,stretch,style,matchingFont) - #define IDWriteFontFamily_GetMatchingFonts(This,weight,stretch,style,matchingFonts) (This)->lpVtbl->GetMatchingFonts(This,weight,stretch,style,matchingFonts) -@@ -1175,7 +1175,7 @@ - #endif - - /* IDWriteFontFileLoader methods */ -- STDMETHOD(CreateStreamFromKey)( -+ STDMETHOD(CreateStreamFromKey)(THIS_ - void const *fontFileReferenceKey, - UINT32 fontFileReferenceKeySize, - IDWriteFontFileStream **fontFileStream) PURE; -@@ -1490,7 +1490,7 @@ - #define IDWriteLocalizedStrings_AddRef(This) (This)->lpVtbl->AddRef(This) - #define IDWriteLocalizedStrings_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteLocalizedStrings_FindLocaleName(This,localeName,index,exists) (This)->lpVtbl->FindLocaleName(This,localeName,index,exists) --#define IDWriteLocalizedStrings_GetCount() (This)->lpVtbl->GetCount(This) -+#define IDWriteLocalizedStrings_GetCount(This) (This)->lpVtbl->GetCount(This) - #define IDWriteLocalizedStrings_GetLocaleName(This,index,localeName,size) (This)->lpVtbl->GetLocaleName(This,index,localeName,size) - #define IDWriteLocalizedStrings_GetLocaleNameLength(This,index,length) (This)->lpVtbl->GetLocaleNameLength(This,index,length) - #define IDWriteLocalizedStrings_GetString(This,index,stringBuffer,size) (This)->lpVtbl->GetString(This,index,stringBuffer,size) -@@ -1581,11 +1581,11 @@ - #define IDWriteRenderingParams_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) - #define IDWriteRenderingParams_AddRef(This) (This)->lpVtbl->AddRef(This) - #define IDWriteRenderingParams_Release(This) (This)->lpVtbl->Release(This) --#define IDWriteRenderingParams_GetClearTypeLevel() (This)->lpVtbl->GetClearTypeLevel(This) --#define IDWriteRenderingParams_GetEnhancedContrast() (This)->lpVtbl->GetEnhancedContrast(This) --#define IDWriteRenderingParams_GetGamma() (This)->lpVtbl->GetGamma(This) --#define IDWriteRenderingParams_GetPixelGeometry() (This)->lpVtbl->GetPixelGeometry(This) --#define IDWriteRenderingParams_GetRenderingMode() (This)->lpVtbl->GetRenderingMode(This) -+#define IDWriteRenderingParams_GetClearTypeLevel(This) (This)->lpVtbl->GetClearTypeLevel(This) -+#define IDWriteRenderingParams_GetEnhancedContrast(This) (This)->lpVtbl->GetEnhancedContrast(This) -+#define IDWriteRenderingParams_GetGamma(This) (This)->lpVtbl->GetGamma(This) -+#define IDWriteRenderingParams_GetPixelGeometry(This) (This)->lpVtbl->GetPixelGeometry(This) -+#define IDWriteRenderingParams_GetRenderingMode(This) (This)->lpVtbl->GetRenderingMode(This) - #endif /*COBJMACROS*/ - - #undef INTERFACE -@@ -1679,7 +1679,7 @@ - #define IDWriteTextAnalysisSource_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteTextAnalysisSource_GetLocaleName(This,textPosition,textLength,localeName) (This)->lpVtbl->GetLocaleName(This,textPosition,textLength,localeName) - #define IDWriteTextAnalysisSource_GetNumberSubstitution(This,textPosition,textLength,numberSubstitution) (This)->lpVtbl->GetNumberSubstitution(This,textPosition,textLength,numberSubstitution) --#define IDWriteTextAnalysisSource_GetParagraphReadingDirection() (This)->lpVtbl->GetParagraphReadingDirection(This) -+#define IDWriteTextAnalysisSource_GetParagraphReadingDirection(This) (This)->lpVtbl->GetParagraphReadingDirection(This) - #define IDWriteTextAnalysisSource_GetTextAtPosition(This,textPosition,textString,textLength) (This)->lpVtbl->GetTextAtPosition(This,textPosition,textString,textLength) - #define IDWriteTextAnalysisSource_GetTextBeforePosition(This,textPosition,textString,textLength) (This)->lpVtbl->GetTextBeforePosition(This,textPosition,textString,textLength) - #endif /*COBJMACROS*/ -@@ -1866,23 +1866,23 @@ - #define IDWriteTextFormat_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) - #define IDWriteTextFormat_AddRef(This) (This)->lpVtbl->AddRef(This) - #define IDWriteTextFormat_Release(This) (This)->lpVtbl->Release(This) --#define IDWriteTextFormat_GetFlowDirection() (This)->lpVtbl->GetFlowDirection(This) -+#define IDWriteTextFormat_GetFlowDirection(This) (This)->lpVtbl->GetFlowDirection(This) - #define IDWriteTextFormat_GetFontCollection(This,fontCollection) (This)->lpVtbl->GetFontCollection(This,fontCollection) - #define IDWriteTextFormat_GetFontFamilyName(This,fontFamilyName,nameSize) (This)->lpVtbl->GetFontFamilyName(This,fontFamilyName,nameSize) --#define IDWriteTextFormat_GetFontFamilyNameLength() (This)->lpVtbl->GetFontFamilyNameLength(This) --#define IDWriteTextFormat_GetFontSize() (This)->lpVtbl->GetFontSize(This) --#define IDWriteTextFormat_GetFontStretch() (This)->lpVtbl->GetFontStretch(This) --#define IDWriteTextFormat_GetFontStyle() (This)->lpVtbl->GetFontStyle(This) --#define IDWriteTextFormat_GetFontWeight() (This)->lpVtbl->GetFontWeight(This) --#define IDWriteTextFormat_GetIncrementalTabStop() (This)->lpVtbl->GetIncrementalTabStop(This) -+#define IDWriteTextFormat_GetFontFamilyNameLength(This) (This)->lpVtbl->GetFontFamilyNameLength(This) -+#define IDWriteTextFormat_GetFontSize(This) (This)->lpVtbl->GetFontSize(This) -+#define IDWriteTextFormat_GetFontStretch(This) (This)->lpVtbl->GetFontStretch(This) -+#define IDWriteTextFormat_GetFontStyle(This) (This)->lpVtbl->GetFontStyle(This) -+#define IDWriteTextFormat_GetFontWeight(This) (This)->lpVtbl->GetFontWeight(This) -+#define IDWriteTextFormat_GetIncrementalTabStop(This) (This)->lpVtbl->GetIncrementalTabStop(This) - #define IDWriteTextFormat_GetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) (This)->lpVtbl->GetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) - #define IDWriteTextFormat_GetLocaleName(This,localeName,nameSize) (This)->lpVtbl->GetLocaleName(This,localeName,nameSize) --#define IDWriteTextFormat_GetLocaleNameLength() (This)->lpVtbl->GetLocaleNameLength(This) --#define IDWriteTextFormat_GetParagraphAlignment() (This)->lpVtbl->GetParagraphAlignment(This) --#define IDWriteTextFormat_GetReadingDirection() (This)->lpVtbl->GetReadingDirection(This) --#define IDWriteTextFormat_GetTextAlignment() (This)->lpVtbl->GetTextAlignment(This) -+#define IDWriteTextFormat_GetLocaleNameLength(This) (This)->lpVtbl->GetLocaleNameLength(This) -+#define IDWriteTextFormat_GetParagraphAlignment(This) (This)->lpVtbl->GetParagraphAlignment(This) -+#define IDWriteTextFormat_GetReadingDirection(This) (This)->lpVtbl->GetReadingDirection(This) -+#define IDWriteTextFormat_GetTextAlignment(This) (This)->lpVtbl->GetTextAlignment(This) - #define IDWriteTextFormat_GetTrimming(This,trimmingOptions,trimmingSign) (This)->lpVtbl->GetTrimming(This,trimmingOptions,trimmingSign) --#define IDWriteTextFormat_GetWordWrapping() (This)->lpVtbl->GetWordWrapping(This) -+#define IDWriteTextFormat_GetWordWrapping(This) (This)->lpVtbl->GetWordWrapping(This) - #define IDWriteTextFormat_SetFlowDirection(This,flowDirection) (This)->lpVtbl->SetFlowDirection(This,flowDirection) - #define IDWriteTextFormat_SetIncrementalTabStop(This,incrementalTabStop) (This)->lpVtbl->SetIncrementalTabStop(This,incrementalTabStop) - #define IDWriteTextFormat_SetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) (This)->lpVtbl->SetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) -@@ -1997,32 +1997,32 @@ - DWRITE_TEXT_RANGE textRange) PURE; - STDMETHOD_(FLOAT, GetMaxWidth)(THIS) PURE; - STDMETHOD_(FLOAT, GetMaxHeight)(THIS) PURE; -- STDMETHOD(GetFontCollection)(THIS_ -+ STDMETHOD(GetFontCollection2)(THIS_ - UINT32 currentPosition, - IDWriteFontCollection** fontCollection, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetFontFamilyNameLength)(THIS_ -+ STDMETHOD(GetFontFamilyNameLength2)(THIS_ - UINT32 currentPosition, - UINT32 *nameLength, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetFontFamilyName)(THIS_ -+ STDMETHOD(GetFontFamilyName2)(THIS_ - UINT32 currentPosition, - WCHAR *fontFamilyName, - UINT32 nameSize, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetFontWeight)(THIS_ -+ STDMETHOD(GetFontWeight2)(THIS_ - UINT32 currentPosition, - DWRITE_FONT_WEIGHT *fontWeight, - DWRITE_TEXT_RANGE* textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetFontStyle)(THIS_ -+ STDMETHOD(GetFontStyle2)(THIS_ - UINT32 currentPosition, - DWRITE_FONT_STYLE *fontStyle, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetFontStretch)(THIS_ -+ STDMETHOD(GetFontStretch2)(THIS_ - UINT32 currentPosition, - DWRITE_FONT_STRETCH* fontStretch, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetFontSize)(THIS_ -+ STDMETHOD(GetFontSize2)(THIS_ - UINT32 currentPosition, - FLOAT *fontSize, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -@@ -2046,11 +2046,11 @@ - UINT32 currentPosition, - IDWriteTypography **typography, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetLocaleNameLength)(THIS_ -+ STDMETHOD(GetLocaleNameLength2)(THIS_ - UINT32 currentPosition, - UINT32 *nameLength, - DWRITE_TEXT_RANGE *textRange __MINGW_DEF_ARG_VAL(NULL)) PURE; -- STDMETHOD(GetLocaleName)(THIS_ -+ STDMETHOD(GetLocaleName2)(THIS_ - UINT32 currentPosition, - WCHAR *localeName, - UINT32 nameSize, -@@ -2101,23 +2101,23 @@ - #define IDWriteTextLayout_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) - #define IDWriteTextLayout_AddRef(This) (This)->lpVtbl->AddRef(This) - #define IDWriteTextLayout_Release(This) (This)->lpVtbl->Release(This) --#define IDWriteTextLayout_GetFlowDirection() (This)->lpVtbl->GetFlowDirection(This) -+#define IDWriteTextLayout_GetFlowDirection(This) (This)->lpVtbl->GetFlowDirection(This) - #define IDWriteTextLayout_GetFontCollection(This,fontCollection) (This)->lpVtbl->GetFontCollection(This,fontCollection) - #define IDWriteTextLayout_GetFontFamilyName(This,fontFamilyName,nameSize) (This)->lpVtbl->GetFontFamilyName(This,fontFamilyName,nameSize) --#define IDWriteTextLayout_GetFontFamilyNameLength() (This)->lpVtbl->GetFontFamilyNameLength(This) --#define IDWriteTextLayout_GetFontSize() (This)->lpVtbl->GetFontSize(This) --#define IDWriteTextLayout_GetFontStretch() (This)->lpVtbl->GetFontStretch(This) --#define IDWriteTextLayout_GetFontStyle() (This)->lpVtbl->GetFontStyle(This) --#define IDWriteTextLayout_GetFontWeight() (This)->lpVtbl->GetFontWeight(This) --#define IDWriteTextLayout_GetIncrementalTabStop() (This)->lpVtbl->GetIncrementalTabStop(This) -+#define IDWriteTextLayout_GetFontFamilyNameLength(This) (This)->lpVtbl->GetFontFamilyNameLength(This) -+#define IDWriteTextLayout_GetFontSize(This) (This)->lpVtbl->GetFontSize(This) -+#define IDWriteTextLayout_GetFontStretch(This) (This)->lpVtbl->GetFontStretch(This) -+#define IDWriteTextLayout_GetFontStyle(This) (This)->lpVtbl->GetFontStyle(This) -+#define IDWriteTextLayout_GetFontWeight(This) (This)->lpVtbl->GetFontWeight(This) -+#define IDWriteTextLayout_GetIncrementalTabStop(This) (This)->lpVtbl->GetIncrementalTabStop(This) - #define IDWriteTextLayout_GetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) (This)->lpVtbl->GetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) - #define IDWriteTextLayout_GetLocaleName(This,localeName,nameSize) (This)->lpVtbl->GetLocaleName(This,localeName,nameSize) --#define IDWriteTextLayout_GetLocaleNameLength() (This)->lpVtbl->GetLocaleNameLength(This) --#define IDWriteTextLayout_GetParagraphAlignment() (This)->lpVtbl->GetParagraphAlignment(This) --#define IDWriteTextLayout_GetReadingDirection() (This)->lpVtbl->GetReadingDirection(This) --#define IDWriteTextLayout_GetTextAlignment() (This)->lpVtbl->GetTextAlignment(This) -+#define IDWriteTextLayout_GetLocaleNameLength(This) (This)->lpVtbl->GetLocaleNameLength(This) -+#define IDWriteTextLayout_GetParagraphAlignment(This) (This)->lpVtbl->GetParagraphAlignment(This) -+#define IDWriteTextLayout_GetReadingDirection(This) (This)->lpVtbl->GetReadingDirection(This) -+#define IDWriteTextLayout_GetTextAlignment(This) (This)->lpVtbl->GetTextAlignment(This) - #define IDWriteTextLayout_GetTrimming(This,trimmingOptions,trimmingSign) (This)->lpVtbl->GetTrimming(This,trimmingOptions,trimmingSign) --#define IDWriteTextLayout_GetWordWrapping() (This)->lpVtbl->GetWordWrapping(This) -+#define IDWriteTextLayout_GetWordWrapping(This) (This)->lpVtbl->GetWordWrapping(This) - #define IDWriteTextLayout_SetFlowDirection(This,flowDirection) (This)->lpVtbl->SetFlowDirection(This,flowDirection) - #define IDWriteTextLayout_SetIncrementalTabStop(This,incrementalTabStop) (This)->lpVtbl->SetIncrementalTabStop(This,incrementalTabStop) - #define IDWriteTextLayout_SetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) (This)->lpVtbl->SetLineSpacing(This,lineSpacingMethod,lineSpacing,baseline) -@@ -2130,19 +2130,19 @@ - #define IDWriteTextLayout_GetClusterMetrics(This,clusterMetrics,maxClusterCount,actualClusterCount) (This)->lpVtbl->GetClusterMetrics(This,clusterMetrics,maxClusterCount,actualClusterCount) - #define IDWriteTextLayout_DetermineMinWidth(This,minWidth) (This)->lpVtbl->DetermineMinWidth(This,minWidth) - #define IDWriteTextLayout_GetDrawingEffect(This,currentPosition,drawingEffect,textRange) (This)->lpVtbl->GetDrawingEffect(This,currentPosition,drawingEffect,textRange) --#define IDWriteTextLayout_GetFontCollection(This,currentPosition,fontCollection,textRange) (This)->lpVtbl->GetFontCollection(This,currentPosition,fontCollection,textRange) --#define IDWriteTextLayout_GetFontFamilyName(This,currentPosition,fontFamilyName,nameSize,textRange) (This)->lpVtbl->GetFontFamilyName(This,currentPosition,fontFamilyName,nameSize,textRange) --#define IDWriteTextLayout_GetFontFamilyNameLength(This,currentPosition,nameLength,textRange) (This)->lpVtbl->GetFontFamilyNameLength(This,currentPosition,nameLength,textRange) --#define IDWriteTextLayout_GetFontSize(This,currentPosition,fontSize,textRange) (This)->lpVtbl->GetFontSize(This,currentPosition,fontSize,textRange) --#define IDWriteTextLayout_GetFontStretch(This,currentPosition,fontStretch,textRange) (This)->lpVtbl->GetFontStretch(This,currentPosition,fontStretch,textRange) --#define IDWriteTextLayout_GetFontStyle(This,currentPosition,fontStyle,textRange) (This)->lpVtbl->GetFontStyle(This,currentPosition,fontStyle,textRange) --#define IDWriteTextLayout_GetFontWeight(This,currentPosition,fontWeight,textRange) (This)->lpVtbl->GetFontWeight(This,currentPosition,fontWeight,textRange) -+#define IDWriteTextLayout_GetFontCollection2(This,currentPosition,fontCollection,textRange) (This)->lpVtbl->GetFontCollection(This,currentPosition,fontCollection,textRange) -+#define IDWriteTextLayout_GetFontFamilyName2(This,currentPosition,fontFamilyName,nameSize,textRange) (This)->lpVtbl->GetFontFamilyName2(This,currentPosition,fontFamilyName,nameSize,textRange) -+#define IDWriteTextLayout_GetFontFamilyNameLength2(This,currentPosition,nameLength,textRange) (This)->lpVtbl->GetFontFamilyNameLength2(This,currentPosition,nameLength,textRange) -+#define IDWriteTextLayout_GetFontSize2(This,currentPosition,fontSize,textRange) (This)->lpVtbl->GetFontSize2(This,currentPosition,fontSize,textRange) -+#define IDWriteTextLayout_GetFontStretch2(This,currentPosition,fontStretch,textRange) (This)->lpVtbl->GetFontStretch2(This,currentPosition,fontStretch,textRange) -+#define IDWriteTextLayout_GetFontStyle2(This,currentPosition,fontStyle,textRange) (This)->lpVtbl->GetFontStyle2(This,currentPosition,fontStyle,textRange) -+#define IDWriteTextLayout_GetFontWeight2(This,currentPosition,fontWeight,textRange) (This)->lpVtbl->GetFontWeight2(This,currentPosition,fontWeight,textRange) - #define IDWriteTextLayout_GetInlineObject(This,currentPosition,inlineObject,textRange) (This)->lpVtbl->GetInlineObject(This,currentPosition,inlineObject,textRange) - #define IDWriteTextLayout_GetLineMetrics(This,lineMetrics,maxLineCount,actualLineCount) (This)->lpVtbl->GetLineMetrics(This,lineMetrics,maxLineCount,actualLineCount) --#define IDWriteTextLayout_GetLocaleName(This,currentPosition,localeName,nameSize,textRange) (This)->lpVtbl->GetLocaleName(This,currentPosition,localeName,nameSize,textRange) --#define IDWriteTextLayout_GetLocaleNameLength(This,currentPosition,nameLength,textRange) (This)->lpVtbl->GetLocaleNameLength(This,currentPosition,nameLength,textRange) --#define IDWriteTextLayout_GetMaxHeight() (This)->lpVtbl->GetMaxHeight(This) --#define IDWriteTextLayout_GetMaxWidth() (This)->lpVtbl->GetMaxWidth(This) -+#define IDWriteTextLayout_GetLocaleName2(This,currentPosition,localeName,nameSize,textRange) (This)->lpVtbl->GetLocaleName2(This,currentPosition,localeName,nameSize,textRange) -+#define IDWriteTextLayout_GetLocaleNameLength2(This,currentPosition,nameLength,textRange) (This)->lpVtbl->GetLocaleNameLength2(This,currentPosition,nameLength,textRange) -+#define IDWriteTextLayout_GetMaxHeight(This) (This)->lpVtbl->GetMaxHeight(This) -+#define IDWriteTextLayout_GetMaxWidth(This) (This)->lpVtbl->GetMaxWidth(This) - #define IDWriteTextLayout_GetMetrics(This,textMetrics) (This)->lpVtbl->GetMetrics(This,textMetrics) - #define IDWriteTextLayout_GetOverhangMetrics(This,overhangs) (This)->lpVtbl->GetOverhangMetrics(This,overhangs) - #define IDWriteTextLayout_GetStrikethrough(This,currentPosition,hasStrikethrough,textRange) (This)->lpVtbl->GetStrikethrough(This,currentPosition,hasStrikethrough,textRange) -@@ -2262,7 +2262,7 @@ - #define IDWriteTypography_Release(This) (This)->lpVtbl->Release(This) - #define IDWriteTypography_AddFontFeature(This,fontFeature) (This)->lpVtbl->AddFontFeature(This,fontFeature) - #define IDWriteTypography_GetFontFeature(This,fontFeatureIndex,fontFeature) (This)->lpVtbl->GetFontFeature(This,fontFeatureIndex,fontFeature) --#define IDWriteTypography_GetFontFeatureCount() (This)->lpVtbl->GetFontFeatureCount(This) -+#define IDWriteTypography_GetFontFeatureCount(This) (This)->lpVtbl->GetFontFeatureCount(This) - #endif /*COBJMACROS*/ - - #ifdef __cplusplus diff --git a/libass/Makefile.am b/libass/Makefile.am index 2d7bc44..b6965c9 100644 --- a/libass/Makefile.am +++ b/libass/Makefile.am @@ -19,7 +19,7 @@ SRC_INTEL_RASTERIZER = x86/rasterizer.asm SRC_RASTERIZER = ass_rasterizer.h ass_rasterizer.c ass_rasterizer_c.c -SRC_DIRECTWRITE = ass_directwrite.c ass_directwrite.h dwrite.h +SRC_DIRECTWRITE = ass_directwrite.c ass_directwrite.h dwrite_c.h lib_LTLIBRARIES = libass.la libass_la_SOURCES = ass.c ass_cache.c ass_font.c ass_fontselect.c ass_render.c \ diff --git a/libass/ass_directwrite.c b/libass/ass_directwrite.c index 0ce1478..fb21d5c 100644 --- a/libass/ass_directwrite.c +++ b/libass/ass_directwrite.c @@ -23,11 +23,7 @@ #include #include -#include "dwrite.h" - -DEFINE_GUID(IID_IDWriteFactory, 0xb859ee5a,0xd838,0x4b5b,0xa2,0xe8,0x1a,0xdc,0x7d,0x93,0xdb,0x48); -DEFINE_GUID(IID_IDWritePixelSnapping, 0xeaf3a2da,0xecf4,0x4d24,0xb6,0x44,0xb3,0x4f,0x68,0x42,0x02,0x4b); -DEFINE_GUID(IID_IDWriteTextRenderer, 0xef8a8135,0x5cc6,0x45fe,0x88,0x25,0xc5,0xa0,0x72,0x4e,0xb8,0x19); +#include "dwrite_c.h" #include "ass_directwrite.h" #include "ass_utils.h" diff --git a/libass/dwrite.h b/libass/dwrite.h deleted file mode 100644 index c7bda0b..0000000 --- a/libass/dwrite.h +++ /dev/null @@ -1,668 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ -/** - * Stripped version. Only definitions needed by libass. - */ -#ifndef __INC_DWRITE__ -#define __INC_DWRITE__ - -#define DWRITEAPI DECLSPEC_IMPORT - -#include - -typedef struct IDWriteFactory IDWriteFactory; -typedef struct IDWriteFont IDWriteFont; -typedef struct IDWriteFontCollection IDWriteFontCollection; -typedef struct IDWriteFontFace IDWriteFontFace; -typedef struct IDWriteFontFamily IDWriteFontFamily; -typedef struct IDWriteFontList IDWriteFontList; -typedef struct IDWriteFontFile IDWriteFontFile; -typedef struct IDWriteFontFileLoader IDWriteFontFileLoader; -typedef struct IDWriteFontFileStream IDWriteFontFileStream; -typedef struct IDWriteInlineObject IDWriteInlineObject; -typedef struct IDWriteLocalizedStrings IDWriteLocalizedStrings; -typedef struct IDWritePixelSnapping IDWritePixelSnapping; -typedef struct IDWriteTextFormat IDWriteTextFormat; -typedef struct IDWriteTextLayout IDWriteTextLayout; -typedef struct IDWriteTextRenderer IDWriteTextRenderer; - -#include - -typedef enum DWRITE_INFORMATIONAL_STRING_ID { - DWRITE_INFORMATIONAL_STRING_NONE = 0, - DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, - DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS, - DWRITE_INFORMATIONAL_STRING_TRADEMARK, - DWRITE_INFORMATIONAL_STRING_MANUFACTURER, - DWRITE_INFORMATIONAL_STRING_DESIGNER, - DWRITE_INFORMATIONAL_STRING_DESIGNER_URL, - DWRITE_INFORMATIONAL_STRING_DESCRIPTION, - DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL, - DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION, - DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL, - DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, - DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, - DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES, - DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, - DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT, - DWRITE_INFORMATIONAL_STRING_FULL_NAME, - DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME, - DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME -} DWRITE_INFORMATIONAL_STRING_ID; - -typedef enum DWRITE_FACTORY_TYPE { - DWRITE_FACTORY_TYPE_SHARED = 0, - DWRITE_FACTORY_TYPE_ISOLATED -} DWRITE_FACTORY_TYPE; - - -typedef enum DWRITE_FONT_SIMULATIONS { - DWRITE_FONT_SIMULATIONS_NONE = 0x0000, - DWRITE_FONT_SIMULATIONS_BOLD = 0x0001, - DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002 -} DWRITE_FONT_SIMULATIONS; - -typedef enum DWRITE_FONT_STRETCH { - DWRITE_FONT_STRETCH_UNDEFINED = 0, - DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1, - DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2, - DWRITE_FONT_STRETCH_CONDENSED = 3, - DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4, - DWRITE_FONT_STRETCH_NORMAL = 5, - DWRITE_FONT_STRETCH_MEDIUM = 5, - DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6, - DWRITE_FONT_STRETCH_EXPANDED = 7, - DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8, - DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9 -} DWRITE_FONT_STRETCH; - -typedef enum DWRITE_FONT_STYLE { - DWRITE_FONT_STYLE_NORMAL = 0, - DWRITE_FONT_STYLE_OBLIQUE, - DWRITE_FONT_STYLE_ITALIC -} DWRITE_FONT_STYLE; - -typedef enum DWRITE_FONT_WEIGHT { - DWRITE_FONT_WEIGHT_MEDIUM = 500, - /* rest dropped */ -} DWRITE_FONT_WEIGHT; - -typedef struct DWRITE_FONT_METRICS { - UINT16 designUnitsPerEm; - UINT16 ascent; - UINT16 descent; - INT16 lineGap; - UINT16 capHeight; - UINT16 xHeight; - INT16 underlinePosition; - UINT16 underlineThickness; - INT16 strikethroughPosition; - UINT16 strikethroughThickness; -} DWRITE_FONT_METRICS; - -typedef struct DWRITE_GLYPH_OFFSET DWRITE_GLYPH_OFFSET; - -typedef struct DWRITE_GLYPH_RUN { - IDWriteFontFace *fontFace; - FLOAT fontEmSize; - UINT32 glyphCount; - const UINT16 *glyphIndices; - const FLOAT *glyphAdvances; - const DWRITE_GLYPH_OFFSET *glyphOffsets; - WINBOOL isSideways; - UINT32 bidiLevel; -} DWRITE_GLYPH_RUN; - -typedef struct DWRITE_GLYPH_RUN_DESCRIPTION DWRITE_GLYPH_RUN_DESCRIPTION; -typedef struct DWRITE_HIT_TEST_METRICS DWRITE_HIT_TEST_METRICS; -typedef struct DWRITE_LINE_METRICS DWRITE_LINE_METRICS; -typedef struct DWRITE_MATRIX DWRITE_MATRIX; -typedef struct DWRITE_STRIKETHROUGH DWRITE_STRIKETHROUGH; -typedef struct DWRITE_TEXT_METRICS DWRITE_TEXT_METRICS; - -typedef struct DWRITE_TEXT_RANGE { - UINT32 startPosition; - UINT32 length; -} DWRITE_TEXT_RANGE; - -typedef struct DWRITE_TRIMMING DWRITE_TRIMMING; -typedef struct DWRITE_UNDERLINE DWRITE_UNDERLINE; - -#ifndef __MINGW_DEF_ARG_VAL -#ifdef __cplusplus -#define __MINGW_DEF_ARG_VAL(x) = x -#else -#define __MINGW_DEF_ARG_VAL(x) -#endif -#endif - -#undef INTERFACE -#define INTERFACE IDWriteFactory -DECLARE_INTERFACE_(IDWriteFactory,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFactory methods */ - STDMETHOD(GetSystemFontCollection)(THIS_ - IDWriteFontCollection **fontCollection, - WINBOOL checkForUpdates __MINGW_DEF_ARG_VAL(FALSE)) PURE; - - STDMETHOD(dummy1)(THIS); - STDMETHOD(dummy2)(THIS); - STDMETHOD(dummy3)(THIS); - STDMETHOD(dummy4)(THIS); - STDMETHOD(dummy5)(THIS); - STDMETHOD(dummy6)(THIS); - STDMETHOD(dummy7)(THIS); - STDMETHOD(dummy8)(THIS); - STDMETHOD(dummy9)(THIS); - STDMETHOD(dummy10)(THIS); - STDMETHOD(dummy11)(THIS); - - STDMETHOD(CreateTextFormat)(THIS_ - WCHAR const *fontFamilyName, - IDWriteFontCollection *fontCollection, - DWRITE_FONT_WEIGHT fontWeight, - DWRITE_FONT_STYLE fontStyle, - DWRITE_FONT_STRETCH fontStretch, - FLOAT fontSize, - WCHAR const *localeName, - IDWriteTextFormat **textFormat) PURE; - - STDMETHOD(dummy12)(THIS); - STDMETHOD(dummy13)(THIS); - - STDMETHOD(CreateTextLayout)(THIS_ - WCHAR const *string, - UINT32 stringLength, - IDWriteTextFormat *textFormat, - FLOAT maxWidth, - FLOAT maxHeight, - IDWriteTextLayout **textLayout) PURE; - - /* remainder dropped */ - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFactory_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define IDWriteFactory_AddRef(This) (This)->lpVtbl->AddRef(This) -#define IDWriteFactory_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFactory_GetSystemFontCollection(This,fontCollection,checkForUpdates) (This)->lpVtbl->GetSystemFontCollection(This,fontCollection,checkForUpdates) -#define IDWriteFactory_CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat) (This)->lpVtbl->CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat) -#define IDWriteFactory_CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout) (This)->lpVtbl->CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFont -DECLARE_INTERFACE_(IDWriteFont,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFont methods */ - STDMETHOD(GetFontFamily)(THIS_ - IDWriteFontFamily **fontFamily) PURE; - - STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)(THIS) PURE; - STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)(THIS) PURE; - STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)(THIS) PURE; - STDMETHOD_(WINBOOL, IsSymbolFont)(THIS) PURE; - - STDMETHOD(GetFaceNames)(THIS_ - IDWriteLocalizedStrings **names) PURE; - - STDMETHOD(GetInformationalStrings)(THIS_ - DWRITE_INFORMATIONAL_STRING_ID informationalStringID, - IDWriteLocalizedStrings **informationalStrings, - WINBOOL *exists) PURE; - - STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)(THIS) PURE; - - STDMETHOD_(void, GetMetrics)(THIS_ - DWRITE_FONT_METRICS *fontMetrics) PURE; - - STDMETHOD(HasCharacter)(THIS_ - UINT32 unicodeValue, - WINBOOL *exists) PURE; - - STDMETHOD(CreateFontFace)(THIS_ - IDWriteFontFace **fontFace) PURE; - - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFont_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define IDWriteFont_AddRef(This) (This)->lpVtbl->AddRef(This) -#define IDWriteFont_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFont_CreateFontFace(This,fontFace) (This)->lpVtbl->CreateFontFace(This,fontFace) -#define IDWriteFont_GetFaceNames(This,names) (This)->lpVtbl->GetFaceNames(This,names) -#define IDWriteFont_GetFontFamily(This,fontFamily) (This)->lpVtbl->GetFontFamily(This,fontFamily) -#define IDWriteFont_GetInformationalStrings(This,informationalStringID,informationalStrings,exists) (This)->lpVtbl->GetInformationalStrings(This,informationalStringID,informationalStrings,exists) -#define IDWriteFont_GetMetrics(This,fontMetrics) (This)->lpVtbl->GetMetrics(This,fontMetrics) -#define IDWriteFont_GetSimulations(This) (This)->lpVtbl->GetSimulations(This) -#define IDWriteFont_GetStretch(This) (This)->lpVtbl->GetStretch(This) -#define IDWriteFont_GetStyle(This) (This)->lpVtbl->GetStyle(This) -#define IDWriteFont_GetWeight(This) (This)->lpVtbl->GetWeight(This) -#define IDWriteFont_HasCharacter(This,unicodeValue,exists) (This)->lpVtbl->HasCharacter(This,unicodeValue,exists) -#define IDWriteFont_IsSymbolFont(This) (This)->lpVtbl->IsSymbolFont(This) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFontCollection -DECLARE_INTERFACE_(IDWriteFontCollection,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFontCollection methods */ - STDMETHOD_(UINT32, GetFontFamilyCount)(THIS) PURE; - - STDMETHOD(GetFontFamily)(THIS_ - UINT32 index, - IDWriteFontFamily **fontFamily) PURE; - - STDMETHOD(FindFamilyName)(THIS_ - WCHAR const *familyName, - UINT32 *index, - WINBOOL *exists) PURE; - - STDMETHOD(GetFontFromFontFace)(THIS_ - IDWriteFontFace* fontFace, - IDWriteFont **font) PURE; - - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFontCollection_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define IDWriteFontCollection_AddRef(This) (This)->lpVtbl->AddRef(This) -#define IDWriteFontCollection_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFontCollection_FindFamilyName(This,familyName,index,exists) (This)->lpVtbl->FindFamilyName(This,familyName,index,exists) -#define IDWriteFontCollection_GetFontFamily(This,index,fontFamily) (This)->lpVtbl->GetFontFamily(This,index,fontFamily) -#define IDWriteFontCollection_GetFontFamilyCount(This) (This)->lpVtbl->GetFontFamilyCount(This) -#define IDWriteFontCollection_GetFontFromFontFace(This,fontFace,font) (This)->lpVtbl->GetFontFromFontFace(This,fontFace,font) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFontFace -DECLARE_INTERFACE_(IDWriteFontFace,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFontFace methods */ - STDMETHOD(dummy1)(THIS); - - STDMETHOD(GetFiles)(THIS_ - UINT32 *numberOfFiles, - IDWriteFontFile **fontFiles) PURE; - - /* rest dropped */ - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFontFace_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFontFace_GetFiles(This,fontFiles,b) (This)->lpVtbl->GetFiles(This,fontFiles,b) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFontFamily -DECLARE_INTERFACE_(IDWriteFontFamily,IDWriteFontList) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDWriteFontList methods */ - STDMETHOD(GetFontCollection)(THIS_ - IDWriteFontCollection** fontCollection) PURE; - - STDMETHOD_(UINT32, GetFontCount)(THIS) PURE; - - STDMETHOD(GetFont)(THIS_ - UINT32 index, - IDWriteFont **font) PURE; -#endif - - /* IDWriteFontFamily methods */ - STDMETHOD(GetFamilyNames)(THIS_ - IDWriteLocalizedStrings **names) PURE; - - /* rest dropped */ - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFontFamily_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define IDWriteFontFamily_AddRef(This) (This)->lpVtbl->AddRef(This) -#define IDWriteFontFamily_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFontFamily_GetFont(This,index,font) (This)->lpVtbl->GetFont(This,index,font) -#define IDWriteFontFamily_GetFontCount(This) (This)->lpVtbl->GetFontCount(This) -#define IDWriteFontFamily_GetFamilyNames(This,names) (This)->lpVtbl->GetFamilyNames(This,names) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFontFile -DECLARE_INTERFACE_(IDWriteFontFile,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFontFile methods */ - STDMETHOD(GetReferenceKey)(THIS_ - void const **fontFileReferenceKey, - UINT32 *fontFileReferenceKeySize) PURE; - - STDMETHOD(GetLoader)(THIS_ - IDWriteFontFileLoader **fontFileLoader) PURE; - - /* rest dropped */ - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFontFile_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFontFile_GetLoader(This,fontFileLoader) (This)->lpVtbl->GetLoader(This,fontFileLoader) -#define IDWriteFontFile_GetReferenceKey(This,fontFileReferenceKey,fontFileReferenceKeySize) (This)->lpVtbl->GetReferenceKey(This,fontFileReferenceKey,fontFileReferenceKeySize) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFontFileLoader -DECLARE_INTERFACE_(IDWriteFontFileLoader,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFontFileLoader methods */ - STDMETHOD(CreateStreamFromKey)(THIS_ - void const *fontFileReferenceKey, - UINT32 fontFileReferenceKeySize, - IDWriteFontFileStream **fontFileStream) PURE; - - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFontFileLoader_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define IDWriteFontFileLoader_AddRef(This) (This)->lpVtbl->AddRef(This) -#define IDWriteFontFileLoader_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFontFileLoader_CreateStreamFromKey(This,fontFileReferenceKey,fontFileReferenceKeySize,fontFileStream) (This)->lpVtbl->CreateStreamFromKey(This,fontFileReferenceKey,fontFileReferenceKeySize,fontFileStream) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteFontFileStream -DECLARE_INTERFACE_(IDWriteFontFileStream,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteFontFileStream methods */ - STDMETHOD(ReadFileFragment)(THIS_ - void const **fragmentStart, - UINT64 fileOffset, - UINT64 fragmentSize, - void** fragmentContext) PURE; - - STDMETHOD_(void, ReleaseFileFragment)(THIS_ - void *fragmentContext) PURE; - - STDMETHOD(GetFileSize)(THIS_ - UINT64 *fileSize) PURE; - - STDMETHOD(GetLastWriteTime)(THIS_ - UINT64 *lastWriteTime) PURE; - - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteFontFileStream_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) -#define IDWriteFontFileStream_AddRef(This) (This)->lpVtbl->AddRef(This) -#define IDWriteFontFileStream_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteFontFileStream_GetFileSize(This,fileSize) (This)->lpVtbl->GetFileSize(This,fileSize) -#define IDWriteFontFileStream_ReadFileFragment(This,fragmentStart,fileOffset,fragmentSize,fragmentContext) (This)->lpVtbl->ReadFileFragment(This,fragmentStart,fileOffset,fragmentSize,fragmentContext) -#define IDWriteFontFileStream_ReleaseFileFragment(This,fragmentContext) (This)->lpVtbl->ReleaseFileFragment(This,fragmentContext) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteLocalizedStrings -DECLARE_INTERFACE_(IDWriteLocalizedStrings,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteLocalizedStrings methods */ - STDMETHOD_(UINT32, GetCount)(THIS) PURE; - - STDMETHOD(dummy1)(THIS); - STDMETHOD(dummy2)(THIS); - STDMETHOD(dummy3)(THIS); - STDMETHOD(dummy4)(THIS); - - STDMETHOD(GetString)(THIS_ - UINT32 index, - WCHAR *stringBuffer, - UINT32 size) PURE; - - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteLocalizedStrings_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteLocalizedStrings_GetCount(This) (This)->lpVtbl->GetCount(This) -#define IDWriteLocalizedStrings_GetString(This,index,stringBuffer,size) (This)->lpVtbl->GetString(This,index,stringBuffer,size) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteTextFormat -DECLARE_INTERFACE_(IDWriteTextFormat,IUnknown) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; -#endif - - /* IDWriteTextFormat methods */ - /* rest dropped */ - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteTextFormat_Release(This) (This)->lpVtbl->Release(This) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteTextLayout -DECLARE_INTERFACE_(IDWriteTextLayout,IDWriteTextFormat) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDWriteTextFormat methods */ - STDMETHOD(dummy1)(THIS); - STDMETHOD(dummy2)(THIS); - STDMETHOD(dummy3)(THIS); - STDMETHOD(dummy4)(THIS); - STDMETHOD(dummy5)(THIS); - STDMETHOD(dummy6)(THIS); - STDMETHOD(dummy7)(THIS); - STDMETHOD(dummy8)(THIS); - STDMETHOD(dummy9)(THIS); - STDMETHOD(dummy10)(THIS); - STDMETHOD(dummy11)(THIS); - STDMETHOD(dummy12)(THIS); - STDMETHOD(dummy13)(THIS); - STDMETHOD(dummy14)(THIS); - STDMETHOD(dummy15)(THIS); - STDMETHOD(dummy16)(THIS); - STDMETHOD(dummy17)(THIS); - STDMETHOD(dummy18)(THIS); - STDMETHOD(dummy19)(THIS); - STDMETHOD(dummy20)(THIS); - STDMETHOD(dummy21)(THIS); - STDMETHOD(dummy22)(THIS); - STDMETHOD(dummy23)(THIS); - STDMETHOD(dummy24)(THIS); - STDMETHOD(dummy25)(THIS); -#endif - - /* IDWriteTextLayout methods */ - STDMETHOD(dummy26)(THIS); - STDMETHOD(dummy27)(THIS); - STDMETHOD(dummy28)(THIS); - STDMETHOD(dummy29)(THIS); - STDMETHOD(dummy30)(THIS); - STDMETHOD(dummy31)(THIS); - STDMETHOD(dummy32)(THIS); - STDMETHOD(dummy33)(THIS); - STDMETHOD(dummy34)(THIS); - STDMETHOD(dummy35)(THIS); - STDMETHOD(dummy36)(THIS); - STDMETHOD(dummy37)(THIS); - STDMETHOD(dummy38)(THIS); - STDMETHOD(dummy39)(THIS); - STDMETHOD(dummy40)(THIS); - STDMETHOD(dummy41)(THIS); - STDMETHOD(dummy42)(THIS); - STDMETHOD(dummy43)(THIS); - STDMETHOD(dummy44)(THIS); - STDMETHOD(dummy45)(THIS); - STDMETHOD(dummy46)(THIS); - STDMETHOD(dummy47)(THIS); - STDMETHOD(dummy48)(THIS); - STDMETHOD(dummy49)(THIS); - STDMETHOD(dummy50)(THIS); - STDMETHOD(dummy51)(THIS); - STDMETHOD(dummy52)(THIS); - STDMETHOD(dummy53)(THIS); - STDMETHOD(dummy54)(THIS); - STDMETHOD(dummy55)(THIS); - STDMETHOD(Draw)(THIS_ - void *clientDrawingContext, - IDWriteTextRenderer *renderer, - FLOAT originX, - FLOAT originY) PURE; - /* rest dropped */ - END_INTERFACE -}; -#ifdef COBJMACROS -#define IDWriteTextLayout_Release(This) (This)->lpVtbl->Release(This) -#define IDWriteTextLayout_Draw(This,clientDrawingContext,renderer,originX,originY) (This)->lpVtbl->Draw(This,clientDrawingContext,renderer,originX,originY) -#endif /*COBJMACROS*/ - -#undef INTERFACE -#define INTERFACE IDWriteTextRenderer -DECLARE_INTERFACE_(IDWriteTextRenderer,IDWritePixelSnapping) -{ - BEGIN_INTERFACE - -#ifndef __cplusplus - /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - /* IDWritePixelSnapping methods */ - STDMETHOD(IsPixelSnappingDisabled)(THIS_ - void *clientDrawingContext, - WINBOOL *isDisabled) PURE; - STDMETHOD(GetCurrentTransform)(THIS_ - void *clientDrawingContext, - DWRITE_MATRIX *transform) PURE; - STDMETHOD(GetPixelsPerDip)(THIS_ - void *clientDrawingContext, - FLOAT *pixelsPerDip) PURE; -#endif - - /* IDWriteTextRenderer methods */ - STDMETHOD(DrawGlyphRun)(THIS_ - void *clientDrawingContext, - FLOAT baselineOriginX, - FLOAT baselineOriginY, - DWRITE_MEASURING_MODE measuringMode, - DWRITE_GLYPH_RUN const *glyphRun, - DWRITE_GLYPH_RUN_DESCRIPTION const *glyphRunDescription, - IUnknown* clientDrawingEffect) PURE; - STDMETHOD(DrawUnderline)(THIS_ - void *clientDrawingContext, - FLOAT baselineOriginX, - FLOAT baselineOriginY, - DWRITE_UNDERLINE const *underline, - IUnknown *clientDrawingEffect) PURE; - STDMETHOD(DrawStrikethrough)(THIS_ - void *clientDrawingContext, - FLOAT baselineOriginX, - FLOAT baselineOriginY, - DWRITE_STRIKETHROUGH const *strikethrough, - IUnknown* clientDrawingEffect) PURE; - STDMETHOD(DrawInlineObject)(THIS_ - void *clientDrawingContext, - FLOAT originX, - FLOAT originY, - IDWriteInlineObject *inlineObject, - WINBOOL isSideways, - WINBOOL isRightToLeft, - IUnknown *clientDrawingEffect) PURE; - - END_INTERFACE -}; - -#endif /* __INC_DWRITE__ */ diff --git a/libass/dwrite_c.h b/libass/dwrite_c.h new file mode 100644 index 0000000..c692c9d --- /dev/null +++ b/libass/dwrite_c.h @@ -0,0 +1,673 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +/** + * Stripped version. Only definitions needed by libass. Contains fixes to + * make it compile with C. Also needed on MSVC. + */ +#ifndef __INC_DWRITE__ +#define __INC_DWRITE__ + +#define DWRITEAPI DECLSPEC_IMPORT + +#include + +typedef struct IDWriteFactory IDWriteFactory; +typedef struct IDWriteFont IDWriteFont; +typedef struct IDWriteFontCollection IDWriteFontCollection; +typedef struct IDWriteFontFace IDWriteFontFace; +typedef struct IDWriteFontFamily IDWriteFontFamily; +typedef struct IDWriteFontList IDWriteFontList; +typedef struct IDWriteFontFile IDWriteFontFile; +typedef struct IDWriteFontFileLoader IDWriteFontFileLoader; +typedef struct IDWriteFontFileStream IDWriteFontFileStream; +typedef struct IDWriteInlineObject IDWriteInlineObject; +typedef struct IDWriteLocalizedStrings IDWriteLocalizedStrings; +typedef struct IDWritePixelSnapping IDWritePixelSnapping; +typedef struct IDWriteTextFormat IDWriteTextFormat; +typedef struct IDWriteTextLayout IDWriteTextLayout; +typedef struct IDWriteTextRenderer IDWriteTextRenderer; + +#include + +typedef enum DWRITE_INFORMATIONAL_STRING_ID { + DWRITE_INFORMATIONAL_STRING_NONE = 0, + DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, + DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS, + DWRITE_INFORMATIONAL_STRING_TRADEMARK, + DWRITE_INFORMATIONAL_STRING_MANUFACTURER, + DWRITE_INFORMATIONAL_STRING_DESIGNER, + DWRITE_INFORMATIONAL_STRING_DESIGNER_URL, + DWRITE_INFORMATIONAL_STRING_DESCRIPTION, + DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL, + DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION, + DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL, + DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT, + DWRITE_INFORMATIONAL_STRING_FULL_NAME, + DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME, + DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME +} DWRITE_INFORMATIONAL_STRING_ID; + +typedef enum DWRITE_FACTORY_TYPE { + DWRITE_FACTORY_TYPE_SHARED = 0, + DWRITE_FACTORY_TYPE_ISOLATED +} DWRITE_FACTORY_TYPE; + + +typedef enum DWRITE_FONT_SIMULATIONS { + DWRITE_FONT_SIMULATIONS_NONE = 0x0000, + DWRITE_FONT_SIMULATIONS_BOLD = 0x0001, + DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002 +} DWRITE_FONT_SIMULATIONS; + +typedef enum DWRITE_FONT_STRETCH { + DWRITE_FONT_STRETCH_UNDEFINED = 0, + DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1, + DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2, + DWRITE_FONT_STRETCH_CONDENSED = 3, + DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4, + DWRITE_FONT_STRETCH_NORMAL = 5, + DWRITE_FONT_STRETCH_MEDIUM = 5, + DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6, + DWRITE_FONT_STRETCH_EXPANDED = 7, + DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8, + DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9 +} DWRITE_FONT_STRETCH; + +typedef enum DWRITE_FONT_STYLE { + DWRITE_FONT_STYLE_NORMAL = 0, + DWRITE_FONT_STYLE_OBLIQUE, + DWRITE_FONT_STYLE_ITALIC +} DWRITE_FONT_STYLE; + +typedef enum DWRITE_FONT_WEIGHT { + DWRITE_FONT_WEIGHT_MEDIUM = 500, + /* rest dropped */ +} DWRITE_FONT_WEIGHT; + +typedef struct DWRITE_FONT_METRICS { + UINT16 designUnitsPerEm; + UINT16 ascent; + UINT16 descent; + INT16 lineGap; + UINT16 capHeight; + UINT16 xHeight; + INT16 underlinePosition; + UINT16 underlineThickness; + INT16 strikethroughPosition; + UINT16 strikethroughThickness; +} DWRITE_FONT_METRICS; + +typedef struct DWRITE_GLYPH_OFFSET DWRITE_GLYPH_OFFSET; + +typedef struct DWRITE_GLYPH_RUN { + IDWriteFontFace *fontFace; + FLOAT fontEmSize; + UINT32 glyphCount; + const UINT16 *glyphIndices; + const FLOAT *glyphAdvances; + const DWRITE_GLYPH_OFFSET *glyphOffsets; + WINBOOL isSideways; + UINT32 bidiLevel; +} DWRITE_GLYPH_RUN; + +typedef struct DWRITE_GLYPH_RUN_DESCRIPTION DWRITE_GLYPH_RUN_DESCRIPTION; +typedef struct DWRITE_HIT_TEST_METRICS DWRITE_HIT_TEST_METRICS; +typedef struct DWRITE_LINE_METRICS DWRITE_LINE_METRICS; +typedef struct DWRITE_MATRIX DWRITE_MATRIX; +typedef struct DWRITE_STRIKETHROUGH DWRITE_STRIKETHROUGH; +typedef struct DWRITE_TEXT_METRICS DWRITE_TEXT_METRICS; + +typedef struct DWRITE_TEXT_RANGE { + UINT32 startPosition; + UINT32 length; +} DWRITE_TEXT_RANGE; + +typedef struct DWRITE_TRIMMING DWRITE_TRIMMING; +typedef struct DWRITE_UNDERLINE DWRITE_UNDERLINE; + +#ifndef __MINGW_DEF_ARG_VAL +#ifdef __cplusplus +#define __MINGW_DEF_ARG_VAL(x) = x +#else +#define __MINGW_DEF_ARG_VAL(x) +#endif +#endif + +#undef INTERFACE +#define INTERFACE IDWriteFactory +DECLARE_INTERFACE_(IDWriteFactory,IUnknown) +{ + BEGIN_INTERFACE + +#ifndef __cplusplus + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; +#endif + + /* IDWriteFactory methods */ + STDMETHOD(GetSystemFontCollection)(THIS_ + IDWriteFontCollection **fontCollection, + WINBOOL checkForUpdates __MINGW_DEF_ARG_VAL(FALSE)) PURE; + + STDMETHOD(dummy1)(THIS); + STDMETHOD(dummy2)(THIS); + STDMETHOD(dummy3)(THIS); + STDMETHOD(dummy4)(THIS); + STDMETHOD(dummy5)(THIS); + STDMETHOD(dummy6)(THIS); + STDMETHOD(dummy7)(THIS); + STDMETHOD(dummy8)(THIS); + STDMETHOD(dummy9)(THIS); + STDMETHOD(dummy10)(THIS); + STDMETHOD(dummy11)(THIS); + + STDMETHOD(CreateTextFormat)(THIS_ + WCHAR const *fontFamilyName, + IDWriteFontCollection *fontCollection, + DWRITE_FONT_WEIGHT fontWeight, + DWRITE_FONT_STYLE fontStyle, + DWRITE_FONT_STRETCH fontStretch, + FLOAT fontSize, + WCHAR const *localeName, + IDWriteTextFormat **textFormat) PURE; + + STDMETHOD(dummy12)(THIS); + STDMETHOD(dummy13)(THIS); + + STDMETHOD(CreateTextLayout)(THIS_ + WCHAR const *string, + UINT32 stringLength, + IDWriteTextFormat *textFormat, + FLOAT maxWidth, + FLOAT maxHeight, + IDWriteTextLayout **textLayout) PURE; + + /* remainder dropped */ + END_INTERFACE +}; +#ifdef COBJMACROS +#define IDWriteFactory_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IDWriteFactory_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IDWriteFactory_Release(This) (This)->lpVtbl->Release(This) +#define IDWriteFactory_GetSystemFontCollection(This,fontCollection,checkForUpdates) (This)->lpVtbl->GetSystemFontCollection(This,fontCollection,checkForUpdates) +#define IDWriteFactory_CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat) (This)->lpVtbl->CreateTextFormat(This,fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName,textFormat) +#define IDWriteFactory_CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout) (This)->lpVtbl->CreateTextLayout(This,string,stringLength,textFormat,maxWidth,maxHeight,textLayout) +#endif /*COBJMACROS*/ + +#undef INTERFACE +#define INTERFACE IDWriteFont +DECLARE_INTERFACE_(IDWriteFont,IUnknown) +{ + BEGIN_INTERFACE + +#ifndef __cplusplus + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; +#endif + + /* IDWriteFont methods */ + STDMETHOD(GetFontFamily)(THIS_ + IDWriteFontFamily **fontFamily) PURE; + + STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)(THIS) PURE; + STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)(THIS) PURE; + STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)(THIS) PURE; + STDMETHOD_(WINBOOL, IsSymbolFont)(THIS) PURE; + + STDMETHOD(GetFaceNames)(THIS_ + IDWriteLocalizedStrings **names) PURE; + + STDMETHOD(GetInformationalStrings)(THIS_ + DWRITE_INFORMATIONAL_STRING_ID informationalStringID, + IDWriteLocalizedStrings **informationalStrings, + WINBOOL *exists) PURE; + + STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)(THIS) PURE; + + STDMETHOD_(void, GetMetrics)(THIS_ + DWRITE_FONT_METRICS *fontMetrics) PURE; + + STDMETHOD(HasCharacter)(THIS_ + UINT32 unicodeValue, + WINBOOL *exists) PURE; + + STDMETHOD(CreateFontFace)(THIS_ + IDWriteFontFace **fontFace) PURE; + + END_INTERFACE +}; +#ifdef COBJMACROS +#define IDWriteFont_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IDWriteFont_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IDWriteFont_Release(This) (This)->lpVtbl->Release(This) +#define IDWriteFont_CreateFontFace(This,fontFace) (This)->lpVtbl->CreateFontFace(This,fontFace) +#define IDWriteFont_GetFaceNames(This,names) (This)->lpVtbl->GetFaceNames(This,names) +#define IDWriteFont_GetFontFamily(This,fontFamily) (This)->lpVtbl->GetFontFamily(This,fontFamily) +#define IDWriteFont_GetInformationalStrings(This,informationalStringID,informationalStrings,exists) (This)->lpVtbl->GetInformationalStrings(This,informationalStringID,informationalStrings,exists) +#define IDWriteFont_GetMetrics(This,fontMetrics) (This)->lpVtbl->GetMetrics(This,fontMetrics) +#define IDWriteFont_GetSimulations(This) (This)->lpVtbl->GetSimulations(This) +#define IDWriteFont_GetStretch(This) (This)->lpVtbl->GetStretch(This) +#define IDWriteFont_GetStyle(This) (This)->lpVtbl->GetStyle(This) +#define IDWriteFont_GetWeight(This) (This)->lpVtbl->GetWeight(This) +#define IDWriteFont_HasCharacter(This,unicodeValue,exists) (This)->lpVtbl->HasCharacter(This,unicodeValue,exists) +#define IDWriteFont_IsSymbolFont(This) (This)->lpVtbl->IsSymbolFont(This) +#endif /*COBJMACROS*/ + +#undef INTERFACE +#define INTERFACE IDWriteFontCollection +DECLARE_INTERFACE_(IDWriteFontCollection,IUnknown) +{ + BEGIN_INTERFACE + +#ifndef __cplusplus + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; +#endif + + /* IDWriteFontCollection methods */ + STDMETHOD_(UINT32, GetFontFamilyCount)(THIS) PURE; + + STDMETHOD(GetFontFamily)(THIS_ + UINT32 index, + IDWriteFontFamily **fontFamily) PURE; + + STDMETHOD(FindFamilyName)(THIS_ + WCHAR const *familyName, + UINT32 *index, + WINBOOL *exists) PURE; + + STDMETHOD(GetFontFromFontFace)(THIS_ + IDWriteFontFace* fontFace, + IDWriteFont **font) PURE; + + END_INTERFACE +}; +#ifdef COBJMACROS +#define IDWriteFontCollection_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IDWriteFontCollection_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IDWriteFontCollection_Release(This) (This)->lpVtbl->Release(This) +#define IDWriteFontCollection_FindFamilyName(This,familyName,index,exists) (This)->lpVtbl->FindFamilyName(This,familyName,index,exists) +#define IDWriteFontCollection_GetFontFamily(This,index,fontFamily) (This)->lpVtbl->GetFontFamily(This,index,fontFamily) +#define IDWriteFontCollection_GetFontFamilyCount(This) (This)->lpVtbl->GetFontFamilyCount(This) +#define IDWriteFontCollection_GetFontFromFontFace(This,fontFace,font) (This)->lpVtbl->GetFontFromFontFace(This,fontFace,font) +#endif /*COBJMACROS*/ + +#undef INTERFACE +#define INTERFACE IDWriteFontFace +DECLARE_INTERFACE_(IDWriteFontFace,IUnknown) +{ + BEGIN_INTERFACE + +#ifndef __cplusplus + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; +#endif + + /* IDWriteFontFace methods */ + STDMETHOD(dummy1)(THIS); + + STDMETHOD(GetFiles)(THIS_ + UINT32 *numberOfFiles, + IDWriteFontFile **fontFiles) PURE; + + /* rest dropped */ + END_INTERFACE +}; +#ifdef COBJMACROS +#define IDWriteFontFace_Release(This) (This)->lpVtbl->Release(This) +#define IDWriteFontFace_GetFiles(This,fontFiles,b) (This)->lpVtbl->GetFiles(This,fontFiles,b) +#endif /*COBJMACROS*/ + +#undef INTERFACE +#define INTERFACE IDWriteFontFamily +DECLARE_INTERFACE_(IDWriteFontFamily,IDWriteFontList) +{ + BEGIN_INTERFACE + +#ifndef __cplusplus + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + /* IDWriteFontList methods */ + STDMETHOD(GetFontCollection)(THIS_ + IDWriteFontCollection** fontCollection) PURE; + + STDMETHOD_(UINT32, GetFontCount)(THIS) PURE; + + STDMETHOD(GetFont)(THIS_ + UINT32 index, +