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
32996e0a
Commit
32996e0a
authored
Aug 25, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipIsVisibleRegionPoint.
parent
227cbdea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
246 additions
and
10 deletions
+246
-10
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
graphics.c
dlls/gdiplus/graphics.c
+0
-9
region.c
dlls/gdiplus/region.c
+39
-0
region.c
dlls/gdiplus/tests/region.c
+204
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
32996e0a
...
...
@@ -431,7 +431,7 @@
@ stdcall GdipIsVisiblePointI(ptr long long ptr)
@ stub GdipIsVisibleRect
@ stdcall GdipIsVisibleRectI(ptr long long long long ptr)
@ st
ub GdipIsVisibleRegionPoint
@ st
dcall GdipIsVisibleRegionPoint(ptr long long ptr ptr)
@ stdcall GdipIsVisibleRegionPointI(ptr long long ptr ptr)
@ stub GdipIsVisibleRegionRect
@ stub GdipIsVisibleRegionRectI
...
...
dlls/gdiplus/graphics.c
View file @
32996e0a
...
...
@@ -4151,15 +4151,6 @@ GpStatus WINGDIPAPI GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT16
}
/*****************************************************************************
* GdipIsVisibleRegionPointI [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipIsVisibleRegionPointI
(
GpRegion
*
region
,
INT
x
,
INT
y
,
GpGraphics
*
graphics
,
BOOL
*
result
)
{
FIXME
(
"(%p %d %d %p %p): stub
\n
"
,
region
,
x
,
y
,
graphics
,
result
);
return
NotImplemented
;
}
/*****************************************************************************
* GdipRecordMetafileI [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipRecordMetafileI
(
HDC
hdc
,
EmfType
type
,
GDIPCONST
GpRect
*
frameRect
,
...
...
dlls/gdiplus/region.c
View file @
32996e0a
...
...
@@ -1128,6 +1128,45 @@ GpStatus WINGDIPAPI GdipIsInfiniteRegion(GpRegion *region, GpGraphics *graphics,
}
/*****************************************************************************
* GdipIsVisibleRegionPoint [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipIsVisibleRegionPoint
(
GpRegion
*
region
,
REAL
x
,
REAL
y
,
GpGraphics
*
graphics
,
BOOL
*
res
)
{
HRGN
hrgn
;
GpStatus
stat
;
TRACE
(
"(%p, %.2f, %.2f, %p, %p)
\n
"
,
region
,
x
,
y
,
graphics
,
res
);
if
(
!
region
||
!
res
)
return
InvalidParameter
;
if
((
stat
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
))
!=
Ok
)
return
stat
;
/* infinite */
if
(
!
hrgn
){
*
res
=
TRUE
;
return
Ok
;
}
*
res
=
PtInRegion
(
hrgn
,
roundr
(
x
),
roundr
(
y
));
DeleteObject
(
hrgn
);
return
Ok
;
}
/*****************************************************************************
* GdipIsVisibleRegionPointI [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipIsVisibleRegionPointI
(
GpRegion
*
region
,
INT
x
,
INT
y
,
GpGraphics
*
graphics
,
BOOL
*
res
)
{
TRACE
(
"(%p, %d, %d, %p, %p)
\n
"
,
region
,
x
,
y
,
graphics
,
res
);
return
GdipIsVisibleRegionPoint
(
region
,
(
REAL
)
x
,
(
REAL
)
y
,
graphics
,
res
);
}
/*****************************************************************************
* GdipSetEmpty [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipSetEmpty
(
GpRegion
*
region
)
...
...
dlls/gdiplus/tests/region.c
View file @
32996e0a
...
...
@@ -1204,6 +1204,209 @@ static void test_getbounds(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_isvisiblepoint
(
void
)
{
HDC
hdc
=
GetDC
(
0
);
GpGraphics
*
graphics
;
GpRegion
*
region
;
GpPath
*
path
;
GpRectF
rectf
;
GpStatus
status
;
BOOL
res
;
REAL
x
,
y
;
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipCreateRegion
(
&
region
);
expect
(
Ok
,
status
);
/* null parameters */
status
=
GdipIsVisibleRegionPoint
(
NULL
,
0
,
0
,
graphics
,
&
res
);
expect
(
InvalidParameter
,
status
);
status
=
GdipIsVisibleRegionPointI
(
NULL
,
0
,
0
,
graphics
,
&
res
);
expect
(
InvalidParameter
,
status
);
status
=
GdipIsVisibleRegionPoint
(
region
,
0
,
0
,
NULL
,
&
res
);
expect
(
Ok
,
status
);
status
=
GdipIsVisibleRegionPointI
(
region
,
0
,
0
,
NULL
,
&
res
);
expect
(
Ok
,
status
);
status
=
GdipIsVisibleRegionPoint
(
region
,
0
,
0
,
graphics
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipIsVisibleRegionPointI
(
region
,
0
,
0
,
graphics
,
NULL
);
expect
(
InvalidParameter
,
status
);
/* infinite region */
status
=
GdipIsInfiniteRegion
(
region
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Region should be infinite
\n
"
);
x
=
10
;
y
=
10
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%d, %d) to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
-
10
;
y
=
-
10
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%d, %d) to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
/* rectangular region */
rectf
.
X
=
10
;
rectf
.
Y
=
20
;
rectf
.
Width
=
30
;
rectf
.
Height
=
40
;
status
=
GdipCombineRegionRect
(
region
,
&
rectf
,
CombineModeReplace
);
expect
(
Ok
,
status
);
x
=
0
;
y
=
0
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) not to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%d, %d) not to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
9
;
y
=
19
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
x
=
9
.
25
;
y
=
19
.
25
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
x
=
9
.
5
;
y
=
19
.
5
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
x
=
9
.
75
;
y
=
19
.
75
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
x
=
10
;
y
=
20
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
x
=
25
;
y
=
40
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%d, %d) to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
40
;
y
=
60
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) not to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%d, %d) not to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
/* translate into the center of the rectangle */
status
=
GdipTranslateWorldTransform
(
graphics
,
25
,
40
,
MatrixOrderAppend
);
expect
(
Ok
,
status
);
/* native ignores the world transform, so treat these as if
* no transform exists */
x
=
-
20
;
y
=
-
30
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) not to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%d, %d) not to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
0
;
y
=
0
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) not to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%d, %d) not to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
25
;
y
=
40
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%d, %d) to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
/* translate back to origin */
status
=
GdipTranslateWorldTransform
(
graphics
,
-
25
,
-
40
,
MatrixOrderAppend
);
expect
(
Ok
,
status
);
/* region from path */
status
=
GdipCreatePath
(
FillModeAlternate
,
&
path
);
expect
(
Ok
,
status
);
status
=
GdipAddPathEllipse
(
path
,
10
,
20
,
30
,
40
);
expect
(
Ok
,
status
);
status
=
GdipCombineRegionPath
(
region
,
path
,
CombineModeReplace
);
expect
(
Ok
,
status
);
x
=
11
;
y
=
21
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) not to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%d, %d) not to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
25
;
y
=
40
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%.2f, %.2f) to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
TRUE
,
"Expected (%d, %d) to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
x
=
40
;
y
=
60
;
status
=
GdipIsVisibleRegionPoint
(
region
,
x
,
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%.2f, %.2f) not to be visible
\n
"
,
x
,
y
);
status
=
GdipIsVisibleRegionPointI
(
region
,
(
INT
)
x
,
(
INT
)
y
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
ok
(
res
==
FALSE
,
"Expected (%d, %d) not to be visible
\n
"
,
(
INT
)
x
,
(
INT
)
y
);
GdipDeletePath
(
path
);
GdipDeleteRegion
(
region
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
0
,
hdc
);
}
START_TEST
(
region
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -1225,6 +1428,7 @@ START_TEST(region)
test_isequal
();
test_translate
();
test_getbounds
();
test_isvisiblepoint
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
32996e0a
...
...
@@ -565,6 +565,8 @@ GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *, GpGraphics *, HRGN *);
GpStatus
WINGDIPAPI
GdipIsEmptyRegion
(
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsEqualRegion
(
GpRegion
*
,
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsInfiniteRegion
(
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsVisibleRegionPoint
(
GpRegion
*
,
REAL
,
REAL
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsVisibleRegionPointI
(
GpRegion
*
,
INT
,
INT
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipSetEmpty
(
GpRegion
*
);
GpStatus
WINGDIPAPI
GdipSetInfinite
(
GpRegion
*
);
GpStatus
WINGDIPAPI
GdipTransformRegion
(
GpRegion
*
,
GpMatrix
*
);
...
...
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