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
0a9937c5
Commit
0a9937c5
authored
Jul 05, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: GdipPathIterNextMarker implementation with tests.
parent
ebded163
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
1 deletion
+84
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
pathiterator.c
dlls/gdiplus/pathiterator.c
+25
-0
pathiterator.c
dlls/gdiplus/tests/pathiterator.c
+57
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
0a9937c5
...
...
@@ -456,7 +456,7 @@
@ stub GdipPathIterGetSubpathCount
@ stdcall GdipPathIterHasCurve(ptr ptr)
@ stub GdipPathIterIsValid
@ st
ub GdipPathIterNextMarker
@ st
dcall GdipPathIterNextMarker(ptr ptr ptr ptr)
@ stub GdipPathIterNextMarkerPath
@ stub GdipPathIterNextPathType
@ stdcall GdipPathIterNextSubpath(ptr ptr ptr ptr ptr)
...
...
dlls/gdiplus/pathiterator.c
View file @
0a9937c5
...
...
@@ -105,6 +105,31 @@ GpStatus WINGDIPAPI GdipPathIterHasCurve(GpPathIterator* iterator, BOOL* hasCurv
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipPathIterNextMarker
(
GpPathIterator
*
iterator
,
INT
*
resultCount
,
INT
*
startIndex
,
INT
*
endIndex
)
{
INT
i
;
if
(
!
iterator
||
!
startIndex
||
!
endIndex
)
return
InvalidParameter
;
*
resultCount
=
0
;
/* first call could start with second point as all subsequent, cause
path couldn't contain only one */
for
(
i
=
iterator
->
marker_pos
+
1
;
i
<
iterator
->
pathdata
.
Count
;
i
++
){
if
(
iterator
->
pathdata
.
Types
[
i
]
&
PathPointTypePathMarker
){
*
startIndex
=
iterator
->
marker_pos
;
if
(
iterator
->
marker_pos
>
0
)
(
*
startIndex
)
++
;
*
endIndex
=
iterator
->
marker_pos
=
i
;
*
resultCount
=
*
endIndex
-
*
startIndex
+
1
;
break
;
}
}
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipPathIterNextSubpath
(
GpPathIterator
*
iterator
,
INT
*
resultCount
,
INT
*
startIndex
,
INT
*
endIndex
,
BOOL
*
isClosed
)
{
...
...
dlls/gdiplus/tests/pathiterator.c
View file @
0a9937c5
...
...
@@ -90,6 +90,62 @@ static void test_hascurve(void)
GdipDeletePath
(
path
);
}
static
void
test_nextmarker
(
void
)
{
GpPath
*
path
;
GpPathIterator
*
iter
;
GpStatus
stat
;
INT
start
,
end
,
result
;
/* NULL args
BOOL out argument is local in wrapper class method,
so it always has not-NULL address */
stat
=
GdipPathIterNextMarker
(
NULL
,
&
result
,
NULL
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipPathIterNextMarker
(
NULL
,
&
result
,
&
start
,
NULL
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipPathIterNextMarker
(
NULL
,
&
result
,
NULL
,
&
end
);
expect
(
InvalidParameter
,
stat
);
GdipCreatePath
(
FillModeAlternate
,
&
path
);
GdipAddPathRectangle
(
path
,
5
.
0
,
5
.
0
,
100
.
0
,
50
.
0
);
/* no markers */
GdipCreatePathIter
(
&
iter
,
path
);
stat
=
GdipPathIterNextMarker
(
iter
,
&
result
,
&
start
,
&
end
);
expect
(
Ok
,
stat
);
expect
(
0
,
result
);
GdipDeletePathIter
(
iter
);
/* one marker */
GdipSetPathMarker
(
path
);
GdipCreatePathIter
(
&
iter
,
path
);
stat
=
GdipPathIterNextMarker
(
iter
,
&
result
,
&
start
,
&
end
);
expect
(
Ok
,
stat
);
expect
(
TRUE
,
(
start
==
0
)
&&
(
end
==
3
)
&&
(
result
==
4
));
stat
=
GdipPathIterNextMarker
(
iter
,
&
result
,
&
start
,
&
end
);
expect
(
Ok
,
stat
);
expect
(
0
,
result
);
GdipDeletePathIter
(
iter
);
/* two markers */
GdipAddPathLine
(
path
,
0
.
0
,
0
.
0
,
10
.
0
,
30
.
0
);
GdipSetPathMarker
(
path
);
GdipCreatePathIter
(
&
iter
,
path
);
stat
=
GdipPathIterNextMarker
(
iter
,
&
result
,
&
start
,
&
end
);
expect
(
Ok
,
stat
);
expect
(
TRUE
,
(
start
==
0
)
&&
(
end
==
3
)
&&
(
result
==
4
));
stat
=
GdipPathIterNextMarker
(
iter
,
&
result
,
&
start
,
&
end
);
expect
(
Ok
,
stat
);
expect
(
TRUE
,
(
start
==
4
)
&&
(
end
==
5
)
&&
(
result
==
2
));
stat
=
GdipPathIterNextMarker
(
iter
,
&
result
,
&
start
,
&
end
);
expect
(
Ok
,
stat
);
expect
(
0
,
result
);
GdipDeletePathIter
(
iter
);
GdipDeletePath
(
path
);
}
START_TEST
(
pathiterator
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -104,6 +160,7 @@ START_TEST(pathiterator)
test_constructor_destructor
();
test_hascurve
();
test_nextmarker
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
0a9937c5
...
...
@@ -281,6 +281,7 @@ GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator**,GpPath*);
GpStatus
WINGDIPAPI
GdipDeletePathIter
(
GpPathIterator
*
);
GpStatus
WINGDIPAPI
GdipPathIterCopyData
(
GpPathIterator
*
,
INT
*
,
GpPointF
*
,
BYTE
*
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipPathIterNextMarker
(
GpPathIterator
*
,
INT
*
,
INT
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipPathIterNextSubpath
(
GpPathIterator
*
,
INT
*
,
INT
*
,
INT
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipPathIterRewind
(
GpPathIterator
*
);
GpStatus
WINGDIPAPI
GdipPathIterGetCount
(
GpPathIterator
*
,
INT
*
);
...
...
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