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
63d18fd0
Commit
63d18fd0
authored
Aug 24, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Add a tiny helper to return DWRITE_TEXT_RANGE values.
parent
65a468ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
layout.c
dlls/dwrite/layout.c
+12
-12
layout.c
dlls/dwrite/tests/layout.c
+9
-0
No files found.
dlls/dwrite/layout.c
View file @
63d18fd0
...
...
@@ -330,6 +330,12 @@ static inline BOOL is_in_layout_range(const DWRITE_TEXT_RANGE *outer, const DWRI
(
inner
->
startPosition
+
inner
->
length
<=
outer
->
startPosition
+
outer
->
length
);
}
static
inline
HRESULT
return_range
(
const
struct
layout_range
*
range
,
DWRITE_TEXT_RANGE
*
r
)
{
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
}
/* Set attribute value for given range, does all needed splitting/merging of existing ranges. */
static
HRESULT
set_layout_range_attr
(
struct
dwrite_textlayout
*
layout
,
enum
layout_range_attr_kind
attr
,
struct
layout_range_attr_value
*
value
)
{
...
...
@@ -902,9 +908,8 @@ static HRESULT WINAPI dwritetextlayout_layout_GetFontWeight(IDWriteTextLayout *i
range
=
get_layout_range_by_pos
(
This
,
position
);
*
weight
=
range
->
weight
;
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
return
return_range
(
range
,
r
)
;
}
static
HRESULT
WINAPI
dwritetextlayout_layout_GetFontStyle
(
IDWriteTextLayout
*
iface
,
...
...
@@ -920,9 +925,8 @@ static HRESULT WINAPI dwritetextlayout_layout_GetFontStyle(IDWriteTextLayout *if
range
=
get_layout_range_by_pos
(
This
,
position
);
*
style
=
range
->
style
;
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
return
return_range
(
range
,
r
)
;
}
static
HRESULT
WINAPI
dwritetextlayout_layout_GetFontStretch
(
IDWriteTextLayout
*
iface
,
...
...
@@ -954,9 +958,8 @@ static HRESULT WINAPI dwritetextlayout_GetUnderline(IDWriteTextLayout *iface,
range
=
get_layout_range_by_pos
(
This
,
position
);
*
underline
=
range
->
underline
;
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
return
return_range
(
range
,
r
)
;
}
static
HRESULT
WINAPI
dwritetextlayout_GetStrikethrough
(
IDWriteTextLayout
*
iface
,
...
...
@@ -972,9 +975,8 @@ static HRESULT WINAPI dwritetextlayout_GetStrikethrough(IDWriteTextLayout *iface
range
=
get_layout_range_by_pos
(
This
,
position
);
*
strikethrough
=
range
->
strikethrough
;
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
return
return_range
(
range
,
r
)
;
}
static
HRESULT
WINAPI
dwritetextlayout_GetDrawingEffect
(
IDWriteTextLayout
*
iface
,
...
...
@@ -992,9 +994,8 @@ static HRESULT WINAPI dwritetextlayout_GetDrawingEffect(IDWriteTextLayout *iface
*
effect
=
range
->
effect
;
if
(
*
effect
)
IUnknown_AddRef
(
*
effect
);
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
return
return_range
(
range
,
r
)
;
}
static
HRESULT
WINAPI
dwritetextlayout_GetInlineObject
(
IDWriteTextLayout
*
iface
,
...
...
@@ -1009,9 +1010,8 @@ static HRESULT WINAPI dwritetextlayout_GetInlineObject(IDWriteTextLayout *iface,
*
object
=
range
?
range
->
object
:
NULL
;
if
(
*
object
)
IDWriteInlineObject_AddRef
(
*
object
);
if
(
r
)
*
r
=
range
->
range
;
return
S_OK
;
return
return_range
(
range
,
r
)
;
}
static
HRESULT
WINAPI
dwritetextlayout_GetTypography
(
IDWriteTextLayout
*
iface
,
...
...
dlls/dwrite/tests/layout.c
View file @
63d18fd0
...
...
@@ -628,6 +628,15 @@ static void test_SetInlineObject(void)
ok
(
r2
.
startPosition
==
0
&&
r2
.
length
==
2
,
"got %d, %d
\n
"
,
r2
.
startPosition
,
r2
.
length
);
IDWriteInlineObject_Release
(
inlinetest
);
/* get from somewhere inside a range */
inlinetest
=
NULL
;
r2
.
startPosition
=
r2
.
length
=
100
;
hr
=
IDWriteTextLayout_GetInlineObject
(
layout
,
1
,
&
inlinetest
,
&
r2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
inlinetest
==
inlineobj
,
"got %p
\n
"
,
inlinetest
);
ok
(
r2
.
startPosition
==
0
&&
r2
.
length
==
2
,
"got %d, %d
\n
"
,
r2
.
startPosition
,
r2
.
length
);
IDWriteInlineObject_Release
(
inlinetest
);
range
.
startPosition
=
1
;
range
.
length
=
1
;
hr
=
IDWriteTextLayout_SetInlineObject
(
layout
,
inlineobj2
,
range
);
...
...
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