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
6e7b5347
Commit
6e7b5347
authored
Feb 29, 2008
by
Royal Chan
Committed by
Alexandre Julliard
Feb 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipDrawLinesI based on GdipDrawLines.
parent
a78727d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
1 deletion
+83
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
graphics.c
dlls/gdiplus/graphics.c
+29
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+53
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
6e7b5347
...
...
@@ -188,7 +188,7 @@
@ stdcall GdipDrawLine(ptr ptr long long long long)
@ stdcall GdipDrawLineI(ptr ptr long long long long)
@ stdcall GdipDrawLines(ptr ptr ptr long)
@ st
ub GdipDrawLinesI
@ st
dcall GdipDrawLinesI(ptr ptr ptr long)
@ stdcall GdipDrawPath(ptr ptr ptr)
@ stdcall GdipDrawPie(ptr ptr long long long long long long)
@ stub GdipDrawPieI
...
...
dlls/gdiplus/graphics.c
View file @
6e7b5347
...
...
@@ -1224,6 +1224,35 @@ GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST
return
retval
;
}
GpStatus
WINGDIPAPI
GdipDrawLinesI
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GDIPCONST
GpPoint
*
points
,
INT
count
)
{
INT
save_state
;
GpStatus
retval
;
GpPointF
*
ptf
=
NULL
;
int
i
;
if
(
!
pen
||
!
graphics
||
(
count
<
2
))
return
InvalidParameter
;
ptf
=
GdipAlloc
(
count
*
sizeof
(
GpPointF
));
if
(
!
ptf
)
return
OutOfMemory
;
for
(
i
=
0
;
i
<
count
;
i
++
){
ptf
[
i
].
X
=
(
REAL
)
points
[
i
].
X
;
ptf
[
i
].
Y
=
(
REAL
)
points
[
i
].
Y
;
}
save_state
=
prepare_dc
(
graphics
,
pen
);
retval
=
draw_polyline
(
graphics
,
pen
,
ptf
,
count
,
TRUE
);
restore_dc
(
graphics
,
save_state
);
GdipFree
(
ptf
);
return
retval
;
}
GpStatus
WINGDIPAPI
GdipDrawPath
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
GpPath
*
path
)
{
INT
save_state
;
...
...
dlls/gdiplus/tests/graphics.c
View file @
6e7b5347
...
...
@@ -384,6 +384,58 @@ static void test_GdipDrawLineI(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_GdipDrawLinesI
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpPen
*
pen
=
NULL
;
GpPoint
*
ptf
=
NULL
;
HDC
hdc
=
GetDC
(
0
);
/* make a graphics object and pen object */
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
hdc
!=
NULL
,
"Expected HDC to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ok
(
graphics
!=
NULL
,
"Expected graphics to be initialized
\n
"
);
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
ok
(
pen
!=
NULL
,
"Expected pen to be initialized
\n
"
);
/* make some arbitrary valid points*/
ptf
=
GdipAlloc
(
2
*
sizeof
(
GpPointF
));
ptf
[
0
].
X
=
1
;
ptf
[
0
].
Y
=
1
;
ptf
[
1
].
X
=
2
;
ptf
[
1
].
Y
=
2
;
/* InvalidParameter cases: null graphics, null pen, null points, count < 2*/
status
=
GdipDrawLinesI
(
NULL
,
NULL
,
NULL
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawLinesI
(
graphics
,
pen
,
ptf
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawLinesI
(
graphics
,
NULL
,
ptf
,
2
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawLinesI
(
NULL
,
pen
,
ptf
,
2
);
expect
(
InvalidParameter
,
status
);
/* successful case */
status
=
GdipDrawLinesI
(
graphics
,
pen
,
ptf
,
2
);
expect
(
Ok
,
status
);
GdipFree
(
ptf
);
GdipDeletePen
(
pen
);
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
graphics
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -402,6 +454,7 @@ START_TEST(graphics)
test_GdipDrawArc
();
test_GdipDrawArcI
();
test_GdipDrawLineI
();
test_GdipDrawLinesI
();
GdiplusShutdown
(
gdiplusToken
);
}
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