Transform the invalidation macros to proper functions.
This commit is contained in:
parent
bf46fab650
commit
c093196c05
|
@ -1155,40 +1155,51 @@ static inline BOOL LISTVIEW_GetItemW(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem)
|
||||||
return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE);
|
return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The Invalidate* are macros, so we preserve the caller location */
|
/* Listview invlaidation functions: use _only_ these function to invalidate */
|
||||||
#define LISTVIEW_InvalidateRect(infoPtr, rect) while(infoPtr->bRedraw) { \
|
|
||||||
TRACE(" invalidating rect=%s\n", debugrect(rect)); \
|
static inline void LISTVIEW_InvalidateRect(LISTVIEW_INFO *infoPtr, const RECT*rect)
|
||||||
InvalidateRect(infoPtr->hwndSelf, rect, TRUE); \
|
{
|
||||||
break;\
|
if(!infoPtr->bRedraw) return;
|
||||||
|
TRACE(" invalidating rect=%s\n", debugrect(rect));
|
||||||
|
InvalidateRect(infoPtr->hwndSelf, rect, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LISTVIEW_InvalidateItem(infoPtr, nItem) do { \
|
static inline void LISTVIEW_InvalidateItem(LISTVIEW_INFO *infoPtr, INT nItem)
|
||||||
RECT rcBox; \
|
{
|
||||||
LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox); \
|
RECT rcBox;
|
||||||
LISTVIEW_InvalidateRect(infoPtr, &rcBox); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LISTVIEW_InvalidateSubItem(infoPtr, nItem, nSubItem) do { \
|
if(!infoPtr->bRedraw) return;
|
||||||
POINT Origin, Position; \
|
LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox);
|
||||||
RECT rcBox; \
|
LISTVIEW_InvalidateRect(infoPtr, &rcBox);
|
||||||
assert ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT); \
|
}
|
||||||
LISTVIEW_GetOrigin(infoPtr, &Origin); \
|
|
||||||
LISTVIEW_GetItemOrigin(infoPtr, nItem, &Position); \
|
|
||||||
LISTVIEW_GetHeaderRect(infoPtr, nSubItem, &rcBox); \
|
|
||||||
rcBox.top = 0; \
|
|
||||||
rcBox.bottom = infoPtr->nItemHeight; \
|
|
||||||
OffsetRect(&rcBox, Origin.x + Position.x, Origin.y + Position.y); \
|
|
||||||
LISTVIEW_InvalidateRect(infoPtr, &rcBox); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LISTVIEW_InvalidateList(infoPtr)\
|
static inline void LISTVIEW_InvalidateSubItem(LISTVIEW_INFO *infoPtr, INT nItem, INT nSubItem)
|
||||||
LISTVIEW_InvalidateRect(infoPtr, NULL)
|
{
|
||||||
|
POINT Origin, Position;
|
||||||
|
RECT rcBox;
|
||||||
|
|
||||||
|
if(!infoPtr->bRedraw) return;
|
||||||
|
assert ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT);
|
||||||
|
LISTVIEW_GetOrigin(infoPtr, &Origin);
|
||||||
|
LISTVIEW_GetItemOrigin(infoPtr, nItem, &Position);
|
||||||
|
LISTVIEW_GetHeaderRect(infoPtr, nSubItem, &rcBox);
|
||||||
|
rcBox.top = 0;
|
||||||
|
rcBox.bottom = infoPtr->nItemHeight;
|
||||||
|
OffsetRect(&rcBox, Origin.x + Position.x, Origin.y + Position.y);
|
||||||
|
LISTVIEW_InvalidateRect(infoPtr, &rcBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void LISTVIEW_InvalidateList(LISTVIEW_INFO *infoPtr)
|
||||||
|
{
|
||||||
|
LISTVIEW_InvalidateRect(infoPtr, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void LISTVIEW_InvalidateColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
|
static inline void LISTVIEW_InvalidateColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
|
||||||
{
|
{
|
||||||
RECT rcCol;
|
RECT rcCol;
|
||||||
|
|
||||||
|
if(!infoPtr->bRedraw) return;
|
||||||
LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcCol);
|
LISTVIEW_GetHeaderRect(infoPtr, nColumn, &rcCol);
|
||||||
rcCol.top = infoPtr->rcList.top;
|
rcCol.top = infoPtr->rcList.top;
|
||||||
rcCol.bottom = infoPtr->rcList.bottom;
|
rcCol.bottom = infoPtr->rcList.bottom;
|
||||||
|
|
Loading…
Reference in New Issue