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
14991b78
Commit
14991b78
authored
Nov 02, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Nov 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Add absolute version of iterator_frameditems.
parent
8d351a11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
20 deletions
+33
-20
listview.c
dlls/comctl32/listview.c
+33
-20
No files found.
dlls/comctl32/listview.c
View file @
14991b78
...
...
@@ -1268,20 +1268,17 @@ static inline BOOL iterator_rangesitems(ITERATOR* i, RANGES ranges)
}
/***
* Creates an iterator over the items which intersect lprc.
* Creates an iterator over the items which intersect frame.
* Uses absolute coordinates rather than compensating for the current offset.
*/
static
BOOL
iterator_frameditems
(
ITERATOR
*
i
,
const
LISTVIEW_INFO
*
infoPtr
,
const
RECT
*
lprc
)
static
BOOL
iterator_frameditems
_absolute
(
ITERATOR
*
i
,
const
LISTVIEW_INFO
*
infoPtr
,
const
RECT
*
frame
)
{
RECT
frame
=
*
lprc
,
rcItem
,
rcTemp
;
POINT
Origin
;
RECT
rcItem
,
rcTemp
;
/* in case we fail, we want to return an empty iterator */
if
(
!
iterator_empty
(
i
))
return
FALSE
;
LISTVIEW_GetOrigin
(
infoPtr
,
&
Origin
);
TRACE
(
"(lprc=%s)
\n
"
,
wine_dbgstr_rect
(
lprc
));
OffsetRect
(
&
frame
,
-
Origin
.
x
,
-
Origin
.
y
);
TRACE
(
"(frame=%s)
\n
"
,
wine_dbgstr_rect
(
frame
));
if
(
infoPtr
->
uView
==
LV_VIEW_ICON
||
infoPtr
->
uView
==
LV_VIEW_SMALLICON
)
{
...
...
@@ -1290,7 +1287,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
if
(
infoPtr
->
uView
==
LV_VIEW_ICON
&&
infoPtr
->
nFocusedItem
!=
-
1
)
{
LISTVIEW_GetItemBox
(
infoPtr
,
infoPtr
->
nFocusedItem
,
&
rcItem
);
if
(
IntersectRect
(
&
rcTemp
,
&
rcItem
,
lprc
))
if
(
IntersectRect
(
&
rcTemp
,
&
rcItem
,
frame
))
i
->
nSpecial
=
infoPtr
->
nFocusedItem
;
}
if
(
!
(
iterator_rangesitems
(
i
,
ranges_create
(
50
))))
return
FALSE
;
...
...
@@ -1302,7 +1299,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
rcItem
.
top
=
(
LONG_PTR
)
DPA_GetPtr
(
infoPtr
->
hdpaPosY
,
nItem
);
rcItem
.
right
=
rcItem
.
left
+
infoPtr
->
nItemWidth
;
rcItem
.
bottom
=
rcItem
.
top
+
infoPtr
->
nItemHeight
;
if
(
IntersectRect
(
&
rcTemp
,
&
rcItem
,
&
frame
))
if
(
IntersectRect
(
&
rcTemp
,
&
rcItem
,
frame
))
ranges_additem
(
i
->
ranges
,
nItem
);
}
return
TRUE
;
...
...
@@ -1311,11 +1308,11 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
{
RANGE
range
;
if
(
frame
.
left
>=
infoPtr
->
nItemWidth
)
return
TRUE
;
if
(
frame
.
top
>=
infoPtr
->
nItemHeight
*
infoPtr
->
nItemCount
)
return
TRUE
;
if
(
frame
->
left
>=
infoPtr
->
nItemWidth
)
return
TRUE
;
if
(
frame
->
top
>=
infoPtr
->
nItemHeight
*
infoPtr
->
nItemCount
)
return
TRUE
;
range
.
lower
=
max
(
frame
.
top
/
infoPtr
->
nItemHeight
,
0
);
range
.
upper
=
min
((
frame
.
bottom
-
1
)
/
infoPtr
->
nItemHeight
,
infoPtr
->
nItemCount
-
1
)
+
1
;
range
.
lower
=
max
(
frame
->
top
/
infoPtr
->
nItemHeight
,
0
);
range
.
upper
=
min
((
frame
->
bottom
-
1
)
/
infoPtr
->
nItemHeight
,
infoPtr
->
nItemCount
-
1
)
+
1
;
if
(
range
.
upper
<=
range
.
lower
)
return
TRUE
;
if
(
!
iterator_rangeitems
(
i
,
range
))
return
FALSE
;
TRACE
(
" report=%s
\n
"
,
debugrange
(
&
i
->
range
));
...
...
@@ -1323,8 +1320,8 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
else
{
INT
nPerCol
=
max
((
infoPtr
->
rcList
.
bottom
-
infoPtr
->
rcList
.
top
)
/
infoPtr
->
nItemHeight
,
1
);
INT
nFirstRow
=
max
(
frame
.
top
/
infoPtr
->
nItemHeight
,
0
);
INT
nLastRow
=
min
((
frame
.
bottom
-
1
)
/
infoPtr
->
nItemHeight
,
nPerCol
-
1
);
INT
nFirstRow
=
max
(
frame
->
top
/
infoPtr
->
nItemHeight
,
0
);
INT
nLastRow
=
min
((
frame
->
bottom
-
1
)
/
infoPtr
->
nItemHeight
,
nPerCol
-
1
);
INT
nFirstCol
;
INT
nLastCol
;
INT
lower
;
...
...
@@ -1333,13 +1330,13 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
if
(
infoPtr
->
nItemWidth
)
{
nFirstCol
=
max
(
frame
.
left
/
infoPtr
->
nItemWidth
,
0
);
nLastCol
=
min
((
frame
.
right
-
1
)
/
infoPtr
->
nItemWidth
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
);
nFirstCol
=
max
(
frame
->
left
/
infoPtr
->
nItemWidth
,
0
);
nLastCol
=
min
((
frame
->
right
-
1
)
/
infoPtr
->
nItemWidth
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
);
}
else
{
nFirstCol
=
max
(
frame
.
left
,
0
);
nLastCol
=
min
(
frame
.
right
-
1
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
);
nFirstCol
=
max
(
frame
->
left
,
0
);
nLastCol
=
min
(
frame
->
right
-
1
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
);
}
lower
=
nFirstCol
*
nPerCol
+
nFirstRow
;
...
...
@@ -1365,6 +1362,22 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
}
/***
* Creates an iterator over the items which intersect lprc.
*/
static
BOOL
iterator_frameditems
(
ITERATOR
*
i
,
const
LISTVIEW_INFO
*
infoPtr
,
const
RECT
*
lprc
)
{
RECT
frame
=
*
lprc
;
POINT
Origin
;
TRACE
(
"(lprc=%s)
\n
"
,
wine_dbgstr_rect
(
lprc
));
LISTVIEW_GetOrigin
(
infoPtr
,
&
Origin
);
OffsetRect
(
&
frame
,
-
Origin
.
x
,
-
Origin
.
y
);
return
iterator_frameditems_absolute
(
i
,
infoPtr
,
&
frame
);
}
/***
* Creates an iterator over the items which intersect the visible region of hdc.
*/
static
BOOL
iterator_visibleitems
(
ITERATOR
*
i
,
const
LISTVIEW_INFO
*
infoPtr
,
HDC
hdc
)
...
...
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