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
fdc56196
Commit
fdc56196
authored
Feb 04, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/layout: Implement desired orientation get/set methods.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4914f51c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
14 deletions
+62
-14
layout.c
dlls/dwrite/layout.c
+38
-14
layout.c
dlls/dwrite/tests/layout.c
+24
-0
No files found.
dlls/dwrite/layout.c
View file @
fdc56196
...
...
@@ -492,6 +492,19 @@ static HRESULT format_set_optical_alignment(struct dwrite_textformat_data *forma
return
S_OK
;
}
static
HRESULT
format_set_vertical_orientation
(
struct
dwrite_textformat_data
*
format
,
DWRITE_VERTICAL_GLYPH_ORIENTATION
orientation
,
BOOL
*
changed
)
{
if
((
UINT32
)
orientation
>
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
)
return
E_INVALIDARG
;
if
(
changed
)
*
changed
=
format
->
vertical_orientation
!=
orientation
;
format
->
vertical_orientation
=
orientation
;
return
S_OK
;
}
static
BOOL
is_run_rtl
(
const
struct
layout_effective_run
*
run
)
{
return
run
->
run
->
u
.
regular
.
run
.
bidiLevel
&
1
;
...
...
@@ -3957,6 +3970,21 @@ static HRESULT WINAPI dwritetextlayout2_GetMetrics(IDWriteTextLayout4 *iface, DW
return
hr
;
}
static
HRESULT
layout_set_vertical_orientation
(
struct
dwrite_textlayout
*
layout
,
DWRITE_VERTICAL_GLYPH_ORIENTATION
orientation
)
{
BOOL
changed
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
format_set_vertical_orientation
(
&
layout
->
format
,
orientation
,
&
changed
)))
return
hr
;
if
(
changed
)
layout
->
recompute
=
RECOMPUTE_EVERYTHING
;
return
S_OK
;
}
static
HRESULT
WINAPI
dwritetextlayout2_SetVerticalGlyphOrientation
(
IDWriteTextLayout4
*
iface
,
DWRITE_VERTICAL_GLYPH_ORIENTATION
orientation
)
{
...
...
@@ -3964,11 +3992,7 @@ static HRESULT WINAPI dwritetextlayout2_SetVerticalGlyphOrientation(IDWriteTextL
TRACE
(
"%p, %d.
\n
"
,
iface
,
orientation
);
if
((
UINT32
)
orientation
>
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
)
return
E_INVALIDARG
;
layout
->
format
.
vertical_orientation
=
orientation
;
return
S_OK
;
return
layout_set_vertical_orientation
(
layout
,
orientation
);
}
static
DWRITE_VERTICAL_GLYPH_ORIENTATION
WINAPI
dwritetextlayout2_GetVerticalGlyphOrientation
(
IDWriteTextLayout4
*
iface
)
...
...
@@ -4591,16 +4615,20 @@ static HRESULT WINAPI dwritetextformat_layout_GetLocaleName(IDWriteTextFormat3 *
static
HRESULT
WINAPI
dwritetextformat1_layout_SetVerticalGlyphOrientation
(
IDWriteTextFormat3
*
iface
,
DWRITE_VERTICAL_GLYPH_ORIENTATION
orientation
)
{
FIXME
(
"%p, %d: stub
\n
"
,
iface
,
orientation
);
struct
dwrite_textlayout
*
layout
=
impl_layout_from_IDWriteTextFormat3
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %d.
\n
"
,
iface
,
orientation
);
return
layout_set_vertical_orientation
(
layout
,
orientation
);
}
static
DWRITE_VERTICAL_GLYPH_ORIENTATION
WINAPI
dwritetextformat1_layout_GetVerticalGlyphOrientation
(
IDWriteTextFormat3
*
iface
)
{
FIXME
(
"%p: stub
\n
"
,
iface
);
struct
dwrite_textlayout
*
layout
=
impl_layout_from_IDWriteTextFormat3
(
iface
);
return
DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT
;
TRACE
(
"%p.
\n
"
,
iface
);
return
layout
->
format
.
vertical_orientation
;
}
static
HRESULT
WINAPI
dwritetextformat1_layout_SetLastLineWrapping
(
IDWriteTextFormat3
*
iface
,
...
...
@@ -5709,11 +5737,7 @@ static HRESULT WINAPI dwritetextformat1_SetVerticalGlyphOrientation(IDWriteTextF
TRACE
(
"%p, %d.
\n
"
,
iface
,
orientation
);
if
((
UINT32
)
orientation
>
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
)
return
E_INVALIDARG
;
format
->
format
.
vertical_orientation
=
orientation
;
return
S_OK
;
return
format_set_vertical_orientation
(
&
format
->
format
,
orientation
,
NULL
);
}
static
DWRITE_VERTICAL_GLYPH_ORIENTATION
WINAPI
dwritetextformat1_GetVerticalGlyphOrientation
(
IDWriteTextFormat3
*
iface
)
...
...
dlls/dwrite/tests/layout.c
View file @
fdc56196
...
...
@@ -2708,6 +2708,7 @@ static void test_SetVerticalGlyphOrientation(void)
{
DWRITE_VERTICAL_GLYPH_ORIENTATION
orientation
;
IDWriteTextLayout2
*
layout2
;
IDWriteTextFormat1
*
format1
;
IDWriteTextFormat
*
format
;
IDWriteTextLayout
*
layout
;
IDWriteFactory
*
factory
;
...
...
@@ -2738,6 +2739,29 @@ static void test_SetVerticalGlyphOrientation(void)
hr
=
IDWriteTextLayout2_SetVerticalGlyphOrientation
(
layout2
,
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteTextLayout2_QueryInterface
(
layout2
,
&
IID_IDWriteTextFormat1
,
(
void
**
)
&
format1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
orientation
=
IDWriteTextFormat1_GetVerticalGlyphOrientation
(
format1
);
ok
(
orientation
==
DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT
,
"Unexpected orientation %d.
\n
"
,
orientation
);
hr
=
IDWriteTextLayout2_SetVerticalGlyphOrientation
(
layout2
,
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
orientation
=
IDWriteTextLayout2_GetVerticalGlyphOrientation
(
layout2
);
ok
(
orientation
==
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
,
"Unexpected orientation %d.
\n
"
,
orientation
);
orientation
=
IDWriteTextFormat1_GetVerticalGlyphOrientation
(
format1
);
ok
(
orientation
==
DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED
,
"Unexpected orientation %d.
\n
"
,
orientation
);
hr
=
IDWriteTextFormat1_SetVerticalGlyphOrientation
(
format1
,
DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
orientation
=
IDWriteTextLayout2_GetVerticalGlyphOrientation
(
layout2
);
ok
(
orientation
==
DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT
,
"Unexpected orientation %d.
\n
"
,
orientation
);
IDWriteTextFormat1_Release
(
format1
);
IDWriteTextLayout2_Release
(
layout2
);
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