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
d4ae6fa1
Commit
d4ae6fa1
authored
Jun 18, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipAddPathRectangles with tests.
parent
250a9d74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
2 deletions
+85
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
graphicspath.c
dlls/gdiplus/graphicspath.c
+62
-0
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+19
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
d4ae6fa1
...
...
@@ -27,8 +27,8 @@
@ stub GdipAddPathPolygonI
@ stdcall GdipAddPathRectangle(ptr long long long long)
@ stdcall GdipAddPathRectangleI(ptr long long long long)
@ st
ub GdipAddPathRectangles
@ st
ub GdipAddPathRectanglesI
@ st
dcall GdipAddPathRectangles(ptr ptr long)
@ st
dcall GdipAddPathRectanglesI(ptr ptr long)
@ stub GdipAddPathString
@ stub GdipAddPathStringI
@ stdcall GdipAlloc(long)
...
...
dlls/gdiplus/graphicspath.c
View file @
d4ae6fa1
...
...
@@ -758,3 +758,65 @@ GpStatus WINGDIPAPI GdipAddPathRectangleI(GpPath *path, INT x, INT y,
{
return
GdipAddPathRectangle
(
path
,(
REAL
)
x
,(
REAL
)
y
,(
REAL
)
width
,(
REAL
)
height
);
}
GpStatus
WINGDIPAPI
GdipAddPathRectangles
(
GpPath
*
path
,
GDIPCONST
GpRectF
*
rects
,
INT
count
)
{
GpPath
*
backup
;
GpStatus
retstat
;
INT
i
;
/* count == 0 - verified condition */
if
(
!
path
||
!
rects
||
count
==
0
)
return
InvalidParameter
;
if
(
count
<
0
)
return
OutOfMemory
;
/* make a backup copy */
if
((
retstat
=
GdipClonePath
(
path
,
&
backup
))
!=
Ok
)
return
retstat
;
for
(
i
=
0
;
i
<
count
;
i
++
){
if
((
retstat
=
GdipAddPathRectangle
(
path
,
rects
[
i
].
X
,
rects
[
i
].
Y
,
rects
[
i
].
Width
,
rects
[
i
].
Height
))
!=
Ok
)
goto
fail
;
}
/* free backup */
GdipDeletePath
(
backup
);
return
Ok
;
fail:
/* reverting */
GdipDeletePath
(
path
);
GdipClonePath
(
backup
,
&
path
);
GdipDeletePath
(
backup
);
return
retstat
;
}
GpStatus
WINGDIPAPI
GdipAddPathRectanglesI
(
GpPath
*
path
,
GDIPCONST
GpRect
*
rects
,
INT
count
)
{
GpRectF
*
rectsF
;
GpStatus
retstat
;
INT
i
;
if
(
!
rects
||
count
==
0
)
return
InvalidParameter
;
if
(
count
<
0
)
return
OutOfMemory
;
rectsF
=
GdipAlloc
(
sizeof
(
GpRectF
)
*
count
);
for
(
i
=
0
;
i
<
count
;
i
++
){
rectsF
[
i
].
X
=
(
REAL
)
rects
[
i
].
X
;
rectsF
[
i
].
Y
=
(
REAL
)
rects
[
i
].
Y
;
rectsF
[
i
].
Width
=
(
REAL
)
rects
[
i
].
Width
;
rectsF
[
i
].
Height
=
(
REAL
)
rects
[
i
].
Height
;
}
retstat
=
GdipAddPathRectangles
(
path
,
rectsF
,
count
);
GdipFree
(
rectsF
);
return
retstat
;
}
dlls/gdiplus/tests/graphicspath.c
View file @
d4ae6fa1
...
...
@@ -561,6 +561,7 @@ static void test_rect(void)
{
GpStatus
status
;
GpPath
*
path
;
GpRectF
rects
[
2
];
GdipCreatePath
(
FillModeAlternate
,
&
path
);
status
=
GdipAddPathRectangle
(
path
,
5
.
0
,
5
.
0
,
100
.
0
,
50
.
0
);
...
...
@@ -571,6 +572,24 @@ static void test_rect(void)
ok_path
(
path
,
rect_path
,
sizeof
(
rect_path
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
GdipCreatePath
(
FillModeAlternate
,
&
path
);
rects
[
0
].
X
=
5
.
0
;
rects
[
0
].
Y
=
5
.
0
;
rects
[
0
].
Width
=
100
.
0
;
rects
[
0
].
Height
=
50
.
0
;
rects
[
1
].
X
=
100
.
0
;
rects
[
1
].
Y
=
50
.
0
;
rects
[
1
].
Width
=
120
.
0
;
rects
[
1
].
Height
=
30
.
0
;
status
=
GdipAddPathRectangles
(
path
,
(
GDIPCONST
GpRectF
*
)
&
rects
,
2
);
expect
(
Ok
,
status
);
ok_path
(
path
,
rect_path
,
sizeof
(
rect_path
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
}
START_TEST
(
graphicspath
)
...
...
include/gdiplusflat.h
View file @
d4ae6fa1
...
...
@@ -215,6 +215,8 @@ 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
GdipAddPathRectangles
(
GpPath
*
,
GDIPCONST
GpRectF
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathRectanglesI
(
GpPath
*
,
GDIPCONST
GpRect
*
,
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