Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
56d71b04
Commit
56d71b04
authored
Aug 13, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Added IDWriteFont stub.
parent
22789aa3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
199 additions
and
5 deletions
+199
-5
Makefile.in
dlls/dwrite/Makefile.in
+1
-0
dwrite_private.h
dlls/dwrite/dwrite_private.h
+11
-0
font.c
dlls/dwrite/font.c
+184
-0
gdiinterop.c
dlls/dwrite/gdiinterop.c
+2
-1
font.c
dlls/dwrite/tests/font.c
+1
-4
No files found.
dlls/dwrite/Makefile.in
View file @
56d71b04
...
...
@@ -2,6 +2,7 @@ MODULE = dwrite.dll
IMPORTLIB
=
dwrite
C_SRCS
=
\
font.c
\
gdiinterop.c
\
main.c
...
...
dlls/dwrite/dwrite_private.h
View file @
56d71b04
...
...
@@ -16,4 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
extern
HRESULT
create_gdiinterop
(
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font
(
IDWriteFont
**
)
DECLSPEC_HIDDEN
;
dlls/dwrite/font.c
0 → 100644
View file @
56d71b04
/*
* Font and collections
*
* Copyright 2012 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
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "dwrite.h"
#include "dwrite_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dwrite
);
struct
dwrite_font
{
IDWriteFont
IDWriteFont_iface
;
LONG
ref
;
};
static
inline
struct
dwrite_font
*
impl_from_IDWriteFont
(
IDWriteFont
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_font
,
IDWriteFont_iface
);
}
static
HRESULT
WINAPI
dwritefont_QueryInterface
(
IDWriteFont
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteFont
))
{
*
obj
=
iface
;
IDWriteFont_AddRef
(
iface
);
return
S_OK
;
}
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
dwritefont_AddRef
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
dwritefont_Release
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
heap_free
(
This
);
return
S_OK
;
}
static
HRESULT
WINAPI
dwritefont_GetFontFamily
(
IDWriteFont
*
iface
,
IDWriteFontFamily
**
family
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
family
);
return
E_NOTIMPL
;
}
static
DWRITE_FONT_WEIGHT
WINAPI
dwritefont_GetWeight
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
DWRITE_FONT_WEIGHT_NORMAL
;
}
static
DWRITE_FONT_STRETCH
WINAPI
dwritefont_GetStretch
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
DWRITE_FONT_STRETCH_UNDEFINED
;
}
static
DWRITE_FONT_STYLE
WINAPI
dwritefont_GetStyle
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
DWRITE_FONT_STYLE_NORMAL
;
}
static
BOOL
WINAPI
dwritefont_IsSymbolFont
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
FALSE
;
}
static
HRESULT
WINAPI
dwritefont_GetFaceNames
(
IDWriteFont
*
iface
,
IDWriteLocalizedStrings
**
names
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
names
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefont_GetInformationalStrings
(
IDWriteFont
*
iface
,
DWRITE_INFORMATIONAL_STRING_ID
stringid
,
IDWriteLocalizedStrings
**
strings
,
BOOL
*
exists
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p)->(%d %p %p): stub
\n
"
,
This
,
stringid
,
strings
,
exists
);
return
E_NOTIMPL
;
}
static
DWRITE_FONT_SIMULATIONS
WINAPI
dwritefont_GetSimulations
(
IDWriteFont
*
iface
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
DWRITE_FONT_SIMULATIONS_NONE
;
}
static
void
WINAPI
dwritefont_GetMetrics
(
IDWriteFont
*
iface
,
DWRITE_FONT_METRICS
*
metrics
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
metrics
);
}
static
HRESULT
WINAPI
dwritefont_HasCharacter
(
IDWriteFont
*
iface
,
UINT32
value
,
BOOL
*
exists
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p)->(0x%08x %p): stub
\n
"
,
This
,
value
,
exists
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritefont_CreateFontFace
(
IDWriteFont
*
iface
,
IDWriteFontFace
**
face
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
face
);
return
E_NOTIMPL
;
}
static
const
IDWriteFontVtbl
dwritefontvtbl
=
{
dwritefont_QueryInterface
,
dwritefont_AddRef
,
dwritefont_Release
,
dwritefont_GetFontFamily
,
dwritefont_GetWeight
,
dwritefont_GetStretch
,
dwritefont_GetStyle
,
dwritefont_IsSymbolFont
,
dwritefont_GetFaceNames
,
dwritefont_GetInformationalStrings
,
dwritefont_GetSimulations
,
dwritefont_GetMetrics
,
dwritefont_HasCharacter
,
dwritefont_CreateFontFace
};
HRESULT
create_font
(
IDWriteFont
**
font
)
{
struct
dwrite_font
*
This
;
This
=
heap_alloc
(
sizeof
(
struct
dwrite_font
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDWriteFont_iface
.
lpVtbl
=
&
dwritefontvtbl
;
This
->
ref
=
1
;
*
font
=
&
This
->
IDWriteFont_iface
;
return
S_OK
;
}
dlls/dwrite/gdiinterop.c
View file @
56d71b04
...
...
@@ -23,6 +23,7 @@
#include "windef.h"
#include "winbase.h"
#include "dwrite.h"
#include "dwrite_private.h"
#include "wine/debug.h"
...
...
@@ -60,7 +61,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop *iface,
if
(
!
logfont
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
return
create_font
(
font
)
;
}
static
HRESULT
WINAPI
gdiinterop_ConvertFontToLOGFONT
(
IDWriteGdiInterop
*
iface
,
...
...
dlls/dwrite/tests/font.c
View file @
56d71b04
...
...
@@ -61,23 +61,20 @@ if (0)
lstrcpyW
(
logfont
.
lfFaceName
,
arialW
);
hr
=
IDWriteGdiInterop_CreateFontFromLOGFONT
(
interop
,
&
logfont
,
&
font
);
todo_wine
EXPECT_HR
(
hr
,
S_OK
);
if
(
hr
==
S_OK
)
{
/* now check properties */
weight
=
IDWriteFont_GetWeight
(
font
);
ok
(
weight
==
DWRITE_FONT_WEIGHT_NORMAL
,
"got %d
\n
"
,
weight
);
style
=
IDWriteFont_GetStyle
(
font
);
todo_wine
ok
(
style
==
DWRITE_FONT_STYLE_ITALIC
,
"got %d
\n
"
,
style
);
ret
=
IDWriteFont_IsSymbolFont
(
font
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
IDWriteFont_Release
(
font
);
}
IDWriteGdiInterop_Release
(
interop
);
}
...
...
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