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
0ea8c1d6
Commit
0ea8c1d6
authored
Apr 02, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t2embed: Implement TTIsEmbeddingEnabled().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
847da79c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
3 deletions
+69
-3
main.c
dlls/t2embed/main.c
+21
-3
t2embed.c
dlls/t2embed/tests/t2embed.c
+45
-0
t2embapi.h
include/t2embapi.h
+3
-0
No files found.
dlls/t2embed/main.c
View file @
0ea8c1d6
...
@@ -148,9 +148,27 @@ LONG WINAPI TTIsEmbeddingEnabledForFacename(LPCSTR facename, BOOL *enabled)
...
@@ -148,9 +148,27 @@ LONG WINAPI TTIsEmbeddingEnabledForFacename(LPCSTR facename, BOOL *enabled)
LONG
WINAPI
TTIsEmbeddingEnabled
(
HDC
hDC
,
BOOL
*
enabled
)
LONG
WINAPI
TTIsEmbeddingEnabled
(
HDC
hDC
,
BOOL
*
enabled
)
{
{
FIXME
(
"(%p %p) stub
\n
"
,
hDC
,
enabled
);
OUTLINETEXTMETRICA
*
otm
;
if
(
enabled
)
*
enabled
=
FALSE
;
LONG
ret
;
return
E_API_NOTIMPL
;
UINT
len
;
TRACE
(
"(%p %p)
\n
"
,
hDC
,
enabled
);
if
(
!
hDC
)
return
E_HDCINVALID
;
len
=
GetOutlineTextMetricsA
(
hDC
,
0
,
NULL
);
if
(
!
len
)
return
E_ERRORACCESSINGFACENAME
;
otm
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
!
otm
)
return
E_NOFREEMEMORY
;
GetOutlineTextMetricsA
(
hDC
,
len
,
otm
);
ret
=
TTIsEmbeddingEnabledForFacename
(
otm
->
otmpFaceName
,
enabled
);
HeapFree
(
GetProcessHeap
(),
0
,
otm
);
return
ret
;
}
}
LONG
WINAPI
TTDeleteEmbeddedFont
(
HANDLE
hFontReference
,
ULONG
flags
,
ULONG
*
status
)
LONG
WINAPI
TTDeleteEmbeddedFont
(
HANDLE
hFontReference
,
ULONG
flags
,
ULONG
*
status
)
...
...
dlls/t2embed/tests/t2embed.c
View file @
0ea8c1d6
...
@@ -98,8 +98,53 @@ static void test_TTIsEmbeddingEnabledForFacename(void)
...
@@ -98,8 +98,53 @@ static void test_TTIsEmbeddingEnabledForFacename(void)
ok
(
status
!=
123
,
"got %d
\n
"
,
status
);
ok
(
status
!=
123
,
"got %d
\n
"
,
status
);
}
}
static
void
test_TTIsEmbeddingEnabled
(
void
)
{
HFONT
old_font
,
hfont
;
LONG
ret
,
status
;
LOGFONTA
logfont
;
HDC
hdc
;
ret
=
TTIsEmbeddingEnabled
(
NULL
,
NULL
);
ok
(
ret
==
E_HDCINVALID
,
"got %#x
\n
"
,
ret
);
status
=
123
;
ret
=
TTIsEmbeddingEnabled
(
NULL
,
&
status
);
ok
(
ret
==
E_HDCINVALID
,
"got %#x
\n
"
,
ret
);
ok
(
status
==
123
,
"got %d
\n
"
,
status
);
hdc
=
CreateCompatibleDC
(
0
);
ret
=
TTIsEmbeddingEnabled
(
hdc
,
NULL
);
ok
(
ret
==
E_ERRORACCESSINGFACENAME
,
"got %#x
\n
"
,
ret
);
status
=
123
;
ret
=
TTIsEmbeddingEnabled
(
hdc
,
&
status
);
ok
(
ret
==
E_ERRORACCESSINGFACENAME
,
"got %#x
\n
"
,
ret
);
ok
(
status
==
123
,
"got %u
\n
"
,
status
);
memset
(
&
logfont
,
0
,
sizeof
(
logfont
));
logfont
.
lfHeight
=
12
;
logfont
.
lfWeight
=
FW_NORMAL
;
strcpy
(
logfont
.
lfFaceName
,
"Tahoma"
);
hfont
=
CreateFontIndirectA
(
&
logfont
);
ok
(
hfont
!=
NULL
,
"got %p
\n
"
,
hfont
);
old_font
=
SelectObject
(
hdc
,
hfont
);
status
=
123
;
ret
=
TTIsEmbeddingEnabled
(
hdc
,
&
status
);
ok
(
ret
==
E_NONE
,
"got %#x
\n
"
,
ret
);
ok
(
status
!=
123
,
"got %u
\n
"
,
status
);
SelectObject
(
hdc
,
old_font
);
DeleteObject
(
hfont
);
DeleteDC
(
hdc
);
}
START_TEST
(
t2embed
)
START_TEST
(
t2embed
)
{
{
test_TTGetEmbeddingType
();
test_TTGetEmbeddingType
();
test_TTIsEmbeddingEnabledForFacename
();
test_TTIsEmbeddingEnabledForFacename
();
test_TTIsEmbeddingEnabled
();
}
}
include/t2embapi.h
View file @
0ea8c1d6
...
@@ -40,8 +40,10 @@ extern "C" {
...
@@ -40,8 +40,10 @@ extern "C" {
#define E_NONE __MSABI_LONG(0x0000)
#define E_NONE __MSABI_LONG(0x0000)
#define E_API_NOTIMPL __MSABI_LONG(0x0001)
#define E_API_NOTIMPL __MSABI_LONG(0x0001)
#define E_HDCINVALID __MSABI_LONG(0x0006)
#define E_HDCINVALID __MSABI_LONG(0x0006)
#define E_NOFREEMEMORY __MSABI_LONG(0x0007)
#define E_NOTATRUETYPEFONT __MSABI_LONG(0x000a)
#define E_NOTATRUETYPEFONT __MSABI_LONG(0x000a)
#define E_ERRORACCESSINGFONTDATA __MSABI_LONG(0x000c)
#define E_ERRORACCESSINGFONTDATA __MSABI_LONG(0x000c)
#define E_ERRORACCESSINGFACENAME __MSABI_LONG(0x000d)
#define E_FACENAMEINVALID __MSABI_LONG(0x0113)
#define E_FACENAMEINVALID __MSABI_LONG(0x0113)
#define E_PERMISSIONSINVALID __MSABI_LONG(0x0117)
#define E_PERMISSIONSINVALID __MSABI_LONG(0x0117)
#define E_PBENABLEDINVALID __MSABI_LONG(0x0118)
#define E_PBENABLEDINVALID __MSABI_LONG(0x0118)
...
@@ -75,6 +77,7 @@ LONG WINAPI TTDeleteEmbeddedFont(HANDLE,ULONG,ULONG*);
...
@@ -75,6 +77,7 @@ LONG WINAPI TTDeleteEmbeddedFont(HANDLE,ULONG,ULONG*);
LONG
WINAPI
TTGetEmbeddingType
(
HDC
,
ULONG
*
);
LONG
WINAPI
TTGetEmbeddingType
(
HDC
,
ULONG
*
);
LONG
WINAPI
TTIsEmbeddingEnabledForFacename
(
LPCSTR
facename
,
BOOL
*
enabled
);
LONG
WINAPI
TTIsEmbeddingEnabledForFacename
(
LPCSTR
facename
,
BOOL
*
enabled
);
LONG
WINAPI
TTIsEmbeddingEnabled
(
HDC
hdc
,
BOOL
*
enabled
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
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