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
003b5de4
Commit
003b5de4
authored
Dec 28, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Dec 31, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add GdipCreatePen2 and test cases.
parent
b810430f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
3 deletions
+48
-3
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
pen.c
dlls/gdiplus/pen.c
+10
-2
pen.c
dlls/gdiplus/tests/pen.c
+37
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
003b5de4
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
@ stub GdipCreatePathGradientI
@ stub GdipCreatePathGradientI
@ stdcall GdipCreatePathIter(ptr ptr)
@ stdcall GdipCreatePathIter(ptr ptr)
@ stdcall GdipCreatePen1(long long long ptr)
@ stdcall GdipCreatePen1(long long long ptr)
@ st
ub GdipCreatePen2
@ st
dcall GdipCreatePen2(ptr long long ptr)
@ stub GdipCreateRegion
@ stub GdipCreateRegion
@ stub GdipCreateRegionHrgn
@ stub GdipCreateRegionHrgn
@ stub GdipCreateRegionPath
@ stub GdipCreateRegionPath
...
...
dlls/gdiplus/pen.c
View file @
003b5de4
...
@@ -87,9 +87,17 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
...
@@ -87,9 +87,17 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
GpStatus
WINGDIPAPI
GdipCreatePen1
(
ARGB
color
,
REAL
width
,
GpUnit
unit
,
GpStatus
WINGDIPAPI
GdipCreatePen1
(
ARGB
color
,
REAL
width
,
GpUnit
unit
,
GpPen
**
pen
)
GpPen
**
pen
)
{
{
GpBrush
*
brush
;
GdipCreateSolidFill
(
color
,
(
GpSolidFill
**
)(
&
brush
));
return
GdipCreatePen2
(
brush
,
width
,
unit
,
pen
);
}
GpStatus
WINGDIPAPI
GdipCreatePen2
(
GpBrush
*
brush
,
REAL
width
,
GpUnit
unit
,
GpPen
**
pen
)
{
GpPen
*
gp_pen
;
GpPen
*
gp_pen
;
if
(
!
pen
)
if
(
!
pen
||
!
brush
)
return
InvalidParameter
;
return
InvalidParameter
;
gp_pen
=
GdipAlloc
(
sizeof
(
GpPen
));
gp_pen
=
GdipAlloc
(
sizeof
(
GpPen
));
...
@@ -103,7 +111,7 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
...
@@ -103,7 +111,7 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit,
gp_pen
->
miterlimit
=
10
.
0
;
gp_pen
->
miterlimit
=
10
.
0
;
gp_pen
->
dash
=
DashStyleSolid
;
gp_pen
->
dash
=
DashStyleSolid
;
gp_pen
->
offset
=
0
.
0
;
gp_pen
->
offset
=
0
.
0
;
GdipCreateSolidFill
(
color
,
(
GpSolidFill
**
)(
&
gp_pen
->
brush
))
;
gp_pen
->
brush
=
brush
;
if
(
!
((
gp_pen
->
unit
==
UnitWorld
)
||
(
gp_pen
->
unit
==
UnitPixel
)))
{
if
(
!
((
gp_pen
->
unit
==
UnitWorld
)
||
(
gp_pen
->
unit
==
UnitPixel
)))
{
FIXME
(
"UnitWorld, UnitPixel only supported units
\n
"
);
FIXME
(
"UnitWorld, UnitPixel only supported units
\n
"
);
...
...
dlls/gdiplus/tests/pen.c
View file @
003b5de4
...
@@ -62,6 +62,10 @@ static void test_constructor_destructor(void)
...
@@ -62,6 +62,10 @@ static void test_constructor_destructor(void)
GpStatus
status
;
GpStatus
status
;
GpPen
*
pen
=
NULL
;
GpPen
*
pen
=
NULL
;
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
NULL
);
expect
(
InvalidParameter
,
status
);
ok
(
pen
==
NULL
,
"Expected pen to be NULL
\n
"
);
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
...
@@ -73,6 +77,38 @@ static void test_constructor_destructor(void)
...
@@ -73,6 +77,38 @@ static void test_constructor_destructor(void)
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
}
}
static
void
test_constructor_destructor2
(
void
)
{
GpStatus
status
;
GpPen
*
pen
=
NULL
;
GpBrush
*
brush
=
NULL
;
GpPointF
points
[
2
];
status
=
GdipCreatePen2
(
NULL
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
InvalidParameter
,
status
);
ok
(
pen
==
NULL
,
"Expected pen to be NULL
\n
"
);
points
[
0
].
X
=
7
.
0
;
points
[
0
].
Y
=
11
.
0
;
points
[
1
].
X
=
13
.
0
;
points
[
1
].
Y
=
17
.
0
;
status
=
GdipCreateLineBrush
(
&
points
[
0
],
&
points
[
1
],
(
ARGB
)
0xffff00ff
,
(
ARGB
)
0xff0000ff
,
WrapModeTile
,
(
GpLineGradient
**
)
&
brush
);
expect
(
Ok
,
status
);
ok
(
brush
!=
NULL
,
"Expected brush to be initialized
\n
"
);
status
=
GdipCreatePen2
(
brush
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
status
=
GdipDeletePen
(
pen
);
expect
(
Ok
,
status
);
status
=
GdipDeleteBrush
(
brush
);
expect
(
Ok
,
status
);
}
static
void
test_brushfill
(
void
)
static
void
test_brushfill
(
void
)
{
{
GpStatus
status
;
GpStatus
status
;
...
@@ -205,6 +241,7 @@ START_TEST(pen)
...
@@ -205,6 +241,7 @@ START_TEST(pen)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_constructor_destructor
();
test_constructor_destructor
();
test_constructor_destructor2
();
test_brushfill
();
test_brushfill
();
test_dasharray
();
test_dasharray
();
...
...
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