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
27e86cfc
Commit
27e86cfc
authored
Apr 08, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Added partial implementation for CreateEllipsisTrimmingSign().
parent
6b560c92
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
2 deletions
+141
-2
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
layout.c
dlls/dwrite/layout.c
+108
-0
main.c
dlls/dwrite/main.c
+2
-2
layout.c
dlls/dwrite/tests/layout.c
+30
-0
No files found.
dlls/dwrite/dwrite_private.h
View file @
27e86cfc
...
...
@@ -76,6 +76,7 @@ extern HRESULT convert_fontface_to_logfont(IDWriteFontFace*, LOGFONTW*) DECLSPEC
extern
HRESULT
create_textformat
(
const
WCHAR
*
,
IDWriteFontCollection
*
,
DWRITE_FONT_WEIGHT
,
DWRITE_FONT_STYLE
,
DWRITE_FONT_STRETCH
,
FLOAT
,
const
WCHAR
*
,
IDWriteTextFormat
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_gdiinterop
(
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_localizedstrings
(
IDWriteLocalizedStrings
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/layout.c
View file @
27e86cfc
...
...
@@ -74,6 +74,11 @@ struct dwrite_textformat {
struct
dwrite_textformat_data
format
;
};
struct
dwrite_trimmingsign
{
IDWriteInlineObject
IDWriteInlineObject_iface
;
LONG
ref
;
};
static
const
IDWriteTextFormatVtbl
dwritetextformatvtbl
;
static
void
release_format_data
(
struct
dwrite_textformat_data
*
data
)
...
...
@@ -99,6 +104,11 @@ static inline struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWri
return
iface
->
lpVtbl
==
&
dwritetextformatvtbl
?
impl_from_IDWriteTextFormat
(
iface
)
:
NULL
;
}
static
inline
struct
dwrite_trimmingsign
*
impl_from_IDWriteInlineObject
(
IDWriteInlineObject
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_trimmingsign
,
IDWriteInlineObject_iface
);
}
static
HRESULT
WINAPI
dwritetextlayout_QueryInterface
(
IDWriteTextLayout
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_textlayout
*
This
=
impl_from_IDWriteTextLayout
(
iface
);
...
...
@@ -762,6 +772,104 @@ HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *forma
return
S_OK
;
}
static
HRESULT
WINAPI
dwritetrimmingsign_QueryInterface
(
IDWriteInlineObject
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteInlineObject
))
{
*
obj
=
iface
;
IDWriteInlineObject_AddRef
(
iface
);
return
S_OK
;
}
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
dwritetrimmingsign_AddRef
(
IDWriteInlineObject
*
iface
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
dwritetrimmingsign_Release
(
IDWriteInlineObject
*
iface
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
heap_free
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
dwritetrimmingsign_Draw
(
IDWriteInlineObject
*
iface
,
void
*
context
,
IDWriteTextRenderer
*
renderer
,
FLOAT
originX
,
FLOAT
originY
,
BOOL
is_sideways
,
BOOL
is_rtl
,
IUnknown
*
drawing_effect
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
FIXME
(
"(%p)->(%p %p %f %f %d %d %p): stub
\n
"
,
This
,
context
,
renderer
,
originX
,
originY
,
is_sideways
,
is_rtl
,
drawing_effect
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritetrimmingsign_GetMetrics
(
IDWriteInlineObject
*
iface
,
DWRITE_INLINE_OBJECT_METRICS
*
metrics
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
metrics
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritetrimmingsign_GetOverhangMetrics
(
IDWriteInlineObject
*
iface
,
DWRITE_OVERHANG_METRICS
*
overhangs
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
overhangs
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dwritetrimmingsign_GetBreakConditions
(
IDWriteInlineObject
*
iface
,
DWRITE_BREAK_CONDITION
*
before
,
DWRITE_BREAK_CONDITION
*
after
)
{
struct
dwrite_trimmingsign
*
This
=
impl_from_IDWriteInlineObject
(
iface
);
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
before
,
after
);
*
before
=
*
after
=
DWRITE_BREAK_CONDITION_NEUTRAL
;
return
S_OK
;
}
static
const
IDWriteInlineObjectVtbl
dwritetrimmingsignvtbl
=
{
dwritetrimmingsign_QueryInterface
,
dwritetrimmingsign_AddRef
,
dwritetrimmingsign_Release
,
dwritetrimmingsign_Draw
,
dwritetrimmingsign_GetMetrics
,
dwritetrimmingsign_GetOverhangMetrics
,
dwritetrimmingsign_GetBreakConditions
};
HRESULT
create_trimmingsign
(
IDWriteInlineObject
**
sign
)
{
struct
dwrite_trimmingsign
*
This
;
*
sign
=
NULL
;
This
=
heap_alloc
(
sizeof
(
struct
dwrite_trimmingsign
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDWriteInlineObject_iface
.
lpVtbl
=
&
dwritetrimmingsignvtbl
;
This
->
ref
=
1
;
*
sign
=
&
This
->
IDWriteInlineObject_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
dwritetextformat_QueryInterface
(
IDWriteTextFormat
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_textformat
*
This
=
impl_from_IDWriteTextFormat
(
iface
);
...
...
dlls/dwrite/main.c
View file @
27e86cfc
...
...
@@ -527,8 +527,8 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory
static
HRESULT
WINAPI
dwritefactory_CreateEllipsisTrimmingSign
(
IDWriteFactory
*
iface
,
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
trimming_sign
)
{
FIXME
(
"(%p %p): stub
\n
"
,
format
,
trimming_sign
);
return
E_NOTIMPL
;
FIXME
(
"(%p %p): s
emi-s
tub
\n
"
,
format
,
trimming_sign
);
return
create_trimmingsign
(
trimming_sign
)
;
}
static
HRESULT
WINAPI
dwritefactory_CreateTextAnalyzer
(
IDWriteFactory
*
iface
,
IDWriteTextAnalyzer
**
analyzer
)
...
...
dlls/dwrite/tests/layout.c
View file @
27e86cfc
...
...
@@ -233,6 +233,35 @@ static void test_GetLocaleName(void)
IDWriteTextFormat_Release
(
format
);
}
static
void
test_CreateEllipsisTrimmingSign
(
void
)
{
DWRITE_BREAK_CONDITION
before
,
after
;
IDWriteTextFormat
*
format
;
IDWriteInlineObject
*
sign
;
HRESULT
hr
;
hr
=
IDWriteFactory_CreateTextFormat
(
factory
,
tahomaW
,
NULL
,
DWRITE_FONT_WEIGHT_NORMAL
,
DWRITE_FONT_STYLE_NORMAL
,
DWRITE_FONT_STRETCH_NORMAL
,
10
.
0
,
enusW
,
&
format
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
EXPECT_REF
(
format
,
1
);
hr
=
IDWriteFactory_CreateEllipsisTrimmingSign
(
factory
,
format
,
&
sign
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
EXPECT_REF
(
format
,
1
);
if
(
0
)
/* crashes on native */
hr
=
IDWriteInlineObject_GetBreakConditions
(
sign
,
NULL
,
NULL
);
before
=
after
=
DWRITE_BREAK_CONDITION_CAN_BREAK
;
hr
=
IDWriteInlineObject_GetBreakConditions
(
sign
,
&
before
,
&
after
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
before
==
DWRITE_BREAK_CONDITION_NEUTRAL
,
"got %d
\n
"
,
before
);
ok
(
after
==
DWRITE_BREAK_CONDITION_NEUTRAL
,
"got %d
\n
"
,
after
);
IDWriteInlineObject_Release
(
sign
);
IDWriteTextFormat_Release
(
format
);
}
START_TEST
(
layout
)
{
HRESULT
hr
;
...
...
@@ -249,6 +278,7 @@ START_TEST(layout)
test_CreateGdiCompatibleTextLayout
();
test_CreateTextFormat
();
test_GetLocaleName
();
test_CreateEllipsisTrimmingSign
();
IDWriteFactory_Release
(
factory
);
}
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