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
e9bcce6e
Commit
e9bcce6e
authored
Aug 01, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipGetPenCustom[Start/End]Cap.
parent
4ff6ba0a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
4 deletions
+86
-4
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
pen.c
dlls/gdiplus/pen.c
+32
-2
pen.c
dlls/gdiplus/tests/pen.c
+50
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
e9bcce6e
...
...
@@ -352,8 +352,8 @@
@ stdcall GdipGetPenColor(ptr ptr)
@ stub GdipGetPenCompoundArray
@ stub GdipGetPenCompoundCount
@ st
ub GdipGetPenCustomEndCap
@ st
ub GdipGetPenCustomStartCap
@ st
dcall GdipGetPenCustomEndCap(ptr ptr)
@ st
dcall GdipGetPenCustomStartCap(ptr ptr)
@ stdcall GdipGetPenDashArray(ptr ptr long)
@ stdcall GdipGetPenDashCap197819(ptr ptr)
@ stdcall GdipGetPenDashCount(ptr ptr)
...
...
dlls/gdiplus/pen.c
View file @
e9bcce6e
...
...
@@ -116,6 +116,8 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
gp_pen
->
miterlimit
=
10
.
0
;
gp_pen
->
dash
=
DashStyleSolid
;
gp_pen
->
offset
=
0
.
0
;
gp_pen
->
customstart
=
NULL
;
gp_pen
->
customend
=
NULL
;
if
(
!
((
gp_pen
->
unit
==
UnitWorld
)
||
(
gp_pen
->
unit
==
UnitPixel
)))
{
FIXME
(
"UnitWorld, UnitPixel only supported units
\n
"
);
...
...
@@ -163,6 +165,32 @@ GpStatus WINGDIPAPI GdipGetPenColor(GpPen *pen, ARGB *argb)
return
GdipGetSolidFillColor
(((
GpSolidFill
*
)
pen
->
brush
),
argb
);
}
GpStatus
WINGDIPAPI
GdipGetPenCustomEndCap
(
GpPen
*
pen
,
GpCustomLineCap
**
customCap
)
{
if
(
!
pen
||
!
customCap
)
return
InvalidParameter
;
if
(
!
pen
->
customend
){
*
customCap
=
NULL
;
return
Ok
;
}
return
GdipCloneCustomLineCap
(
pen
->
customend
,
customCap
);
}
GpStatus
WINGDIPAPI
GdipGetPenCustomStartCap
(
GpPen
*
pen
,
GpCustomLineCap
**
customCap
)
{
if
(
!
pen
||
!
customCap
)
return
InvalidParameter
;
if
(
!
pen
->
customstart
){
*
customCap
=
NULL
;
return
Ok
;
}
return
GdipCloneCustomLineCap
(
pen
->
customstart
,
customCap
);
}
GpStatus
WINGDIPAPI
GdipGetPenDashArray
(
GpPen
*
pen
,
REAL
*
dash
,
INT
count
)
{
if
(
!
pen
||
!
dash
||
count
>
pen
->
numdashes
)
...
...
@@ -312,7 +340,8 @@ GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCa
GpCustomLineCap
*
cap
;
GpStatus
ret
;
if
(
!
pen
||
!
customCap
)
return
InvalidParameter
;
/* native crashes on pen == NULL, customCap != NULL */
if
(
!
customCap
)
return
InvalidParameter
;
if
((
ret
=
GdipCloneCustomLineCap
(
customCap
,
&
cap
))
==
Ok
){
GdipDeleteCustomLineCap
(
pen
->
customend
);
...
...
@@ -328,7 +357,8 @@ GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* custom
GpCustomLineCap
*
cap
;
GpStatus
ret
;
if
(
!
pen
||
!
customCap
)
return
InvalidParameter
;
/* native crashes on pen == NULL, customCap != NULL */
if
(
!
customCap
)
return
InvalidParameter
;
if
((
ret
=
GdipCloneCustomLineCap
(
customCap
,
&
cap
))
==
Ok
){
GdipDeleteCustomLineCap
(
pen
->
customstart
);
...
...
dlls/gdiplus/tests/pen.c
View file @
e9bcce6e
...
...
@@ -226,6 +226,55 @@ static void test_dasharray(void)
GdipDeletePen
(
pen
);
}
static
void
test_customcap
(
void
)
{
GpPen
*
pen
;
GpStatus
status
;
GpCustomLineCap
*
custom
;
status
=
GdipCreatePen1
((
ARGB
)
0xffff00ff
,
10
.
0
f
,
UnitPixel
,
&
pen
);
expect
(
Ok
,
status
);
/* NULL args */
status
=
GdipGetPenCustomStartCap
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPenCustomStartCap
(
pen
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPenCustomStartCap
(
NULL
,
&
custom
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPenCustomEndCap
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPenCustomEndCap
(
pen
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPenCustomEndCap
(
NULL
,
&
custom
);
expect
(
InvalidParameter
,
status
);
/* native crashes on pen == NULL, custom != NULL */
status
=
GdipSetPenCustomStartCap
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCustomStartCap
(
pen
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCustomEndCap
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPenCustomEndCap
(
pen
,
NULL
);
expect
(
InvalidParameter
,
status
);
/* get without setting previously */
custom
=
(
GpCustomLineCap
*
)
0xdeadbeef
;
status
=
GdipGetPenCustomEndCap
(
pen
,
&
custom
);
expect
(
Ok
,
status
);
ok
(
custom
==
NULL
,
"Expect CustomCap == NULL
\n
"
);
custom
=
(
GpCustomLineCap
*
)
0xdeadbeef
;
status
=
GdipGetPenCustomStartCap
(
pen
,
&
custom
);
expect
(
Ok
,
status
);
ok
(
custom
==
NULL
,
"Expect CustomCap == NULL
\n
"
);
GdipDeletePen
(
pen
);
}
START_TEST
(
pen
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -244,6 +293,7 @@ START_TEST(pen)
test_constructor_destructor2
();
test_brushfill
();
test_dasharray
();
test_customcap
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
e9bcce6e
...
...
@@ -33,6 +33,8 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush*,REAL,GpUnit,GpPen**);
GpStatus
WINGDIPAPI
GdipDeletePen
(
GpPen
*
);
GpStatus
WINGDIPAPI
GdipGetPenBrushFill
(
GpPen
*
,
GpBrush
**
);
GpStatus
WINGDIPAPI
GdipGetPenColor
(
GpPen
*
,
ARGB
*
);
GpStatus
WINGDIPAPI
GdipGetPenCustomStartCap
(
GpPen
*
,
GpCustomLineCap
**
);
GpStatus
WINGDIPAPI
GdipGetPenCustomEndCap
(
GpPen
*
,
GpCustomLineCap
**
);
GpStatus
WINGDIPAPI
GdipGetPenDashArray
(
GpPen
*
,
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetPenDashCount
(
GpPen
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipGetPenDashOffset
(
GpPen
*
,
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