Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
dcfd21cf
Commit
dcfd21cf
authored
May 03, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Make IDWriteGdiInterop1 a part of a factory.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
41729840
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
41 deletions
+16
-41
dwrite_private.h
dlls/dwrite/dwrite_private.h
+7
-2
gdiinterop.c
dlls/dwrite/gdiinterop.c
+6
-25
main.c
dlls/dwrite/main.c
+3
-14
No files found.
dlls/dwrite/dwrite_private.h
View file @
dcfd21cf
...
...
@@ -111,6 +111,12 @@ static inline FLOAT get_scaled_advance_width(INT32 advance, FLOAT emSize, const
return
(
FLOAT
)
advance
*
emSize
/
(
FLOAT
)
metrics
->
designUnitsPerEm
;
}
struct
gdiinterop
{
IDWriteGdiInterop1
IDWriteGdiInterop1_iface
;
IDWriteFactory3
*
factory
;
};
struct
textlayout_desc
{
IDWriteFactory3
*
factory
;
...
...
@@ -146,8 +152,7 @@ extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT
extern
HRESULT
create_textlayout
(
const
struct
textlayout_desc
*
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteFactory3
*
,
IDWriteTextFormat
*
,
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_typography
(
IDWriteTypography
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdiinterop
(
IDWriteFactory3
*
,
IDWriteGdiInterop1
**
)
DECLSPEC_HIDDEN
;
extern
void
release_gdiinterop
(
IDWriteGdiInterop1
*
)
DECLSPEC_HIDDEN
;
extern
void
gdiinterop_init
(
struct
gdiinterop
*
,
IDWriteFactory3
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_localizedstrings
(
IDWriteLocalizedStrings
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
clone_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
IDWriteLocalizedStrings
**
strings
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/gdiinterop.c
View file @
dcfd21cf
...
...
@@ -2,7 +2,7 @@
* GDI Interop
*
* Copyright 2011 Huw Davies
* Copyright 2012, 2014 Nikolay Sivov for CodeWeavers
* Copyright 2012, 2014
-2016
Nikolay Sivov for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -32,11 +32,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dwrite
);
struct
gdiinterop
{
IDWriteGdiInterop1
IDWriteGdiInterop1_iface
;
IDWriteFactory3
*
factory
;
};
struct
dib_data
{
DWORD
*
ptr
;
int
stride
;
...
...
@@ -929,24 +924,10 @@ static const struct IDWriteGdiInterop1Vtbl gdiinteropvtbl = {
gdiinterop1_GetMatchingFontsByLOGFONT
};
HRESULT
create_gdiinterop
(
IDWriteFactory3
*
factory
,
IDWriteGdiInterop1
**
ret
)
{
struct
gdiinterop
*
This
;
*
ret
=
NULL
;
This
=
heap_alloc
(
sizeof
(
struct
gdiinterop
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDWriteGdiInterop1_iface
.
lpVtbl
=
&
gdiinteropvtbl
;
This
->
factory
=
factory
;
*
ret
=
&
This
->
IDWriteGdiInterop1_iface
;
return
S_OK
;
}
void
release_gdiinterop
(
IDWriteGdiInterop1
*
iface
)
void
gdiinterop_init
(
struct
gdiinterop
*
interop
,
IDWriteFactory3
*
factory
)
{
struct
gdiinterop
*
interop
=
impl_from_IDWriteGdiInterop1
(
iface
);
heap_free
(
interop
);
interop
->
IDWriteGdiInterop1_iface
.
lpVtbl
=
&
gdiinteropvtbl
;
/* Interop is a part of a factory, sharing its refcount.
GetGdiInterop() will AddRef() on every call. */
interop
->
factory
=
factory
;
}
dlls/dwrite/main.c
View file @
dcfd21cf
...
...
@@ -525,7 +525,7 @@ struct dwritefactory {
IDWriteFontCollection
*
system_collection
;
IDWriteFontCollection
*
eudc_collection
;
IDWriteGdiInterop1
*
gdi
interop
;
struct
gdiinterop
interop
;
IDWriteFontFallback
*
fallback
;
IDWriteLocalFontFileLoader
*
localfontfileloader
;
...
...
@@ -586,8 +586,6 @@ static void release_dwritefactory(struct dwritefactory *factory)
IDWriteFontCollection_Release
(
factory
->
system_collection
);
if
(
factory
->
eudc_collection
)
IDWriteFontCollection_Release
(
factory
->
eudc_collection
);
if
(
factory
->
gdiinterop
)
release_gdiinterop
(
factory
->
gdiinterop
);
if
(
factory
->
fallback
)
release_system_fontfallback
(
factory
->
fallback
);
heap_free
(
factory
);
...
...
@@ -1057,17 +1055,8 @@ static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory3 *iface, IDWrit
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
gdi_interop
);
*
gdi_interop
=
NULL
;
if
(
!
This
->
gdiinterop
)
{
HRESULT
hr
=
create_gdiinterop
(
iface
,
&
This
->
gdiinterop
);
if
(
FAILED
(
hr
))
return
hr
;
}
*
gdi_interop
=
(
IDWriteGdiInterop
*
)
This
->
gdiinterop
;
*
gdi_interop
=
(
IDWriteGdiInterop
*
)
&
This
->
interop
.
IDWriteGdiInterop1_iface
;
IDWriteGdiInterop_AddRef
(
*
gdi_interop
);
return
S_OK
;
}
...
...
@@ -1489,7 +1478,7 @@ static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYP
factory
->
localfontfileloader
=
NULL
;
factory
->
system_collection
=
NULL
;
factory
->
eudc_collection
=
NULL
;
factory
->
gdiinterop
=
NULL
;
gdiinterop_init
(
&
factory
->
interop
,
&
factory
->
IDWriteFactory3_iface
)
;
factory
->
fallback
=
NULL
;
list_init
(
&
factory
->
collection_loaders
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment