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
edc90a9f
Commit
edc90a9f
authored
Sep 01, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added rect_in_region function.
parent
80bba3bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
region.c
server/region.c
+17
-0
user.h
server/user.h
+1
-0
No files found.
server/region.c
View file @
edc90a9f
...
...
@@ -775,3 +775,20 @@ int point_in_region( struct region *region, int x, int y )
}
return
0
;
}
/* check if the given rectangle is (at least partially) inside the region */
int
rect_in_region
(
struct
region
*
region
,
const
rectangle_t
*
rect
)
{
const
rectangle_t
*
ptr
,
*
end
;
for
(
ptr
=
region
->
rects
,
end
=
region
->
rects
+
region
->
num_rects
;
ptr
<
end
;
ptr
++
)
{
if
(
ptr
->
top
>
rect
->
bottom
)
return
0
;
if
(
ptr
->
bottom
<=
rect
->
top
)
continue
;
/* now we are in the correct band */
if
(
ptr
->
left
>
rect
->
right
)
return
0
;
if
(
ptr
->
right
<=
rect
->
left
)
continue
;
return
1
;
}
return
0
;
}
server/user.h
View file @
edc90a9f
...
...
@@ -84,6 +84,7 @@ extern struct region *subtract_region( struct region *dst, const struct region *
extern
struct
region
*
union_region
(
struct
region
*
dst
,
const
struct
region
*
src1
,
const
struct
region
*
src2
);
extern
int
point_in_region
(
struct
region
*
region
,
int
x
,
int
y
);
extern
int
rect_in_region
(
struct
region
*
region
,
const
rectangle_t
*
rect
);
static
inline
struct
region
*
create_empty_region
(
void
)
{
return
create_region
(
NULL
,
0
);
}
/* window functions */
...
...
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