tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

mingw-dwrite_3.patch (7198B)


      1 From a9804765e442063be37338933b9c40e3e3d01aac Mon Sep 17 00:00:00 2001
      2 From: Sanketh Menda <me@snkth.com>
      3 Date: Thu, 2 Feb 2023 12:29:03 -0500
      4 Subject: [PATCH 4/7] dwrite_3.h: rename GetGlyphImageFormats_ to 
      5 GetGlyphImageFormats
      6 
      7 Wine's WIDL currently doesn't support overloading functions, so till
      8 that is fixed patch dwrite_3.h to rename GlyphImageFormats_ to
      9 GetGlyphImageFormats.
     10 ---
     11 mingw-w64-headers/include/dwrite_3.h | 18 +++++++++---------
     12 1 file changed, 9 insertions(+), 9 deletions(-)
     13 
     14 diff --git a/mingw-w64-headers/include/dwrite_3.h b/mingw-w64-headers/include/dwrite_3.h
     15 index 0cd8ad6..e22513c 100644
     16 --- a/mingw-w64-headers/include/dwrite_3.h
     17 +++ b/mingw-w64-headers/include/dwrite_3.h
     18 @@ -8697,7 +8697,7 @@ DEFINE_GUID(IID_IDWriteFontFace4, 0x27f2a904, 0x4eb8, 0x441d, 0x96,0x78, 0x05,0x
     19 MIDL_INTERFACE("27f2a904-4eb8-441d-9678-0563f53e3e2f")
     20 IDWriteFontFace4 : public IDWriteFontFace3
     21 {
     22 -    virtual HRESULT STDMETHODCALLTYPE GetGlyphImageFormats_(
     23 +    virtual HRESULT STDMETHODCALLTYPE GetGlyphImageFormats(
     24         UINT16 glyph,
     25         UINT32 ppem_first,
     26         UINT32 ppem_last,
     27 @@ -8997,7 +8997,7 @@ typedef struct IDWriteFontFace4Vtbl {
     28         WINBOOL *are_local);
     29 
     30     /*** IDWriteFontFace4 methods ***/
     31 -    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats_)(
     32 +    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats)(
     33         IDWriteFontFace4 *This,
     34         UINT16 glyph,
     35         UINT32 ppem_first,
     36 @@ -9078,7 +9078,7 @@ interface IDWriteFontFace4 {
     37 #define IDWriteFontFace4_AreCharactersLocal(This,characters,count,enqueue_if_not,are_local) (This)->lpVtbl->AreCharactersLocal(This,characters,count,enqueue_if_not,are_local)
     38 #define IDWriteFontFace4_AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local) (This)->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local)
     39 /*** IDWriteFontFace4 methods ***/
     40 -#define IDWriteFontFace4_GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats)
     41 +#define IDWriteFontFace4_GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats)
     42 #define IDWriteFontFace4_GetGlyphImageFormats(This) (This)->lpVtbl->GetGlyphImageFormats(This)
     43 #define IDWriteFontFace4_GetGlyphImageData(This,glyph,ppem,format,data,context) (This)->lpVtbl->GetGlyphImageData(This,glyph,ppem,format,data,context)
     44 #define IDWriteFontFace4_ReleaseGlyphImageData(This,context) (This)->lpVtbl->ReleaseGlyphImageData(This,context)
     45 @@ -9221,8 +9221,8 @@ static inline HRESULT IDWriteFontFace4_AreGlyphsLocal(IDWriteFontFace4* T
     46     return This->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local);
     47 }
     48 /*** IDWriteFontFace4 methods ***/
     49 -static inline HRESULT IDWriteFontFace4_GetGlyphImageFormats_(IDWriteFontFace4* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
     50 -    return This->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats);
     51 +static inline HRESULT IDWriteFontFace4_GetGlyphImageFormats(IDWriteFontFace4* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
     52 +    return This->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats);
     53 }
     54 static inline DWRITE_GLYPH_IMAGE_FORMATS IDWriteFontFace4_GetGlyphImageFormats(IDWriteFontFace4* This) {
     55     return This->lpVtbl->GetGlyphImageFormats(This);
     56 @@ -9549,7 +9549,7 @@ typedef struct IDWriteFontFace5Vtbl {
     57         WINBOOL *are_local);
     58 
     59     /*** IDWriteFontFace4 methods ***/
     60 -    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats_)(
     61 +    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats)(
     62         IDWriteFontFace5 *This,
     63         UINT16 glyph,
     64         UINT32 ppem_first,
     65 @@ -9650,7 +9650,7 @@ interface IDWriteFontFace5 {
     66 #define IDWriteFontFace5_AreCharactersLocal(This,characters,count,enqueue_if_not,are_local) (This)->lpVtbl->AreCharactersLocal(This,characters,count,enqueue_if_not,are_local)
     67 #define IDWriteFontFace5_AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local) (This)->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local)
     68 /*** IDWriteFontFace4 methods ***/
     69 -#define IDWriteFontFace5_GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats)
     70 +#define IDWriteFontFace5_GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats)
     71 #define IDWriteFontFace5_GetGlyphImageFormats(This) (This)->lpVtbl->GetGlyphImageFormats(This)
     72 #define IDWriteFontFace5_GetGlyphImageData(This,glyph,ppem,format,data,context) (This)->lpVtbl->GetGlyphImageData(This,glyph,ppem,format,data,context)
     73 #define IDWriteFontFace5_ReleaseGlyphImageData(This,context) (This)->lpVtbl->ReleaseGlyphImageData(This,context)
     74 @@ -9799,8 +9799,8 @@ static inline HRESULT IDWriteFontFace5_AreGlyphsLocal(IDWriteFontFace5* T
     75     return This->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local);
     76 }
     77 /*** IDWriteFontFace4 methods ***/
     78 -static inline HRESULT IDWriteFontFace5_GetGlyphImageFormats_(IDWriteFontFace5* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
     79 -    return This->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats);
     80 +static inline HRESULT IDWriteFontFace5_GetGlyphImageFormats(IDWriteFontFace5* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
     81 +    return This->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats);
     82 }
     83 static inline DWRITE_GLYPH_IMAGE_FORMATS IDWriteFontFace5_GetGlyphImageFormats(IDWriteFontFace5* This) {
     84     return This->lpVtbl->GetGlyphImageFormats(This);
     85 @@ -10452,8 +10452,24 @@ IDWritePaintReader : public IUnknown
     86         D2D_RECT_F *clip_box,
     87         DWRITE_PAINT_ATTRIBUTES *glyph_attributes = 0) = 0;
     88 
     89 +    HRESULT SetCurrentGlyph(
     90 +        UINT32 glyph_index,
     91 +        DWRITE_PAINT_ELEMENT* paint_element,
     92 +        D2D_RECT_F* clip_box,
     93 +        DWRITE_PAINT_ATTRIBUTES* glyph_attributes = nullptr
     94 +        )
     95 +    {
     96 +        return SetCurrentGlyph(
     97 +            glyph_index,
     98 +            paint_element,
     99 +            sizeof(DWRITE_PAINT_ELEMENT),
    100 +            clip_box,
    101 +            glyph_attributes
    102 +            );
    103 +    }
    104 +
    105     virtual HRESULT STDMETHODCALLTYPE SetTextColor(
    106 -        const DWRITE_COLOR_F *text_color) = 0;
    107 +        DWRITE_COLOR_F const& text_color) = 0;
    108 
    109     virtual HRESULT STDMETHODCALLTYPE SetColorPaletteIndex(
    110         UINT32 color_palette_index) = 0;
    111 @@ -10464,11 +10480,11 @@ IDWritePaintReader : public IUnknown
    112 
    113     virtual HRESULT STDMETHODCALLTYPE MoveToFirstChild(
    114         DWRITE_PAINT_ELEMENT *paint_element,
    115 -        UINT32 struct_size) = 0;
    116 +        UINT32 struct_size = sizeof(DWRITE_PAINT_ELEMENT)) = 0;
    117 
    118     virtual HRESULT STDMETHODCALLTYPE MoveToNextSibling(
    119         DWRITE_PAINT_ELEMENT *paint_element,
    120 -        UINT32 struct_size) = 0;
    121 +        UINT32 struct_size = sizeof(DWRITE_PAINT_ELEMENT)) = 0;
    122 
    123     virtual HRESULT STDMETHODCALLTYPE MoveToParent(
    124         ) = 0;