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
aa0df230
Commit
aa0df230
authored
Aug 04, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipAddPathPie/GdipAddPathPieI with test.
parent
5887e661
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
2 deletions
+82
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
graphicspath.c
dlls/gdiplus/graphicspath.c
+51
-0
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+27
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
aa0df230
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
@ stdcall GdipAddPathLine(ptr long long long long)
@ stdcall GdipAddPathLine(ptr long long long long)
@ stdcall GdipAddPathLineI(ptr long long long long)
@ stdcall GdipAddPathLineI(ptr long long long long)
@ stdcall GdipAddPathPath(ptr ptr long)
@ stdcall GdipAddPathPath(ptr ptr long)
@ st
ub GdipAddPathPie
@ st
dcall GdipAddPathPie(ptr long long long long long long)
@ st
ub GdipAddPathPieI
@ st
dcall GdipAddPathPieI(ptr long long long long long long)
@ stdcall GdipAddPathPolygon(ptr ptr long)
@ stdcall GdipAddPathPolygon(ptr ptr long)
@ stdcall GdipAddPathPolygonI(ptr ptr long)
@ stdcall GdipAddPathPolygonI(ptr ptr long)
@ stdcall GdipAddPathRectangle(ptr long long long long)
@ stdcall GdipAddPathRectangle(ptr long long long long)
...
...
dlls/gdiplus/graphicspath.c
View file @
aa0df230
...
@@ -546,6 +546,57 @@ GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
...
@@ -546,6 +546,57 @@ GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
return
Ok
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipAddPathPie
(
GpPath
*
path
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
REAL
startAngle
,
REAL
sweepAngle
)
{
GpPointF
*
ptf
;
GpStatus
status
;
INT
i
,
count
;
if
(
!
path
)
return
InvalidParameter
;
count
=
arc2polybezier
(
NULL
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
if
(
count
==
0
)
return
Ok
;
ptf
=
GdipAlloc
(
sizeof
(
GpPointF
)
*
count
);
if
(
!
ptf
)
return
OutOfMemory
;
arc2polybezier
(
ptf
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
status
=
GdipAddPathLine
(
path
,
(
width
-
x
)
/
2
,
(
height
-
y
)
/
2
,
ptf
[
0
].
X
,
ptf
[
0
].
Y
);
if
(
status
!=
Ok
){
GdipFree
(
ptf
);
return
status
;
}
/* one spline is already added as a line endpoint */
if
(
!
lengthen_path
(
path
,
count
-
1
)){
GdipFree
(
ptf
);
return
OutOfMemory
;
}
memcpy
(
&
(
path
->
pathdata
.
Points
[
path
->
pathdata
.
Count
]),
&
(
ptf
[
1
]),
sizeof
(
GpPointF
)
*
(
count
-
1
));
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
path
->
pathdata
.
Types
[
path
->
pathdata
.
Count
+
i
]
=
PathPointTypeBezier
;
path
->
pathdata
.
Count
+=
count
-
1
;
GdipClosePathFigure
(
path
);
GdipFree
(
ptf
);
return
status
;
}
GpStatus
WINGDIPAPI
GdipAddPathPieI
(
GpPath
*
path
,
INT
x
,
INT
y
,
INT
width
,
INT
height
,
REAL
startAngle
,
REAL
sweepAngle
)
{
return
GdipAddPathPieI
(
path
,
(
REAL
)
x
,
(
REAL
)
y
,
(
REAL
)
width
,
(
REAL
)
height
,
startAngle
,
sweepAngle
);
}
GpStatus
WINGDIPAPI
GdipAddPathPolygon
(
GpPath
*
path
,
GDIPCONST
GpPointF
*
points
,
INT
count
)
GpStatus
WINGDIPAPI
GdipAddPathPolygon
(
GpPath
*
path
,
GDIPCONST
GpPointF
*
points
,
INT
count
)
{
{
INT
old_count
;
INT
old_count
;
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
aa0df230
...
@@ -856,6 +856,32 @@ static void test_reverse(void)
...
@@ -856,6 +856,32 @@ static void test_reverse(void)
GdipDeletePath
(
path
);
GdipDeletePath
(
path
);
}
}
static
path_test_t
addpie_path
[]
=
{
{
50
.
0
,
25
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
97
.
2
,
33
.
3
,
PathPointTypeLine
,
0
,
0
},
/*1*/
{
91
.
8
,
40
.
9
,
PathPointTypeBezier
,
0
,
0
},
/*2*/
{
79
.
4
,
46
.
8
,
PathPointTypeBezier
,
0
,
0
},
/*3*/
{
63
.
9
,
49
.
0
,
PathPointTypeBezier
|
PathPointTypeCloseSubpath
,
0
,
0
}
/*4*/
};
static
void
test_addpie
(
void
)
{
GpStatus
status
;
GpPath
*
path
;
GdipCreatePath
(
FillModeAlternate
,
&
path
);
/* NULL argument */
status
=
GdipAddPathPie
(
NULL
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipAddPathPie
(
path
,
0
.
0
,
0
.
0
,
100
.
0
,
50
.
0
,
10
.
0
,
50
.
0
);
expect
(
Ok
,
status
);
ok_path
(
path
,
addpie_path
,
sizeof
(
addpie_path
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
}
START_TEST
(
graphicspath
)
START_TEST
(
graphicspath
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -882,6 +908,7 @@ START_TEST(graphicspath)
...
@@ -882,6 +908,7 @@ START_TEST(graphicspath)
test_addcurve
();
test_addcurve
();
test_addclosedcurve
();
test_addclosedcurve
();
test_reverse
();
test_reverse
();
test_addpie
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
include/gdiplusflat.h
View file @
aa0df230
...
@@ -261,6 +261,8 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
...
@@ -261,6 +261,8 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
GpStatus
WINGDIPAPI
GdipAddPathLine2I
(
GpPath
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathLine2I
(
GpPath
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathLineI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathLineI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathPath
(
GpPath
*
,
GDIPCONST
GpPath
*
,
BOOL
);
GpStatus
WINGDIPAPI
GdipAddPathPath
(
GpPath
*
,
GDIPCONST
GpPath
*
,
BOOL
);
GpStatus
WINGDIPAPI
GdipAddPathPie
(
GpPath
*
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipAddPathPieI
(
GpPath
*
,
INT
,
INT
,
INT
,
INT
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipAddPathPolygon
(
GpPath
*
,
GDIPCONST
GpPointF
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathPolygon
(
GpPath
*
,
GDIPCONST
GpPointF
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathPolygonI
(
GpPath
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathPolygonI
(
GpPath
*
,
GDIPCONST
GpPoint
*
,
INT
);
GpStatus
WINGDIPAPI
GdipAddPathRectangle
(
GpPath
*
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipAddPathRectangle
(
GpPath
*
,
REAL
,
REAL
,
REAL
,
REAL
);
...
...
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