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
b5046c28
Commit
b5046c28
authored
May 13, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Added GdipAddPathRectangle with tests.
parent
22c6e576
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
2 deletions
+83
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
graphicspath.c
dlls/gdiplus/graphicspath.c
+50
-0
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+29
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
b5046c28
...
...
@@ -25,8 +25,8 @@
@ stub GdipAddPathPieI
@ stub GdipAddPathPolygon
@ stub GdipAddPathPolygonI
@ st
ub GdipAddPathRectangle
@ st
ub GdipAddPathRectangleI
@ st
dcall GdipAddPathRectangle(ptr long long long long)
@ st
dcall GdipAddPathRectangleI(ptr long long long long)
@ stub GdipAddPathRectangles
@ stub GdipAddPathRectanglesI
@ stub GdipAddPathString
...
...
dlls/gdiplus/graphicspath.c
View file @
b5046c28
...
...
@@ -708,3 +708,53 @@ GpStatus WINGDIPAPI GdipTransformPath(GpPath *path, GpMatrix *matrix)
return
GdipTransformMatrixPoints
(
matrix
,
path
->
pathdata
.
Points
,
path
->
pathdata
.
Count
);
}
GpStatus
WINGDIPAPI
GdipAddPathRectangle
(
GpPath
*
path
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
)
{
GpPath
*
backup
;
GpPointF
ptf
[
2
];
GpStatus
retstat
;
BOOL
old_new
;
if
(
!
path
||
width
<
0
.
0
||
height
<
0
.
0
)
return
InvalidParameter
;
/* make a backup copy of path data */
if
((
retstat
=
GdipClonePath
(
path
,
&
backup
))
!=
Ok
)
return
retstat
;
/* rectangle should start as new path */
old_new
=
path
->
newfigure
;
path
->
newfigure
=
TRUE
;
if
((
retstat
=
GdipAddPathLine
(
path
,
x
,
y
,
x
+
width
,
y
))
!=
Ok
){
path
->
newfigure
=
old_new
;
goto
fail
;
}
ptf
[
0
].
X
=
x
+
width
;
ptf
[
0
].
Y
=
y
+
height
;
ptf
[
1
].
X
=
x
;
ptf
[
1
].
Y
=
y
+
height
;
if
((
retstat
=
GdipAddPathLine2
(
path
,(
GDIPCONST
GpPointF
*
)
&
ptf
,
2
))
!=
Ok
)
goto
fail
;
path
->
pathdata
.
Types
[
path
->
pathdata
.
Count
-
1
]
|=
PathPointTypeCloseSubpath
;
/* free backup */
GdipDeletePath
(
backup
);
return
Ok
;
fail:
/* reverting */
GdipDeletePath
(
path
);
GdipClonePath
(
backup
,
&
path
);
GdipDeletePath
(
backup
);
return
retstat
;
}
GpStatus
WINGDIPAPI
GdipAddPathRectangleI
(
GpPath
*
path
,
INT
x
,
INT
y
,
INT
width
,
INT
height
)
{
return
GdipAddPathRectangle
(
path
,(
REAL
)
x
,(
REAL
)
y
,(
REAL
)
width
,(
REAL
)
height
);
}
dlls/gdiplus/tests/graphicspath.c
View file @
b5046c28
...
...
@@ -545,6 +545,34 @@ static void test_linei(void)
GdipDeletePath
(
path
);
}
static
path_test_t
rect_path
[]
=
{
{
5
.
0
,
5
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
105
.
0
,
5
.
0
,
PathPointTypeLine
,
0
,
0
},
/*1*/
{
105
.
0
,
55
.
0
,
PathPointTypeLine
,
0
,
0
},
/*2*/
{
5
.
0
,
55
.
0
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
0
},
/*3*/
{
100
.
0
,
50
.
0
,
PathPointTypeStart
,
0
,
0
},
/*4*/
{
220
.
0
,
50
.
0
,
PathPointTypeLine
,
0
,
0
},
/*5*/
{
220
.
0
,
80
.
0
,
PathPointTypeLine
,
0
,
0
},
/*6*/
{
100
.
0
,
80
.
0
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
0
}
/*7*/
};
static
void
test_rect
(
void
)
{
GpStatus
status
;
GpPath
*
path
;
GdipCreatePath
(
FillModeAlternate
,
&
path
);
status
=
GdipAddPathRectangle
(
path
,
5
.
0
,
5
.
0
,
100
.
0
,
50
.
0
);
expect
(
Ok
,
status
);
status
=
GdipAddPathRectangle
(
path
,
100
.
0
,
50
.
0
,
120
.
0
,
30
.
0
);
expect
(
Ok
,
status
);
ok_path
(
path
,
rect_path
,
sizeof
(
rect_path
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
}
START_TEST
(
graphicspath
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -564,6 +592,7 @@ START_TEST(graphicspath)
test_pathpath
();
test_ellipse
();
test_linei
();
test_rect
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
b5046c28
...
...
@@ -213,6 +213,8 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
GpStatus
WINGDIPAPI
GdipAddPathLine2I
(
GpPath
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathLineI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathPath
(
GpPath
*
,
GDIPCONST
GpPath
*
,
BOOL
);
GpStatus
WINGDIPAPI
GdipAddPathRectangle
(
GpPath
*
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipAddPathRectangleI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipClonePath
(
GpPath
*
,
GpPath
**
);
GpStatus
WINGDIPAPI
GdipClosePathFigure
(
GpPath
*
);
GpStatus
WINGDIPAPI
GdipClosePathFigures
(
GpPath
*
);
...
...
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