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
dc3908a3
Commit
dc3908a3
authored
Jan 30, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipGetRegionBounds/GdipGetRegionBoundsI.
parent
cb8f4eb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
4 deletions
+114
-4
region.c
dlls/gdiplus/region.c
+52
-4
region.c
dlls/gdiplus/tests/region.c
+62
-0
No files found.
dlls/gdiplus/region.c
View file @
dc3908a3
...
...
@@ -634,18 +634,66 @@ GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
return
Ok
;
}
/*****************************************************************************
* GdipGetRegionBounds [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipGetRegionBounds
(
GpRegion
*
region
,
GpGraphics
*
graphics
,
GpRectF
*
rect
)
{
FIXME
(
"(%p, %p, %p): stub
\n
"
,
region
,
graphics
,
rect
);
HRGN
hrgn
;
RECT
r
;
GpStatus
status
;
return
NotImplemented
;
TRACE
(
"(%p, %p, %p)
\n
"
,
region
,
graphics
,
rect
);
if
(
!
region
||
!
graphics
||
!
rect
)
return
InvalidParameter
;
status
=
GdipGetRegionHRgn
(
region
,
graphics
,
&
hrgn
);
if
(
status
!=
Ok
)
return
status
;
/* infinite */
if
(
!
hrgn
){
rect
->
X
=
rect
->
Y
=
-
(
REAL
)(
1
<<
22
);
rect
->
Width
=
rect
->
Height
=
(
REAL
)(
1
<<
23
);
return
Ok
;
}
if
(
!
GetRgnBox
(
hrgn
,
&
r
)){
DeleteObject
(
hrgn
);
return
GenericError
;
}
rect
->
X
=
r
.
left
;
rect
->
Y
=
r
.
top
;
rect
->
Width
=
r
.
right
-
r
.
left
;
rect
->
Height
=
r
.
bottom
-
r
.
top
;
return
Ok
;
}
/*****************************************************************************
* GdipGetRegionBoundsI [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipGetRegionBoundsI
(
GpRegion
*
region
,
GpGraphics
*
graphics
,
GpRect
*
rect
)
{
FIXME
(
"(%p, %p, %p): stub
\n
"
,
region
,
graphics
,
rect
);
GpRectF
rectf
;
GpStatus
status
;
return
NotImplemented
;
TRACE
(
"(%p, %p, %p)
\n
"
,
region
,
graphics
,
rect
);
if
(
!
rect
)
return
InvalidParameter
;
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
rectf
);
if
(
status
==
Ok
){
rect
->
X
=
roundr
(
rectf
.
X
);
rect
->
Y
=
roundr
(
rectf
.
X
);
rect
->
Width
=
roundr
(
rectf
.
Width
);
rect
->
Height
=
roundr
(
rectf
.
Height
);
}
return
status
;
}
static
inline
void
write_dword
(
DWORD
*
location
,
INT
*
offset
,
const
DWORD
write
)
...
...
dlls/gdiplus/tests/region.c
View file @
dc3908a3
...
...
@@ -1120,6 +1120,67 @@ static void test_translate(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_getbounds
(
void
)
{
GpRegion
*
region
;
GpGraphics
*
graphics
;
GpStatus
status
;
GpRectF
rectf
;
HDC
hdc
=
GetDC
(
0
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipCreateRegion
(
&
region
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
/* NULL */
status
=
GdipGetRegionBounds
(
NULL
,
NULL
,
NULL
);
ok
(
status
==
InvalidParameter
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionBounds
(
region
,
NULL
,
NULL
);
ok
(
status
==
InvalidParameter
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
NULL
);
ok
(
status
==
InvalidParameter
,
"status %08x
\n
"
,
status
);
/* infinite */
rectf
.
X
=
rectf
.
Y
=
0
.
0
;
rectf
.
Height
=
rectf
.
Width
=
100
.
0
;
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
rectf
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
ok
(
rectf
.
X
==
-
(
REAL
)(
1
<<
22
),
"Expected X = %.2f, got %.2f
\n
"
,
-
(
REAL
)(
1
<<
22
),
rectf
.
X
);
ok
(
rectf
.
Y
==
-
(
REAL
)(
1
<<
22
),
"Expected Y = %.2f, got %.2f
\n
"
,
-
(
REAL
)(
1
<<
22
),
rectf
.
Y
);
ok
(
rectf
.
Width
==
(
REAL
)(
1
<<
23
),
"Expected width = %.2f, got %.2f
\n
"
,
(
REAL
)(
1
<<
23
),
rectf
.
Width
);
ok
(
rectf
.
Height
==
(
REAL
)(
1
<<
23
),
"Expected height = %.2f, got %.2f
\n
"
,(
REAL
)(
1
<<
23
),
rectf
.
Height
);
/* empty */
rectf
.
X
=
rectf
.
Y
=
0
.
0
;
rectf
.
Height
=
rectf
.
Width
=
100
.
0
;
status
=
GdipSetEmpty
(
region
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
rectf
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
ok
(
rectf
.
X
==
0
.
0
,
"Expected X = 0.0, got %.2f
\n
"
,
rectf
.
X
);
ok
(
rectf
.
Y
==
0
.
0
,
"Expected Y = 0.0, got %.2f
\n
"
,
rectf
.
Y
);
ok
(
rectf
.
Width
==
0
.
0
,
"Expected width = 0.0, got %.2f
\n
"
,
rectf
.
Width
);
ok
(
rectf
.
Height
==
0
.
0
,
"Expected height = 0.0, got %.2f
\n
"
,
rectf
.
Height
);
/* rect */
rectf
.
X
=
10
.
0
;
rectf
.
Y
=
0
.
0
;
rectf
.
Width
=
rectf
.
Height
=
100
.
0
;
status
=
GdipCombineRegionRect
(
region
,
&
rectf
,
CombineModeReplace
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
rectf
.
X
=
rectf
.
Y
=
0
.
0
;
rectf
.
Height
=
rectf
.
Width
=
0
.
0
;
status
=
GdipGetRegionBounds
(
region
,
graphics
,
&
rectf
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
ok
(
rectf
.
X
==
10
.
0
,
"Expected X = 0.0, got %.2f
\n
"
,
rectf
.
X
);
ok
(
rectf
.
Y
==
0
.
0
,
"Expected Y = 0.0, got %.2f
\n
"
,
rectf
.
Y
);
ok
(
rectf
.
Width
==
100
.
0
,
"Expected width = 0.0, got %.2f
\n
"
,
rectf
.
Width
);
ok
(
rectf
.
Height
==
100
.
0
,
"Expected height = 0.0, got %.2f
\n
"
,
rectf
.
Height
);
status
=
GdipDeleteRegion
(
region
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipDeleteGraphics
(
graphics
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
region
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -1140,6 +1201,7 @@ START_TEST(region)
test_gethrgn
();
test_isequal
();
test_translate
();
test_getbounds
();
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