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
6fd4f963
Commit
6fd4f963
authored
Jun 15, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Initial implementation of Draw() for trimming sign.
parent
6304a0f5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
10 deletions
+42
-10
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-1
layout.c
dlls/dwrite/layout.c
+25
-8
main.c
dlls/dwrite/main.c
+1
-1
layout.c
dlls/dwrite/tests/layout.c
+15
-0
No files found.
dlls/dwrite/dwrite_private.h
View file @
6fd4f963
...
...
@@ -103,7 +103,7 @@ extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT
FLOAT
,
const
WCHAR
*
,
IDWriteTextFormat
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdicompat_textlayout
(
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
FLOAT
,
const
DWRITE_MATRIX
*
,
BOOL
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteTextFormat
*
,
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWrite
Factory2
*
,
IDWrite
TextFormat
*
,
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_typography
(
IDWriteTypography
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdiinterop
(
IDWriteFactory2
*
,
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
extern
void
release_gdiinterop
(
IDWriteGdiInterop
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/layout.c
View file @
6fd4f963
...
...
@@ -243,6 +243,8 @@ struct dwrite_textformat {
struct
dwrite_trimmingsign
{
IDWriteInlineObject
IDWriteInlineObject_iface
;
LONG
ref
;
IDWriteTextLayout
*
layout
;
};
struct
dwrite_typography
{
...
...
@@ -3371,7 +3373,6 @@ static HRESULT WINAPI dwritetrimmingsign_QueryInterface(IDWriteInlineObject *ifa
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
dwritetrimmingsign_AddRef
(
IDWriteInlineObject
*
iface
)
...
...
@@ -3389,18 +3390,24 @@ static ULONG WINAPI dwritetrimmingsign_Release(IDWriteInlineObject *iface)
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
{
IDWriteTextLayout_Release
(
This
->
layout
);
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
)
FLOAT
originX
,
FLOAT
originY
,
BOOL
is_sideways
,
BOOL
is_rtl
,
IUnknown
*
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
;
DWRITE_TEXT_RANGE
range
=
{
0
,
~
0u
};
TRACE
(
"(%p)->(%p %p %.2f %.2f %d %d %p)
\n
"
,
This
,
context
,
renderer
,
originX
,
originY
,
is_sideways
,
is_rtl
,
effect
);
IDWriteTextLayout_SetDrawingEffect
(
This
->
layout
,
effect
,
range
);
return
IDWriteTextLayout_Draw
(
This
->
layout
,
context
,
renderer
,
originX
,
originY
);
}
static
HRESULT
WINAPI
dwritetrimmingsign_GetMetrics
(
IDWriteInlineObject
*
iface
,
DWRITE_INLINE_OBJECT_METRICS
*
metrics
)
...
...
@@ -3463,11 +3470,13 @@ static inline BOOL is_flow_direction_vert(DWRITE_FLOW_DIRECTION direction)
(
direction
==
DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP
);
}
HRESULT
create_trimmingsign
(
IDWriteTextFormat
*
format
,
IDWriteInlineObject
**
sign
)
HRESULT
create_trimmingsign
(
IDWrite
Factory2
*
factory
,
IDWrite
TextFormat
*
format
,
IDWriteInlineObject
**
sign
)
{
static
const
WCHAR
ellipsisW
=
0x2026
;
struct
dwrite_trimmingsign
*
This
;
DWRITE_READING_DIRECTION
reading
;
DWRITE_FLOW_DIRECTION
flow
;
HRESULT
hr
;
*
sign
=
NULL
;
...
...
@@ -3480,12 +3489,20 @@ HRESULT create_trimmingsign(IDWriteTextFormat *format, IDWriteInlineObject **sig
(
is_reading_direction_vert
(
reading
)
&&
is_flow_direction_vert
(
flow
)))
return
DWRITE_E_FLOWDIRECTIONCONFLICTS
;
This
=
heap_alloc
(
sizeof
(
struct
dwrite_trimmingsign
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
=
heap_alloc
(
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDWriteInlineObject_iface
.
lpVtbl
=
&
dwritetrimmingsignvtbl
;
This
->
ref
=
1
;
hr
=
IDWriteFactory2_CreateTextLayout
(
factory
,
&
ellipsisW
,
1
,
format
,
0
.
0
,
0
.
0
,
&
This
->
layout
);
if
(
FAILED
(
hr
))
{
heap_free
(
This
);
return
hr
;
}
IDWriteTextLayout_SetWordWrapping
(
This
->
layout
,
DWRITE_WORD_WRAPPING_NO_WRAP
);
*
sign
=
&
This
->
IDWriteInlineObject_iface
;
return
S_OK
;
...
...
dlls/dwrite/main.c
View file @
6fd4f963
...
...
@@ -1052,7 +1052,7 @@ static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory2 *
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory2
(
iface
);
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
format
,
trimming_sign
);
return
create_trimmingsign
(
format
,
trimming_sign
);
return
create_trimmingsign
(
iface
,
format
,
trimming_sign
);
}
static
HRESULT
WINAPI
dwritefactory_CreateTextAnalyzer
(
IDWriteFactory2
*
iface
,
IDWriteTextAnalyzer
**
analyzer
)
...
...
dlls/dwrite/tests/layout.c
View file @
6fd4f963
...
...
@@ -856,12 +856,18 @@ static void test_GetLocaleName(void)
IDWriteFactory_Release
(
factory
);
}
static
const
struct
drawcall_entry
drawellipsis_seq
[]
=
{
{
DRAW_GLYPHRUN
,
{
0x2026
,
0
}
},
{
DRAW_LAST_KIND
}
};
static
void
test_CreateEllipsisTrimmingSign
(
void
)
{
DWRITE_BREAK_CONDITION
before
,
after
;
IDWriteTextFormat
*
format
;
IDWriteInlineObject
*
sign
;
IDWriteFactory
*
factory
;
IUnknown
*
unk
;
HRESULT
hr
;
factory
=
create_factory
();
...
...
@@ -875,6 +881,9 @@ static void test_CreateEllipsisTrimmingSign(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
EXPECT_REF
(
format
,
1
);
hr
=
IDWriteInlineObject_QueryInterface
(
sign
,
&
IID_IDWriteTextLayout
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
/* crashes on native */
hr
=
IDWriteInlineObject_GetBreakConditions
(
sign
,
NULL
,
NULL
);
...
...
@@ -883,6 +892,12 @@ if (0) /* crashes on native */
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
);
/* Draw tests */
flush_sequence
(
sequences
,
RENDERER_ID
);
hr
=
IDWriteInlineObject_Draw
(
sign
,
NULL
,
&
testrenderer
,
0
.
0
,
0
.
0
,
FALSE
,
FALSE
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok_sequence
(
sequences
,
RENDERER_ID
,
drawellipsis_seq
,
"ellipsis sign draw test"
,
FALSE
);
IDWriteInlineObject_Release
(
sign
);
/* non-orthogonal flow/reading combination */
...
...
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