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
67f95703
Commit
67f95703
authored
Jan 30, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipCreateRegionHrgn for rectangular regions.
parent
bbf48355
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
16 deletions
+84
-16
region.c
dlls/gdiplus/region.c
+47
-4
region.c
dlls/gdiplus/tests/region.c
+37
-12
No files found.
dlls/gdiplus/region.c
View file @
67f95703
...
...
@@ -567,15 +567,58 @@ GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRe
return
NotImplemented
;
}
/******************************************************************************
* GdipCreateRegionHrgn [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipCreateRegionHrgn
(
HRGN
hrgn
,
GpRegion
**
region
)
{
FIXME
(
"(%p, %p): stub
\n
"
,
hrgn
,
region
);
union
{
RGNDATA
data
;
char
buf
[
sizeof
(
RGNDATAHEADER
)
+
sizeof
(
RECT
)];
}
rdata
;
DWORD
size
;
GpRectF
rectf
;
GpPath
*
path
;
GpStatus
stat
;
TRACE
(
"(%p, %p)
\n
"
,
hrgn
,
region
);
if
(
!
hrgn
||
!
region
)
if
(
!
region
||
!
(
size
=
GetRegionData
(
hrgn
,
0
,
NULL
))
)
return
InvalidParameter
;
*
region
=
NULL
;
return
NotImplemented
;
if
(
size
>
sizeof
(
RGNDATAHEADER
)
+
sizeof
(
RECT
)){
FIXME
(
"Only simple rect regions supported.
\n
"
);
*
region
=
NULL
;
return
NotImplemented
;
}
if
(
!
GetRegionData
(
hrgn
,
sizeof
(
rdata
),
&
rdata
.
data
))
return
GenericError
;
/* return empty region */
if
(
IsRectEmpty
(
&
rdata
.
data
.
rdh
.
rcBound
)){
stat
=
GdipCreateRegion
(
region
);
if
(
stat
==
Ok
)
GdipSetEmpty
(
*
region
);
return
stat
;
}
rectf
.
X
=
(
REAL
)
rdata
.
data
.
rdh
.
rcBound
.
left
;
rectf
.
Y
=
(
REAL
)
rdata
.
data
.
rdh
.
rcBound
.
top
;
rectf
.
Width
=
(
REAL
)
rdata
.
data
.
rdh
.
rcBound
.
right
-
rectf
.
X
;
rectf
.
Height
=
(
REAL
)
rdata
.
data
.
rdh
.
rcBound
.
bottom
-
rectf
.
Y
;
stat
=
GdipCreatePath
(
FillModeAlternate
,
&
path
);
if
(
stat
!=
Ok
)
return
stat
;
GdipAddPathRectangle
(
path
,
rectf
.
X
,
rectf
.
Y
,
rectf
.
Width
,
rectf
.
Height
);
stat
=
GdipCreateRegionPath
(
path
,
region
);
GdipDeletePath
(
path
);
return
stat
;
}
GpStatus
WINGDIPAPI
GdipDeleteRegion
(
GpRegion
*
region
)
...
...
dlls/gdiplus/tests/region.c
View file @
67f95703
...
...
@@ -709,6 +709,9 @@ static void test_fromhrgn(void)
UINT
needed
;
DWORD
buf
[
220
];
RegionDataPoint
*
point
;
GpGraphics
*
graphics
=
NULL
;
HDC
hdc
;
BOOL
res
;
/* NULL */
status
=
GdipCreateRegionHrgn
(
NULL
,
NULL
);
...
...
@@ -716,24 +719,42 @@ static void test_fromhrgn(void)
status
=
GdipCreateRegionHrgn
(
NULL
,
&
region
);
expect
(
InvalidParameter
,
status
);
status
=
GdipCreateRegionHrgn
((
HRGN
)
0xdeadbeef
,
&
region
);
todo_wine
expect
(
InvalidParameter
,
status
);
expect
(
InvalidParameter
,
status
);
/* empty rectangle */
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
status
=
GdipCreateRegionHrgn
(
hrgn
,
&
region
);
expect
(
Ok
,
status
);
if
(
status
==
Ok
)
{
hdc
=
GetDC
(
0
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
res
=
FALSE
;
status
=
GdipIsEmptyRegion
(
region
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
expect
(
TRUE
,
res
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
0
,
hdc
);
GdipDeleteRegion
(
region
);
}
DeleteObject
(
hrgn
);
/* rectangle */
hrgn
=
CreateRectRgn
(
0
,
0
,
100
,
10
);
status
=
GdipCreateRegionHrgn
(
hrgn
,
&
region
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
status
=
GdipGetRegionDataSize
(
region
,
&
needed
);
todo_wine
{
expect
(
Ok
,
status
);
expect
(
56
,
needed
);
}
status
=
GdipGetRegionData
(
region
,
(
BYTE
*
)
buf
,
sizeof
(
buf
),
&
needed
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
if
(
status
==
Ok
){
todo_wine
{
expect
(
56
,
needed
);
expect_dword
(
buf
,
48
);
expect_magic
((
DWORD
*
)(
buf
+
2
));
...
...
@@ -742,25 +763,23 @@ todo_wine{
expect_dword
(
buf
+
5
,
0x00000020
);
expect_magic
((
DWORD
*
)(
buf
+
6
));
expect_dword
(
buf
+
7
,
0x00000004
);
expect_dword
(
buf
+
8
,
0x00006000
);
/* ?? */
}
todo_wine
expect_dword
(
buf
+
8
,
0x00006000
);
/* ?? */
point
=
(
RegionDataPoint
*
)
buf
+
9
;
expect
(
0
,
point
[
0
].
X
);
expect
(
0
,
point
[
0
].
Y
);
todo_wine
{
expect
(
100
,
point
[
1
].
X
);
/* buf + 10 */
expect
(
0
,
point
[
1
].
Y
);
expect
(
100
,
point
[
2
].
X
);
/* buf + 11 */
expect
(
10
,
point
[
2
].
Y
);
}
expect
(
0
,
point
[
3
].
X
);
/* buf + 12 */
todo_wine
{
expect
(
10
,
point
[
3
].
Y
);
expect_dword
(
buf
+
13
,
0x81010100
);
/* closed */
}
}
GdipDeleteRegion
(
region
);
...
...
@@ -777,6 +796,10 @@ todo_wine{
expect
(
216
,
needed
);
}
status
=
GdipGetRegionData
(
region
,
(
BYTE
*
)
buf
,
sizeof
(
buf
),
&
needed
);
todo_wine
expect
(
Ok
,
status
);
if
(
status
==
Ok
)
{
todo_wine
{
expect
(
Ok
,
status
);
expect
(
216
,
needed
);
...
...
@@ -789,6 +812,8 @@ todo_wine{
expect_dword
(
buf
+
7
,
0x00000024
);
expect_dword
(
buf
+
8
,
0x00006000
);
/* ?? */
}
}
GdipDeleteRegion
(
region
);
DeleteObject
(
hrgn
);
}
...
...
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