ReactOS  0.4.14-dev-599-g2d4d3f5
listview.c File Reference
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "uxtheme.h"
#include "wine/debug.h"
Include dependency graph for listview.c:

Go to the source code of this file.

Classes

struct  tagCOLUMN_INFO
 
struct  tagITEMHDR
 
struct  tagSUBITEM_INFO
 
struct  tagITEM_INFO
 
struct  tagITEM_ID
 
struct  tagRANGE
 
struct  tagRANGES
 
struct  tagITERATOR
 
struct  tagDELAYED_ITEM_EDIT
 
struct  tagLISTVIEW_INFO
 

Macros

#define DEBUG_BUFFERS   20
 
#define DEBUG_BUFFER_SIZE   256
 
#define SB_INTERNAL   -1
 
#define DISP_TEXT_SIZE   260
 
#define WIDTH_PADDING   12
 
#define HEIGHT_PADDING   1
 
#define REPORT_MARGINX   2
 
#define ICON_TOP_PADDING_NOTHITABLE   2
 
#define ICON_TOP_PADDING_HITABLE   2
 
#define ICON_TOP_PADDING   (ICON_TOP_PADDING_NOTHITABLE + ICON_TOP_PADDING_HITABLE)
 
#define ICON_BOTTOM_PADDING   4
 
#define LABEL_HOR_PADDING   5
 
#define LABEL_VERT_PADDING   7
 
#define ICON_LR_PADDING   16
 
#define ICON_LR_HALF   (ICON_LR_PADDING/2)
 
#define DEFAULT_LABEL_WIDTH   40
 
#define MAX_EMPTYTEXT_SELECT_WIDTH   80
 
#define DEFAULT_COLUMN_WIDTH   128
 
#define LISTVIEW_SCROLL_ICON_LINE_SIZE   37
 
#define IMAGE_PADDING   2
 
#define TRAILING_LABEL_PADDING   12
 
#define TRAILING_HEADER_PADDING   11
 
#define CAPTION_BORDER   2
 
#define LV_ML_DT_FLAGS   (DT_TOP | DT_NOPREFIX | DT_EDITCONTROL | DT_CENTER | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS)
 
#define LV_FL_DT_FLAGS   (DT_TOP | DT_NOPREFIX | DT_EDITCONTROL | DT_CENTER | DT_WORDBREAK | DT_NOCLIP)
 
#define LV_SL_DT_FLAGS   (DT_VCENTER | DT_NOPREFIX | DT_EDITCONTROL | DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS)
 
#define STATEIMAGEINDEX(x)   (((x) & LVIS_STATEIMAGEMASK) >> 12)
 
#define KEY_DELAY   450
 
#define LISTVIEW_DUMP(iP)
 
#define ranges_check(ranges, desc)   if (TRACE_ON(listview)) ranges_assert(ranges, desc, __FILE__, __LINE__)
 
#define SCROLL_LEFT   0x1
 
#define SCROLL_RIGHT   0x2
 
#define SCROLL_UP   0x4
 
#define SCROLL_DOWN   0x8
 

Typedefs

typedef struct tagCOLUMN_INFO COLUMN_INFO
 
typedef struct tagITEMHDR ITEMHDR
 
typedef struct tagITEMHDRLPITEMHDR
 
typedef struct tagSUBITEM_INFO SUBITEM_INFO
 
typedef struct tagITEM_ID ITEM_ID
 
typedef struct tagITEM_INFO ITEM_INFO
 
typedef struct tagRANGE RANGE
 
typedef struct tagRANGESRANGES
 
typedef struct tagITERATOR ITERATOR
 
typedef struct tagDELAYED_ITEM_EDIT DELAYED_ITEM_EDIT
 
typedef struct tagLISTVIEW_INFO LISTVIEW_INFO
 

Enumerations

enum  notification_mask { NOTIFY_MASK_ITEM_CHANGE = 0x1, NOTIFY_MASK_END_LABEL_EDIT = 0x2, NOTIFY_MASK_UNMASK_ALL = 0xffffffff }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (listview)
 
static BOOL LISTVIEW_GetItemT (const LISTVIEW_INFO *, LPLVITEMW, BOOL)
 
static void LISTVIEW_GetItemBox (const LISTVIEW_INFO *, INT, LPRECT)
 
static void LISTVIEW_GetItemOrigin (const LISTVIEW_INFO *, INT, LPPOINT)
 
static BOOL LISTVIEW_GetItemPosition (const LISTVIEW_INFO *, INT, LPPOINT)
 
static BOOL LISTVIEW_GetItemRect (const LISTVIEW_INFO *, INT, LPRECT)
 
static void LISTVIEW_GetOrigin (const LISTVIEW_INFO *, LPPOINT)
 
static BOOL LISTVIEW_GetViewRect (const LISTVIEW_INFO *, LPRECT)
 
static void LISTVIEW_UpdateSize (LISTVIEW_INFO *)
 
static LRESULT LISTVIEW_Command (LISTVIEW_INFO *, WPARAM, LPARAM)
 
static INT LISTVIEW_GetStringWidthT (const LISTVIEW_INFO *, LPCWSTR, BOOL)
 
static BOOL LISTVIEW_KeySelection (LISTVIEW_INFO *, INT, BOOL)
 
static UINT LISTVIEW_GetItemState (const LISTVIEW_INFO *, INT, UINT)
 
static BOOL LISTVIEW_SetItemState (LISTVIEW_INFO *, INT, const LVITEMW *)
 
static LRESULT LISTVIEW_VScroll (LISTVIEW_INFO *, INT, INT)
 
static LRESULT LISTVIEW_HScroll (LISTVIEW_INFO *, INT, INT)
 
static BOOL LISTVIEW_EnsureVisible (LISTVIEW_INFO *, INT, BOOL)
 
static HIMAGELIST LISTVIEW_SetImageList (LISTVIEW_INFO *, INT, HIMAGELIST)
 
static INT LISTVIEW_HitTest (const LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL)
 
static BOOL LISTVIEW_EndEditLabelT (LISTVIEW_INFO *, BOOL, BOOL)
 
static BOOL LISTVIEW_Scroll (LISTVIEW_INFO *, INT, INT)
 
static BOOL is_text (LPCWSTR text)
 
static int textlenT (LPCWSTR text, BOOL isW)
 
static void textcpynT (LPWSTR dest, BOOL isDestW, LPCWSTR src, BOOL isSrcW, INT max)
 
static LPWSTR textdupTtoW (LPCWSTR text, BOOL isW)
 
static void textfreeT (LPWSTR wstr, BOOL isW)
 
static BOOL textsetptrT (LPWSTR *dest, LPCWSTR src, BOOL isW)
 
static int textcmpWT (LPCWSTR aw, LPCWSTR bt, BOOL isW)
 
static int lstrncmpiW (LPCWSTR s1, LPCWSTR s2, int n)
 
static LPCSTR debugtext_t (LPCWSTR text, BOOL isW)
 
static LPCSTR debugtext_tn (LPCWSTR text, BOOL isW, INT n)
 
static chardebug_getbuf (void)
 
static const chardebugrange (const RANGE *lprng)
 
static const chardebugscrollinfo (const SCROLLINFO *pScrollInfo)
 
static const chardebugnmlistview (const NMLISTVIEW *plvnm)
 
static const chardebuglvitem_t (const LVITEMW *lpLVItem, BOOL isW)
 
static const chardebuglvcolumn_t (const LVCOLUMNW *lpColumn, BOOL isW)
 
static const chardebuglvhittestinfo (const LVHITTESTINFO *lpht)
 
static LPCSTR debugscrollcode (int nScrollCode)
 
static int get_ansi_notification (UINT unicodeNotificationCode)
 
static LRESULT notify_forward_header (const LISTVIEW_INFO *infoPtr, NMHEADERW *lpnmhW)
 
static LRESULT notify_hdr (const LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh)
 
static BOOL notify (const LISTVIEW_INFO *infoPtr, INT code)
 
static void notify_itemactivate (const LISTVIEW_INFO *infoPtr, const LVHITTESTINFO *htInfo)
 
static LRESULT notify_listview (const LISTVIEW_INFO *infoPtr, INT code, LPNMLISTVIEW plvnm)
 
static BOOL notify_click (const LISTVIEW_INFO *infoPtr, INT code, const LVHITTESTINFO *lvht)
 
static BOOL notify_deleteitem (const LISTVIEW_INFO *infoPtr, INT nItem)
 
static BOOL notify_dispinfoT (const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISPINFOW pdi, BOOL isW)
 
static void customdraw_fill (NMLVCUSTOMDRAW *lpnmlvcd, const LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *rcBounds, const LVITEMW *lplvItem)
 
static DWORD notify_customdraw (const LISTVIEW_INFO *infoPtr, DWORD dwDrawStage, NMLVCUSTOMDRAW *lpnmlvcd)
 
static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd, BOOL SubItem)
 
static DWORD notify_postpaint (const LISTVIEW_INFO *infoPtr, NMLVCUSTOMDRAW *lpnmlvcd)
 
static BOOL notify_measureitem (LISTVIEW_INFO *infoPtr)
 
static RANGES ranges_create (int count)
 
static void ranges_destroy (RANGES ranges)
 
static BOOL ranges_add (RANGES ranges, RANGE range)
 
static BOOL ranges_del (RANGES ranges, RANGE range)
 
static void ranges_dump (RANGES ranges)
 
static BOOL ranges_additem (RANGES ranges, INT nItem)
 
static BOOL ranges_delitem (RANGES ranges, INT nItem)
 
static BOOL iterator_next (ITERATOR *i)
 
static BOOL iterator_prev (ITERATOR *i)
 
static RANGE iterator_range (const ITERATOR *i)
 
static void iterator_destroy (const ITERATOR *i)
 
static void iterator_empty (ITERATOR *i)
 
static void iterator_rangeitems (ITERATOR *i, RANGE range)
 
static void iterator_rangesitems (ITERATOR *i, RANGES ranges)
 
static BOOL iterator_frameditems_absolute (ITERATOR *i, const LISTVIEW_INFO *infoPtr, const RECT *frame)
 
static BOOL iterator_frameditems (ITERATOR *i, const LISTVIEW_INFO *infoPtr, const RECT *lprc)
 
static BOOL iterator_visibleitems (ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC hdc)
 
static BOOL iterator_remove_common_items (ITERATOR *iter1, ITERATOR *iter2)
 
static LRESULT CallWindowProcT (WNDPROC proc, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW)
 
static BOOL is_autoarrange (const LISTVIEW_INFO *infoPtr)
 
static void toggle_checkbox_state (LISTVIEW_INFO *infoPtr, INT nItem)
 
static void map_style_view (LISTVIEW_INFO *infoPtr)
 
static DWORD get_next_itemid (const LISTVIEW_INFO *infoPtr)
 
static COLUMN_INFOLISTVIEW_GetColumnInfo (const LISTVIEW_INFO *infoPtr, INT nSubItem)
 
static INT LISTVIEW_CreateHeader (LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_GetHeaderRect (const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc)
 
static BOOL LISTVIEW_IsHeaderEnabled (const LISTVIEW_INFO *infoPtr)
 
static BOOL LISTVIEW_GetItemW (const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem)
 
static BOOL LISTVIEW_DrawFocusRect (const LISTVIEW_INFO *infoPtr, HDC hdc)
 
static BOOL is_redrawing (const LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_InvalidateRect (const LISTVIEW_INFO *infoPtr, const RECT *rect)
 
static void LISTVIEW_InvalidateItem (const LISTVIEW_INFO *infoPtr, INT nItem)
 
static void LISTVIEW_InvalidateSubItem (const LISTVIEW_INFO *infoPtr, INT nItem, INT nSubItem)
 
static void LISTVIEW_InvalidateList (const LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_InvalidateColumn (const LISTVIEW_INFO *infoPtr, INT nColumn)
 
static INT LISTVIEW_GetCountPerRow (const LISTVIEW_INFO *infoPtr)
 
static INT LISTVIEW_GetCountPerColumn (const LISTVIEW_INFO *infoPtr)
 
static INT LISTVIEW_ProcessLetterKeys (LISTVIEW_INFO *infoPtr, WPARAM charCode, LPARAM keyData)
 
static void LISTVIEW_UpdateHeaderSize (const LISTVIEW_INFO *infoPtr, INT nNewScrollPos)
 
static INT LISTVIEW_UpdateHScroll (LISTVIEW_INFO *infoPtr)
 
static INT LISTVIEW_UpdateVScroll (LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_UpdateScroll (LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_ShowFocusRect (const LISTVIEW_INFO *infoPtr, BOOL fShow)
 
static void LISTVIEW_InvalidateSelectedItems (const LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_GetItemMetrics (const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, LPRECT lprcBox, LPRECT lprcSelectBox, LPRECT lprcIcon, LPRECT lprcStateIcon, LPRECT lprcLabel)
 
static INT CALLBACK MapIdSearchCompare (LPVOID p1, LPVOID p2, LPARAM lParam)
 
static INT LISTVIEW_MapIdToIndex (const LISTVIEW_INFO *infoPtr, UINT iID)
 
static DWORD LISTVIEW_MapIndexToId (const LISTVIEW_INFO *infoPtr, INT iItem)
 
static void LISTVIEW_NextIconPosTop (LISTVIEW_INFO *infoPtr, LPPOINT lpPos)
 
static void LISTVIEW_NextIconPosLeft (LISTVIEW_INFO *infoPtr, LPPOINT lpPos)
 
static BOOL LISTVIEW_MoveIconTo (const LISTVIEW_INFO *infoPtr, INT nItem, const POINT *lppt, BOOL isNew)
 
static BOOL LISTVIEW_Arrange (LISTVIEW_INFO *infoPtr, INT nAlignCode)
 
static void LISTVIEW_GetAreaRect (const LISTVIEW_INFO *infoPtr, LPRECT lprcView)
 
static SUBITEM_INFOLISTVIEW_GetSubItemPtr (HDPA hdpaSubItems, INT nSubItem)
 
static INT LISTVIEW_CalculateItemWidth (const LISTVIEW_INFO *infoPtr)
 
static INT LISTVIEW_CalculateItemHeight (const LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_UpdateItemSize (LISTVIEW_INFO *infoPtr)
 
static void LISTVIEW_SaveTextMetrics (LISTVIEW_INFO *infoPtr)
 
static INT CALLBACK ranges_cmp (LPVOID range1, LPVOID range2, LPARAM flags)
 
static void ranges_assert (RANGES ranges, LPCSTR desc, const char *file, int line)
 
static void ranges_clear (RANGES ranges)
 
static RANGES ranges_clone (RANGES ranges)
 
static RANGES ranges_diff (RANGES ranges, RANGES sub)
 
static BOOL ranges_contain (RANGES ranges, INT nItem)
 
static INT ranges_itemcount (RANGES ranges)
 
static BOOL ranges_shift (RANGES ranges, INT nItem, INT delta, INT nUpper)
 
static BOOL LISTVIEW_DeselectAllSkipItems (LISTVIEW_INFO *infoPtr, RANGES toSkip)
 
static BOOL LISTVIEW_DeselectAllSkipItem (LISTVIEW_INFO *infoPtr, INT nItem)
 
static BOOL LISTVIEW_DeselectAll (LISTVIEW_INFO *infoPtr)
 
static INT LISTVIEW_GetSelectedCount (const LISTVIEW_INFO *infoPtr)
 
static BOOL LISTVIEW_SetItemFocus (LISTVIEW_INFO *infoPtr, INT nItem)
 
static INT shift_item (const LISTVIEW_INFO *infoPtr, INT nShiftItem, INT nItem, INT direction)
 
static void LISTVIEW_ShiftFocus (LISTVIEW_INFO *infoPtr, INT focus, INT item, INT direction)
 
static void LISTVIEW_ShiftIndices (LISTVIEW_INFO *infoPtr, INT nItem, INT direction)
 
static BOOL LISTVIEW_AddGroupSelection (LISTVIEW_INFO *infoPtr, INT nItem)
 
static void LISTVIEW_SetGroupSelection (LISTVIEW_INFO *infoPtr, INT nItem)
 
static void LISTVIEW_SetSelection (LISTVIEW_INFO *infoPtr, INT nItem)
 
static BOOL LISTVIEW_GetItemAtPt (const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, POINT pt)
 
static BOOL LISTVIEW_IsHotTracking (const LISTVIEW_INFO *infoPtr)
 
static LRESULT LISTVIEW_MouseHover (LISTVIEW_INFO *infoPtr, INT x, INT y)
 
static void LISTVIEW_MarqueeHighlight (LISTVIEW_INFO *infoPtr, const POINT *coords_orig, INT scroll)
 
static VOID CALLBACK LISTVIEW_ScrollTimer (HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
 
static LRESULT LISTVIEW_MouseMove (LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, INT y)
 
static BOOL is_assignable_item (const LVITEMW *lpLVItem, LONG lStyle)
 
static BOOL set_main_item (LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isNew, BOOL isW, BOOL *bChanged)
 
static BOOL set_sub_item (const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isW, BOOL *bChanged)
 
static BOOL LISTVIEW_SetItemT (LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL isW)
 
static INT LISTVIEW_GetTopIndex (const LISTVIEW_INFO *infoPtr)
 
static BOOL LISTVIEW_FillBkgnd (const LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *lprcBox)
 
static void LISTVIEW_DrawItemPart (LISTVIEW_INFO *infoPtr, LVITEMW *item, const NMLVCUSTOMDRAW *nmlvcd, const POINT *pos)
 
static BOOL LISTVIEW_DrawItem (LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERATOR *subitems, POINT pos, DWORD cdmode)
 
static void LISTVIEW_RefreshOwnerDraw (const LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, DWORD cdmode)
 
static void LISTVIEW_RefreshReport (LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, DWORD cdmode)
 
static void LISTVIEW_RefreshReportGrid (LISTVIEW_INFO *infoPtr, HDC hdc)
 
static void LISTVIEW_RefreshList (LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, DWORD cdmode)
 
static void LISTVIEW_Refresh (LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcErase)
 
static DWORD LISTVIEW_ApproximateViewRect (const LISTVIEW_INFO *infoPtr, INT nItemCount, WORD wWidth, WORD wHeight)
 
static LRESULT LISTVIEW_CancelEditLabel (LISTVIEW_INFO *infoPtr)
 
static HIMAGELIST LISTVIEW_CreateDragImage (LISTVIEW_INFO *infoPtr, INT iItem, LPPOINT lppt)
 
static BOOL LISTVIEW_DeleteAllItems (LISTVIEW_INFO *infoPtr, BOOL destroy)
 
static void LISTVIEW_ScrollColumns (LISTVIEW_INFO *infoPtr, INT nColumn, INT dx)
 
static BOOL LISTVIEW_DeleteColumn (LISTVIEW_INFO *infoPtr, INT nColumn)
 
static void LISTVIEW_ScrollOnInsert (LISTVIEW_INFO *infoPtr, INT nItem, INT dir)
 
static BOOL LISTVIEW_DeleteItem (LISTVIEW_INFO *infoPtr, INT nItem)
 
static LRESULT EditLblWndProcT (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW)
 
static LRESULT CALLBACK EditLblWndProcW (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK EditLblWndProcA (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static HWND CreateEditLabelT (LISTVIEW_INFO *infoPtr, LPCWSTR text, BOOL isW)
 
static HWND LISTVIEW_EditLabelT (LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
 
static INT LISTVIEW_FindItemW (const LISTVIEW_INFO *infoPtr, INT nStart, const LVFINDINFOW *lpFindInfo)
 
static INT LISTVIEW_FindItemA (const LISTVIEW_INFO *infoPtr, INT nStart, const LVFINDINFOA *lpFindInfo)
 
static BOOL LISTVIEW_GetColumnT (const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVCOLUMNW lpColumn, BOOL isW)
 
static BOOL LISTVIEW_GetColumnOrderArray (const LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
 
static INT LISTVIEW_GetColumnWidth (const LISTVIEW_INFO *infoPtr, INT nColumn)
 
static INT LISTVIEW_GetCountPerPage (const LISTVIEW_INFO *infoPtr)
 
static HIMAGELIST LISTVIEW_GetImageList (const LISTVIEW_INFO *infoPtr, INT nImageList)
 
static BOOL LISTVIEW_GetItemExtT (const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
 
static BOOL LISTVIEW_GetSubItemRect (const LISTVIEW_INFO *infoPtr, INT item, LPRECT lprc)
 
static LONG LISTVIEW_GetItemSpacing (const LISTVIEW_INFO *infoPtr, BOOL bSmall)
 
static INT LISTVIEW_GetItemTextT (const LISTVIEW_INFO *infoPtr, INT nItem, LPLVITEMW lpLVItem, BOOL isW)
 
static INT LISTVIEW_GetNextItem (const LISTVIEW_INFO *infoPtr, INT nItem, UINT uFlags)
 
static INT LISTVIEW_InsertItemT (LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isW)
 
static BOOL LISTVIEW_IsItemVisible (const LISTVIEW_INFO *infoPtr, INT nItem)
 
static BOOL LISTVIEW_RedrawItems (const LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast)
 
static BOOL LISTVIEW_SetBkColor (LISTVIEW_INFO *infoPtr, COLORREF color)
 
static void column_fill_hditem (const LISTVIEW_INFO *infoPtr, HDITEMW *lphdi, INT nColumn, const LVCOLUMNW *lpColumn, BOOL isW)
 
static INT LISTVIEW_InsertColumnT (LISTVIEW_INFO *infoPtr, INT nColumn, const LVCOLUMNW *lpColumn, BOOL isW)
 
static BOOL LISTVIEW_SetColumnT (const LISTVIEW_INFO *infoPtr, INT nColumn, const LVCOLUMNW *lpColumn, BOOL isW)
 
static BOOL LISTVIEW_SetColumnOrderArray (LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
 
static BOOL LISTVIEW_SetColumnWidth (LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
 
static HIMAGELIST LISTVIEW_CreateCheckBoxIL (const LISTVIEW_INFO *infoPtr)
 
static DWORD LISTVIEW_SetExtendedListViewStyle (LISTVIEW_INFO *infoPtr, DWORD mask, DWORD ex_style)
 
static HCURSOR LISTVIEW_SetHotCursor (LISTVIEW_INFO *infoPtr, HCURSOR hCursor)
 
static INT LISTVIEW_SetHotItem (LISTVIEW_INFO *infoPtr, INT iIndex)
 
static DWORD LISTVIEW_SetHoverTime (LISTVIEW_INFO *infoPtr, DWORD dwHoverTime)
 
static DWORD LISTVIEW_SetIconSpacing (LISTVIEW_INFO *infoPtr, INT cx, INT cy)
 
static void set_icon_size (SIZE *size, HIMAGELIST himl, BOOL is_small)
 
static BOOL LISTVIEW_SetItemCount (LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFlags)
 
static BOOL LISTVIEW_SetItemPosition (LISTVIEW_INFO *infoPtr, INT nItem, const POINT *pt)
 
static BOOL LISTVIEW_SetItemTextT (LISTVIEW_INFO *infoPtr, INT nItem, const LVITEMW *lpLVItem, BOOL isW)
 
static INT LISTVIEW_SetSelectionMark (LISTVIEW_INFO *infoPtr, INT nIndex)
 
static BOOL LISTVIEW_SetTextBkColor (LISTVIEW_INFO *infoPtr, COLORREF color)
 
static BOOL LISTVIEW_SetTextColor (LISTVIEW_INFO *infoPtr, COLORREF color)
 
static HWND LISTVIEW_SetToolTips (LISTVIEW_INFO *infoPtr, HWND hwndNewToolTip)
 
static BOOL LISTVIEW_SetUnicodeFormat (LISTVIEW_INFO *infoPtr, BOOL unicode)
 
static INT LISTVIEW_SetView (LISTVIEW_INFO *infoPtr, DWORD nView)
 
static INT WINAPI LISTVIEW_CallBackCompare (LPVOID first, LPVOID second, LPARAM lParam)
 
static INT WINAPI LISTVIEW_CallBackCompareEx (LPVOID first, LPVOID second, LPARAM lParam)
 
static BOOL LISTVIEW_SortItems (LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, LPARAM lParamSort, BOOL IsEx)
 
static LRESULT LISTVIEW_ThemeChanged (const LISTVIEW_INFO *infoPtr)
 
static BOOL LISTVIEW_Update (LISTVIEW_INFO *infoPtr, INT nItem)
 
static BOOL LISTVIEW_DrawTrackLine (const LISTVIEW_INFO *infoPtr)
 
static VOID CALLBACK LISTVIEW_DelayedEditItem (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
 
static LRESULT LISTVIEW_NCCreate (HWND hwnd, WPARAM wParam, const CREATESTRUCTW *lpcs)
 
static LRESULT LISTVIEW_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
 
static LRESULT LISTVIEW_Destroy (LISTVIEW_INFO *infoPtr)
 
static BOOL LISTVIEW_Enable (const LISTVIEW_INFO *infoPtr)
 
static BOOL LISTVIEW_EraseBkgnd (const LISTVIEW_INFO *infoPtr, HDC hdc)
 
static void scroll_list (LISTVIEW_INFO *infoPtr, INT dx, INT dy)
 
static LRESULT LISTVIEW_MouseWheel (LISTVIEW_INFO *infoPtr, INT wheelDelta)
 
static LRESULT LISTVIEW_KeyDown (LISTVIEW_INFO *infoPtr, INT nVirtualKey, LONG lKeyData)
 
static LRESULT LISTVIEW_KillFocus (LISTVIEW_INFO *infoPtr)
 
static LRESULT LISTVIEW_LButtonDblClk (LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
 
static LRESULT LISTVIEW_TrackMouse (const LISTVIEW_INFO *infoPtr, POINT pt)
 
static LRESULT LISTVIEW_LButtonDown (LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
 
static LRESULT LISTVIEW_LButtonUp (LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
 
static LRESULT LISTVIEW_NCDestroy (LISTVIEW_INFO *infoPtr)
 
static LRESULT LISTVIEW_Notify (LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr)
 
static BOOL LISTVIEW_NCPaint (const LISTVIEW_INFO *infoPtr, HRGN region)
 
static LRESULT LISTVIEW_NotifyFormat (LISTVIEW_INFO *infoPtr, HWND hwndFrom, INT nCommand)
 
static LRESULT LISTVIEW_Paint (LISTVIEW_INFO *infoPtr, HDC hdc)
 
static LRESULT LISTVIEW_WMPaint (LISTVIEW_INFO *infoPtr, HDC hdc)
 
static LRESULT LISTVIEW_PrintClient (LISTVIEW_INFO *infoPtr, HDC hdc, DWORD options)
 
static LRESULT LISTVIEW_RButtonDblClk (const LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
 
static LRESULT LISTVIEW_RButtonDown (LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
 
static BOOL LISTVIEW_SetCursor (const LISTVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 
static LRESULT LISTVIEW_SetFocus (LISTVIEW_INFO *infoPtr, HWND hwndLoseFocus)
 
static LRESULT LISTVIEW_SetFont (LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedraw)
 
static LRESULT LISTVIEW_SetRedraw (LISTVIEW_INFO *infoPtr, BOOL redraw)
 
static LRESULT LISTVIEW_Size (LISTVIEW_INFO *infoPtr, int Width, int Height)
 
static INT LISTVIEW_StyleChanged (LISTVIEW_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
 
static INT LISTVIEW_StyleChanging (WPARAM wStyleType, STYLESTRUCT *lpss)
 
static LRESULT LISTVIEW_ShowWindow (LISTVIEW_INFO *infoPtr, WPARAM bShown, LPARAM iStatus)
 
static LRESULT LISTVIEW_GetVersion (const LISTVIEW_INFO *infoPtr)
 
static LRESULT LISTVIEW_SetVersion (LISTVIEW_INFO *infoPtr, DWORD iVersion)
 
static LRESULT WINAPI LISTVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void LISTVIEW_Register (void)
 
void LISTVIEW_Unregister (void)
 

Variables

static const WCHAR themeClass [] = {'L','i','s','t','V','i','e','w',0}
 

Macro Definition Documentation

◆ CAPTION_BORDER

#define CAPTION_BORDER   2

Definition at line 400 of file listview.c.

◆ DEBUG_BUFFER_SIZE

#define DEBUG_BUFFER_SIZE   256

Definition at line 343 of file listview.c.

◆ DEBUG_BUFFERS

#define DEBUG_BUFFERS   20

Definition at line 341 of file listview.c.

◆ DEFAULT_COLUMN_WIDTH

#define DEFAULT_COLUMN_WIDTH   128

Definition at line 387 of file listview.c.

◆ DEFAULT_LABEL_WIDTH

#define DEFAULT_LABEL_WIDTH   40

Definition at line 382 of file listview.c.

◆ DISP_TEXT_SIZE

#define DISP_TEXT_SIZE   260

Definition at line 349 of file listview.c.

◆ HEIGHT_PADDING

#define HEIGHT_PADDING   1

Definition at line 355 of file listview.c.

◆ ICON_BOTTOM_PADDING

#define ICON_BOTTOM_PADDING   4

Definition at line 375 of file listview.c.

◆ ICON_LR_HALF

#define ICON_LR_HALF   (ICON_LR_PADDING/2)

Definition at line 379 of file listview.c.

◆ ICON_LR_PADDING

#define ICON_LR_PADDING   16

Definition at line 378 of file listview.c.

◆ ICON_TOP_PADDING

Definition at line 374 of file listview.c.

◆ ICON_TOP_PADDING_HITABLE

#define ICON_TOP_PADDING_HITABLE   2

Definition at line 373 of file listview.c.

◆ ICON_TOP_PADDING_NOTHITABLE

#define ICON_TOP_PADDING_NOTHITABLE   2

Definition at line 372 of file listview.c.

◆ IMAGE_PADDING

#define IMAGE_PADDING   2

Definition at line 393 of file listview.c.

◆ KEY_DELAY

#define KEY_DELAY   450

Definition at line 411 of file listview.c.

◆ LABEL_HOR_PADDING

#define LABEL_HOR_PADDING   5

Definition at line 376 of file listview.c.

◆ LABEL_VERT_PADDING

#define LABEL_VERT_PADDING   7

Definition at line 377 of file listview.c.

◆ LISTVIEW_DUMP

#define LISTVIEW_DUMP (   iP)
Value:
do { \
TRACE("hwndSelf=%p, clrBk=0x%06x, clrText=0x%06x, clrTextBk=0x%06x, ItemHeight=%d, ItemWidth=%d, Style=0x%08x\n", \
iP->hwndSelf, iP->clrBk, iP->clrText, iP->clrTextBk, \
iP->nItemHeight, iP->nItemWidth, iP->dwStyle); \
TRACE("hwndSelf=%p, himlNor=%p, himlSml=%p, himlState=%p, Focused=%d, Hot=%d, exStyle=0x%08x, Focus=%d\n", \
iP->hwndSelf, iP->himlNormal, iP->himlSmall, iP->himlState, \
iP->nFocusedItem, iP->nHotItem, iP->dwLvExStyle, iP->bFocus ); \
TRACE("hwndSelf=%p, ntmH=%d, icSz.cx=%d, icSz.cy=%d, icSp.cx=%d, icSp.cy=%d, notifyFmt=%d\n", \
iP->hwndSelf, iP->ntmHeight, iP->iconSize.cx, iP->iconSize.cy, \
iP->iconSpacing.cx, iP->iconSpacing.cy, iP->notifyFormat); \
TRACE("hwndSelf=%p, rcList=%s\n", iP->hwndSelf, wine_dbgstr_rect(&iP->rcList)); \
} while(0)
const char * wine_dbgstr_rect(const RECT *rect)

Definition at line 414 of file listview.c.

◆ LISTVIEW_SCROLL_ICON_LINE_SIZE

#define LISTVIEW_SCROLL_ICON_LINE_SIZE   37

Definition at line 390 of file listview.c.

◆ LV_FL_DT_FLAGS

Definition at line 404 of file listview.c.

◆ LV_ML_DT_FLAGS

Definition at line 403 of file listview.c.

◆ LV_SL_DT_FLAGS

Definition at line 405 of file listview.c.

◆ MAX_EMPTYTEXT_SELECT_WIDTH

#define MAX_EMPTYTEXT_SELECT_WIDTH   80

Definition at line 384 of file listview.c.

◆ ranges_check

#define ranges_check (   ranges,
  desc 
)    if (TRACE_ON(listview)) ranges_assert(ranges, desc, __FILE__, __LINE__)

Definition at line 3135 of file listview.c.

◆ REPORT_MARGINX

#define REPORT_MARGINX   2

Definition at line 358 of file listview.c.

◆ SB_INTERNAL

#define SB_INTERNAL   -1

Definition at line 346 of file listview.c.

◆ SCROLL_DOWN

#define SCROLL_DOWN   0x8

Definition at line 3869 of file listview.c.

◆ SCROLL_LEFT

#define SCROLL_LEFT   0x1

Definition at line 3866 of file listview.c.

◆ SCROLL_RIGHT

#define SCROLL_RIGHT   0x2

Definition at line 3867 of file listview.c.

◆ SCROLL_UP

#define SCROLL_UP   0x4

Definition at line 3868 of file listview.c.

◆ STATEIMAGEINDEX

#define STATEIMAGEINDEX (   x)    (((x) & LVIS_STATEIMAGEMASK) >> 12)

Definition at line 408 of file listview.c.

◆ TRAILING_HEADER_PADDING

#define TRAILING_HEADER_PADDING   11

Definition at line 397 of file listview.c.

◆ TRAILING_LABEL_PADDING

#define TRAILING_LABEL_PADDING   12

Definition at line 396 of file listview.c.

◆ WIDTH_PADDING

#define WIDTH_PADDING   12

Definition at line 352 of file listview.c.

Typedef Documentation

◆ COLUMN_INFO

◆ DELAYED_ITEM_EDIT

◆ ITEM_ID

Definition at line 167 of file listview.c.

◆ ITEM_INFO

◆ ITEMHDR

◆ ITERATOR

◆ LISTVIEW_INFO

◆ LPITEMHDR

◆ RANGE

◆ RANGES

typedef struct tagRANGES * RANGES

◆ SUBITEM_INFO

Enumeration Type Documentation

◆ notification_mask

Enumerator
NOTIFY_MASK_ITEM_CHANGE 
NOTIFY_MASK_END_LABEL_EDIT 
NOTIFY_MASK_UNMASK_ALL 

Definition at line 210 of file listview.c.

Function Documentation

◆ CallWindowProcT()

static LRESULT CallWindowProcT ( WNDPROC  proc,
HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  isW 
)
inlinestatic

Definition at line 1581 of file listview.c.

1583 {
1584  if (isW) return CallWindowProcW(proc, hwnd, uMsg, wParam, lParam);
1585  else return CallWindowProcA(proc, hwnd, uMsg, wParam, lParam);
1586 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HANDLE proc()
Definition: pdb.c:32
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const WCHAR isW[]
Definition: tokenize.c:59
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

Referenced by EditLblWndProcT().

◆ column_fill_hditem()

static void column_fill_hditem ( const LISTVIEW_INFO infoPtr,
HDITEMW lphdi,
INT  nColumn,
const LVCOLUMNW lpColumn,
BOOL  isW 
)
static

Definition at line 8143 of file listview.c.

8145 {
8146  if (lpColumn->mask & LVCF_FMT)
8147  {
8148  /* format member is valid */
8149  lphdi->mask |= HDI_FORMAT;
8150 
8151  /* set text alignment (leftmost column must be left-aligned) */
8152  if (nColumn == 0 || (lpColumn->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT)
8153  lphdi->fmt |= HDF_LEFT;
8154  else if ((lpColumn->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_RIGHT)
8155  lphdi->fmt |= HDF_RIGHT;
8156  else if ((lpColumn->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_CENTER)
8157  lphdi->fmt |= HDF_CENTER;
8158 
8159  if (lpColumn->fmt & LVCFMT_BITMAP_ON_RIGHT)
8160  lphdi->fmt |= HDF_BITMAP_ON_RIGHT;
8161 
8162  if (lpColumn->fmt & LVCFMT_COL_HAS_IMAGES)
8163  {
8164  lphdi->fmt |= HDF_IMAGE;
8165  lphdi->iImage = I_IMAGECALLBACK;
8166  }
8167 
8168  if (lpColumn->fmt & LVCFMT_FIXED_WIDTH)
8169  lphdi->fmt |= HDF_FIXEDWIDTH;
8170  }
8171 
8172  if (lpColumn->mask & LVCF_WIDTH)
8173  {
8174  lphdi->mask |= HDI_WIDTH;
8175  if(lpColumn->cx == LVSCW_AUTOSIZE_USEHEADER)
8176  {
8177  /* make it fill the remainder of the controls width */
8178  RECT rcHeader;
8179  INT item_index;
8180 
8181  for(item_index = 0; item_index < (nColumn - 1); item_index++)
8182  {
8183  LISTVIEW_GetHeaderRect(infoPtr, item_index, &rcHeader);
8184  lphdi->cxy += rcHeader.right - rcHeader.left;
8185  }
8186 
8187  /* retrieve the layout of the header */
8188  GetClientRect(infoPtr->hwndSelf, &rcHeader);
8189  TRACE("start cxy=%d rcHeader=%s\n", lphdi->cxy, wine_dbgstr_rect(&rcHeader));
8190 
8191  lphdi->cxy = (rcHeader.right - rcHeader.left) - lphdi->cxy;
8192  }
8193  else
8194  lphdi->cxy = lpColumn->cx;
8195  }
8196 
8197  if (lpColumn->mask & LVCF_TEXT)
8198  {
8199  lphdi->mask |= HDI_TEXT | HDI_FORMAT;
8200  lphdi->fmt |= HDF_STRING;
8201  lphdi->pszText = lpColumn->pszText;
8202  lphdi->cchTextMax = textlenT(lpColumn->pszText, isW);
8203  }
8204 
8205  if (lpColumn->mask & LVCF_IMAGE)
8206  {
8207  lphdi->mask |= HDI_IMAGE;
8208  lphdi->iImage = lpColumn->iImage;
8209  }
8210 
8211  if (lpColumn->mask & LVCF_ORDER)
8212  {
8213  lphdi->mask |= HDI_ORDER;
8214  lphdi->iOrder = lpColumn->iOrder;
8215  }
8216 }
#define HDF_RIGHT
Definition: commctrl.h:710
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
#define LVCFMT_CENTER
Definition: commctrl.h:2596
int iImage
Definition: commctrl.h:687
int cxy
Definition: commctrl.h:681
#define LVCFMT_RIGHT
Definition: commctrl.h:2595
LPWSTR pszText
Definition: commctrl.h:682
#define LVCFMT_LEFT
Definition: commctrl.h:2594
static int textlenT(LPCWSTR text, BOOL isW)
Definition: listview.c:468
LONG left
Definition: windef.h:306
#define HDI_TEXT
Definition: commctrl.h:700
LONG right
Definition: windef.h:308
static void LISTVIEW_GetHeaderRect(const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc)
Definition: listview.c:1701
int32_t INT
Definition: typedefs.h:56
#define HDF_CENTER
Definition: commctrl.h:711
#define HDF_STRING
Definition: commctrl.h:716
int iOrder
Definition: commctrl.h:688
#define LVCFMT_COL_HAS_IMAGES
Definition: commctrl.h:2600
#define HDI_FORMAT
Definition: commctrl.h:701
int cchTextMax
Definition: commctrl.h:684
#define TRACE(s)
Definition: solgame.cpp:4
const char * wine_dbgstr_rect(const RECT *rect)
LPWSTR pszText
Definition: commctrl.h:2563
#define HDF_BITMAP_ON_RIGHT
Definition: commctrl.h:718
#define HDI_IMAGE
Definition: commctrl.h:704
static const WCHAR isW[]
Definition: tokenize.c:59
#define HDF_LEFT
Definition: commctrl.h:709
#define HDI_ORDER
Definition: commctrl.h:706
#define I_IMAGECALLBACK
Definition: commctrl.h:2381
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2582
#define LVCFMT_JUSTIFYMASK
Definition: commctrl.h:2597
#define LVSCW_AUTOSIZE_USEHEADER
Definition: commctrl.h:2641
#define LVCFMT_BITMAP_ON_RIGHT
Definition: commctrl.h:2599
UINT mask
Definition: commctrl.h:680
#define LVCF_IMAGE
Definition: commctrl.h:2586
#define HDF_IMAGE
Definition: commctrl.h:719
#define HDI_WIDTH
Definition: commctrl.h:698
int fmt
Definition: commctrl.h:685
#define LVCF_ORDER
Definition: commctrl.h:2587

Referenced by LISTVIEW_InsertColumnT(), and LISTVIEW_SetColumnT().

◆ CreateEditLabelT()

static HWND CreateEditLabelT ( LISTVIEW_INFO infoPtr,
LPCWSTR  text,
BOOL  isW 
)
static

Definition at line 6131 of file listview.c.

6132 {
6135  HWND hedit;
6136 
6137  TRACE("(%p, text=%s, isW=%d)\n", infoPtr, debugtext_t(text, isW), isW);
6138 
6139  /* window will be resized and positioned after LVN_BEGINLABELEDIT */
6140  if (isW)
6141  hedit = CreateWindowW(WC_EDITW, text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
6142  else
6143  hedit = CreateWindowA(WC_EDITA, (LPCSTR)text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
6144 
6145  if (!hedit) return 0;
6146 
6147  infoPtr->EditWndProc = (WNDPROC)
6150 
6151  SendMessageW(hedit, WM_SETFONT, (WPARAM)infoPtr->hFont, FALSE);
6153 
6154  return hedit;
6155 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WC_EDITW
Definition: commctrl.h:4683
const WCHAR * text
Definition: package.c:1827
#define EM_SETLIMITTEXT
Definition: winuser.h:1993
static LPCSTR debugtext_t(LPCWSTR text, BOOL isW)
Definition: listview.c:554
static LRESULT CALLBACK EditLblWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: listview.c:6114
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define WC_EDITA
Definition: commctrl.h:4682
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
const char * LPCSTR
Definition: xmlstorage.h:183
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE HINSTANCE
Definition: typedefs.h:75
static const WCHAR isW[]
Definition: tokenize.c:59
#define SetWindowLongPtrA
Definition: winuser.h:5320
WNDPROC EditWndProc
Definition: listview.c:267
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define WS_BORDER
Definition: pedump.c:625
static LRESULT CALLBACK EditLblWndProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: listview.c:6097
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFONT
Definition: winuser.h:1632
#define GWLP_HINSTANCE
Definition: winuser.h:850
static HINSTANCE hinst
Definition: edit.c:551
#define SetWindowLongPtrW
Definition: winuser.h:5321
#define DISP_TEXT_SIZE
Definition: listview.c:349
Arabic default style
Definition: afstyles.h:93
#define ES_LEFT
Definition: pedump.c:664
#define WS_VISIBLE
Definition: pedump.c:620
#define ES_AUTOHSCROLL
Definition: pedump.c:672

Referenced by LISTVIEW_EditLabelT().

◆ customdraw_fill()

static void customdraw_fill ( NMLVCUSTOMDRAW lpnmlvcd,
const LISTVIEW_INFO infoPtr,
HDC  hdc,
const RECT rcBounds,
const LVITEMW lplvItem 
)
static

Definition at line 1035 of file listview.c.

1037 {
1038  ZeroMemory(lpnmlvcd, sizeof(NMLVCUSTOMDRAW));
1039  lpnmlvcd->nmcd.hdc = hdc;
1040  lpnmlvcd->nmcd.rc = *rcBounds;
1041  lpnmlvcd->clrTextBk = infoPtr->clrTextBk;
1042  lpnmlvcd->clrText = infoPtr->clrText;
1043  if (!lplvItem) return;
1044  lpnmlvcd->nmcd.dwItemSpec = lplvItem->iItem + 1;
1045  lpnmlvcd->iSubItem = lplvItem->iSubItem;
1046  if (lplvItem->state & LVIS_SELECTED) lpnmlvcd->nmcd.uItemState |= CDIS_SELECTED;
1047  if (lplvItem->state & LVIS_FOCUSED) lpnmlvcd->nmcd.uItemState |= CDIS_FOCUS;
1048  if (lplvItem->iItem == infoPtr->nHotItem) lpnmlvcd->nmcd.uItemState |= CDIS_HOT;
1049  lpnmlvcd->nmcd.lItemlParam = lplvItem->lParam;
1050 }
#define ZeroMemory
Definition: winbase.h:1642
COLORREF clrText
Definition: commctrl.h:3059
NMCUSTOMDRAW nmcd
Definition: commctrl.h:3058
int iSubItem
Definition: commctrl.h:2358
LPARAM lParam
Definition: commctrl.h:2364
#define LVIS_SELECTED
Definition: commctrl.h:2315
#define CDIS_SELECTED
Definition: commctrl.h:287
#define CDIS_HOT
Definition: commctrl.h:293
#define CDIS_FOCUS
Definition: commctrl.h:291
HDC hdc
Definition: main.c:9
COLORREF clrTextBk
Definition: listview.c:301
UINT state
Definition: commctrl.h:2359
DWORD_PTR dwItemSpec
Definition: commctrl.h:303
COLORREF clrText
Definition: listview.c:300
COLORREF clrTextBk
Definition: commctrl.h:3060
#define LVIS_FOCUSED
Definition: commctrl.h:2314

Referenced by LISTVIEW_DrawItem(), LISTVIEW_Refresh(), and LISTVIEW_RefreshOwnerDraw().

◆ debug_getbuf()

static char* debug_getbuf ( void  )
static

Definition at line 567 of file listview.c.

568 {
569  static int index = 0;
571  return buffers[index++ % DEBUG_BUFFERS];
572 }
const GLuint * buffers
Definition: glext.h:5916
#define DEBUG_BUFFER_SIZE
Definition: listview.c:343
GLuint index
Definition: glext.h:6031
#define DEBUG_BUFFERS
Definition: listview.c:341

Referenced by debuglvcolumn_t(), debuglvitem_t(), and debugscrollinfo().

◆ debuglvcolumn_t()

static const char* debuglvcolumn_t ( const LVCOLUMNW lpColumn,
BOOL  isW 
)
static

Definition at line 668 of file listview.c.

669 {
670  char* buf = debug_getbuf(), *text = buf;
671  int len, size = DEBUG_BUFFER_SIZE;
672 
673  if (lpColumn == NULL) return "(null)";
674  len = snprintf(buf, size, "{");
675  if (len == -1) goto end;
676  buf += len; size -= len;
677  if (lpColumn->mask & LVCF_SUBITEM)
678  len = snprintf(buf, size, "iSubItem=%d, ", lpColumn->iSubItem);
679  else len = 0;
680  if (len == -1) goto end;
681  buf += len; size -= len;
682  if (lpColumn->mask & LVCF_FMT)
683  len = snprintf(buf, size, "fmt=%x, ", lpColumn->fmt);
684  else len = 0;
685  if (len == -1) goto end;
686  buf += len; size -= len;
687  if (lpColumn->mask & LVCF_WIDTH)
688  len = snprintf(buf, size, "cx=%d, ", lpColumn->cx);
689  else len = 0;
690  if (len == -1) goto end;
691  buf += len; size -= len;
692  if (lpColumn->mask & LVCF_TEXT)
693  len = snprintf(buf, size, "pszText=%s, cchTextMax=%d, ", debugtext_tn(lpColumn->pszText, isW, 80), lpColumn->cchTextMax);
694  else len = 0;
695  if (len == -1) goto end;
696  buf += len; size -= len;
697  if (lpColumn->mask & LVCF_IMAGE)
698  len = snprintf(buf, size, "iImage=%d, ", lpColumn->iImage);
699  else len = 0;
700  if (len == -1) goto end;
701  buf += len; size -= len;
702  if (lpColumn->mask & LVCF_ORDER)
703  len = snprintf(buf, size, "iOrder=%d, ", lpColumn->iOrder);
704  else len = 0;
705  if (len == -1) goto end;
706  buf += len;
707  goto undo;
708 end:
709  buf = text + strlen(text);
710 undo:
711  if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; }
712  return text;
713 }
static char * debug_getbuf(void)
Definition: listview.c:567
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const WCHAR * text
Definition: package.c:1827
#define snprintf
Definition: wintirpc.h:48
GLuint GLuint end
Definition: gl.h:1545
#define DEBUG_BUFFER_SIZE
Definition: listview.c:343
#define LVCF_SUBITEM
Definition: commctrl.h:2585
smooth NULL
Definition: ftsmooth.c:416
static LPCSTR debugtext_tn(LPCWSTR text, BOOL isW, INT n)
Definition: listview.c:560
GLsizeiptr size
Definition: glext.h:5919
LPWSTR pszText
Definition: commctrl.h:2563
static const WCHAR isW[]
Definition: tokenize.c:59
GLenum GLsizei len
Definition: glext.h:6722
int cchTextMax
Definition: commctrl.h:2564
#define LVCF_FMT
Definition: commctrl.h:2582
#define LVCF_IMAGE
Definition: commctrl.h:2586
#define LVCF_ORDER
Definition: commctrl.h:2587

Referenced by LISTVIEW_InsertColumnT(), and LISTVIEW_SetColumnT().

◆ debuglvhittestinfo()

static const char* debuglvhittestinfo ( const LVHITTESTINFO lpht)
static

Definition at line 715 of file listview.c.

716 {
717  if (!lpht) return "(null)";
718 
719  return wine_dbg_sprintf("{pt=%s, flags=0x%x, iItem=%d, iSubItem=%d}",
720  wine_dbgstr_point(&lpht->pt), lpht->flags, lpht->iItem, lpht->iSubItem);
721 }
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:271
const char * wine_dbgstr_point(const POINT *guid)

Referenced by notify_click().

◆ debuglvitem_t()

static const char* debuglvitem_t ( const LVITEMW lpLVItem,
BOOL  isW 
)
static

Definition at line 626 of file listview.c.

627 {
628  char* buf = debug_getbuf(), *text = buf;
629  int len, size = DEBUG_BUFFER_SIZE;
630 
631  if (lpLVItem == NULL) return "(null)";
632  len = snprintf(buf, size, "{iItem=%d, iSubItem=%d, ", lpLVItem->iItem, lpLVItem->iSubItem);
633  if (len == -1) goto end;
634  buf += len; size -= len;
635  if (lpLVItem->mask & LVIF_STATE)
636  len = snprintf(buf, size, "state=%x, stateMask=%x, ", lpLVItem->state, lpLVItem->stateMask);
637  else len = 0;
638  if (len == -1) goto end;
639  buf += len; size -= len;
640  if (lpLVItem->mask & LVIF_TEXT)
641  len = snprintf(buf, size, "pszText=%s, cchTextMax=%d, ", debugtext_tn(lpLVItem->pszText, isW, 80), lpLVItem->cchTextMax);
642  else len = 0;
643  if (len == -1) goto end;
644  buf += len; size -= len;
645  if (lpLVItem->mask & LVIF_IMAGE)
646  len = snprintf(buf, size, "iImage=%d, ", lpLVItem->iImage);
647  else len = 0;
648  if (len == -1) goto end;
649  buf += len; size -= len;
650  if (lpLVItem->mask & LVIF_PARAM)
651  len = snprintf(buf, size, "lParam=%lx, ", lpLVItem->lParam);
652  else len = 0;
653  if (len == -1) goto end;
654  buf += len; size -= len;
655  if (lpLVItem->mask & LVIF_INDENT)
656  len = snprintf(buf, size, "iIndent=%d, ", lpLVItem->iIndent);
657  else len = 0;
658  if (len == -1) goto end;
659  buf += len;
660  goto undo;
661 end:
662  buf = text + strlen(text);
663 undo:
664  if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; }
665  return text;
666 }
int iImage
Definition: commctrl.h:2363
static char * debug_getbuf(void)
Definition: listview.c:567
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const WCHAR * text
Definition: package.c:1827
#define snprintf
Definition: wintirpc.h:48
GLuint GLuint end
Definition: gl.h:1545
#define DEBUG_BUFFER_SIZE
Definition: listview.c:343
UINT stateMask
Definition: commctrl.h:2360
#define LVIF_TEXT
Definition: commctrl.h:2305
int cchTextMax
Definition: commctrl.h:2362
int iSubItem
Definition: commctrl.h:2358
LPARAM lParam
Definition: commctrl.h:2364
smooth NULL
Definition: ftsmooth.c:416
#define LVIF_INDENT
Definition: commctrl.h:2309
static LPCSTR debugtext_tn(LPCWSTR text, BOOL isW, INT n)
Definition: listview.c:560
GLsizeiptr size
Definition: glext.h:5919
LPWSTR pszText
Definition: commctrl.h:2361
#define LVIF_IMAGE
Definition: commctrl.h:2306
UINT mask
Definition: commctrl.h:2356
static const WCHAR isW[]
Definition: tokenize.c:59
GLenum GLsizei len
Definition: glext.h:6722
UINT state
Definition: commctrl.h:2359
#define LVIF_PARAM
Definition: commctrl.h:2307
#define LVIF_STATE
Definition: commctrl.h:2308
int iIndent
Definition: commctrl.h:2365

Referenced by LISTVIEW_DrawItem(), LISTVIEW_GetItemMetrics(), LISTVIEW_GetItemT(), LISTVIEW_InsertItemT(), LISTVIEW_RefreshOwnerDraw(), LISTVIEW_SetItemState(), LISTVIEW_SetItemT(), LISTVIEW_SetItemTextT(), and notify_dispinfoT().

◆ debugnmlistview()

static const char* debugnmlistview ( const NMLISTVIEW plvnm)
static

Definition at line 617 of file listview.c.

618 {
619  if (!plvnm) return "(null)";
620  return wine_dbg_sprintf("iItem=%d, iSubItem=%d, uNewState=0x%x,"
621  " uOldState=0x%x, uChanged=0x%x, ptAction=%s, lParam=%ld",
622  plvnm->iItem, plvnm->iSubItem, plvnm->uNewState, plvnm->uOldState,
623  plvnm->uChanged, wine_dbgstr_point(&plvnm->ptAction), plvnm->lParam);
624 }
UINT uNewState
Definition: commctrl.h:3032
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:271
UINT uOldState
Definition: commctrl.h:3033
const char * wine_dbgstr_point(const POINT *guid)
POINT ptAction
Definition: commctrl.h:3035
LPARAM lParam
Definition: commctrl.h:3036

Referenced by notify_listview().

◆ debugrange()

static const char* debugrange ( const RANGE lprng)
inlinestatic

Definition at line 574 of file listview.c.

575 {
576  if (!lprng) return "(null)";
577  return wine_dbg_sprintf("[%d, %d]", lprng->lower, lprng->upper);
578 }
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:271

Referenced by iterator_frameditems_absolute(), ranges_add(), ranges_cmp(), ranges_del(), and ranges_dump().

◆ debugscrollcode()

static LPCSTR debugscrollcode ( int  nScrollCode)
inlinestatic

Definition at line 724 of file listview.c.

725 {
726  switch(nScrollCode)
727  {
728  case SB_LINELEFT: return "SB_LINELEFT";
729  case SB_LINERIGHT: return "SB_LINERIGHT";
730  case SB_PAGELEFT: return "SB_PAGELEFT";
731  case SB_PAGERIGHT: return "SB_PAGERIGHT";
732  case SB_THUMBPOSITION: return "SB_THUMBPOSITION";
733  case SB_THUMBTRACK: return "SB_THUMBTRACK";
734  case SB_ENDSCROLL: return "SB_ENDSCROLL";
735  case SB_INTERNAL: return "SB_INTERNAL";
736  default: return "unknown";
737  }
738 }
#define SB_THUMBPOSITION
Definition: winuser.h:572
#define SB_ENDSCROLL
Definition: winuser.h:574
#define SB_THUMBTRACK
Definition: winuser.h:573
#define SB_PAGELEFT
Definition: winuser.h:570
#define SB_LINERIGHT
Definition: winuser.h:567
#define SB_PAGERIGHT
Definition: winuser.h:571
#define SB_INTERNAL
Definition: listview.c:346
#define SB_LINELEFT
Definition: winuser.h:566

Referenced by LISTVIEW_HScroll(), and LISTVIEW_VScroll().

◆ debugscrollinfo()

static const char* debugscrollinfo ( const SCROLLINFO pScrollInfo)
static

Definition at line 580 of file listview.c.

581 {
582  char* buf = debug_getbuf(), *text = buf;
583  int len, size = DEBUG_BUFFER_SIZE;
584 
585  if (pScrollInfo == NULL) return "(null)";
586  len = snprintf(buf, size, "{cbSize=%u, ", pScrollInfo->cbSize);
587  if (len == -1) goto end;
588  buf += len; size -= len;
589  if (pScrollInfo->fMask & SIF_RANGE)
590  len = snprintf(buf, size, "nMin=%d, nMax=%d, ", pScrollInfo->nMin, pScrollInfo->nMax);
591  else len = 0;
592  if (len == -1) goto end;
593  buf += len; size -= len;
594  if (pScrollInfo->fMask & SIF_PAGE)
595  len = snprintf(buf, size, "nPage=%u, ", pScrollInfo->nPage);
596  else len = 0;
597  if (len == -1) goto end;
598  buf += len; size -= len;
599  if (pScrollInfo->fMask & SIF_POS)
600  len = snprintf(buf, size, "nPos=%d, ", pScrollInfo->nPos);
601  else len = 0;
602  if (len == -1) goto end;
603  buf += len; size -= len;
604  if (pScrollInfo->fMask & SIF_TRACKPOS)
605  len = snprintf(buf, size, "nTrackPos=%d, ", pScrollInfo->nTrackPos);
606  else len = 0;
607  if (len == -1) goto end;
608  buf += len;
609  goto undo;
610 end:
611  buf = text + strlen(text);
612 undo:
613  if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; }
614  return text;
615 }
static char * debug_getbuf(void)
Definition: listview.c:567
#define SIF_RANGE
Definition: winuser.h:1221
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const WCHAR * text
Definition: package.c:1827
#define snprintf
Definition: wintirpc.h:48
GLuint GLuint end
Definition: gl.h:1545
#define SIF_PAGE
Definition: winuser.h:1219
#define DEBUG_BUFFER_SIZE
Definition: listview.c:343
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei len
Definition: glext.h:6722
#define SIF_POS
Definition: winuser.h:1220
#define SIF_TRACKPOS
Definition: winuser.h:1223

Referenced by LISTVIEW_UpdateHScroll(), and LISTVIEW_UpdateVScroll().

◆ debugtext_t()

static LPCSTR debugtext_t ( LPCWSTR  text,
BOOL  isW 
)
inlinestatic

Definition at line 554 of file listview.c.

555 {
556  if (text == LPSTR_TEXTCALLBACKW) return "(callback)";
557  return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
558 }
const WCHAR * text
Definition: package.c:1827
#define debugstr_w
Definition: kernel32.h:32
const char * LPCSTR
Definition: xmlstorage.h:183
#define debugstr_a
Definition: kernel32.h:31
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2376
static const WCHAR isW[]
Definition: tokenize.c:59

Referenced by CreateEditLabelT(), LISTVIEW_EditLabelT(), and LISTVIEW_EndEditLabelT().

◆ debugtext_tn()

static LPCSTR debugtext_tn ( LPCWSTR  text,
BOOL  isW,
INT  n 
)
inlinestatic

Definition at line 560 of file listview.c.

561 {
562  if (text == LPSTR_TEXTCALLBACKW) return "(callback)";
563  n = min(textlenT(text, isW), n);
564  return isW ? debugstr_wn(text, n) : debugstr_an((LPCSTR)text, n);
565 }
const WCHAR * text
Definition: package.c:1827
GLdouble n
Definition: glext.h:7729
static int textlenT(LPCWSTR text, BOOL isW)
Definition: listview.c:468
const char * LPCSTR
Definition: xmlstorage.h:183
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2376
static const WCHAR isW[]
Definition: tokenize.c:59
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:47
#define debugstr_wn
Definition: kernel32.h:33
#define min(a, b)
Definition: monoChain.cc:55

Referenced by debuglvcolumn_t(), and debuglvitem_t().

◆ EditLblWndProcA()

static LRESULT CALLBACK EditLblWndProcA ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 6114 of file listview.c.

6115 {
6116  return EditLblWndProcT(hwnd, uMsg, wParam, lParam, FALSE);
6117 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WPARAM wParam
Definition: combotst.c:138
static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW)
Definition: listview.c:6043
LPARAM lParam
Definition: combotst.c:139

Referenced by CreateEditLabelT().

◆ EditLblWndProcT()

static LRESULT EditLblWndProcT ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  isW 
)
static

Definition at line 6043 of file listview.c.

6044 {
6046  BOOL save = TRUE;
6047 
6048  TRACE("(hwnd=%p, uMsg=%x, wParam=%lx, lParam=%lx, isW=%d)\n",
6049  hwnd, uMsg, wParam, lParam, isW);
6050 
6051  switch (uMsg)
6052  {
6053  case WM_GETDLGCODE:
6055 
6056  case WM_DESTROY:
6057  {
6058  WNDPROC editProc = infoPtr->EditWndProc;
6059  infoPtr->EditWndProc = 0;
6061  return CallWindowProcT(editProc, hwnd, uMsg, wParam, lParam, isW);
6062  }
6063 
6064  case WM_KEYDOWN:
6065  if (VK_ESCAPE == (INT)wParam)
6066  {
6067  save = FALSE;
6068  break;
6069  }
6070  else if (VK_RETURN == (INT)wParam)
6071  break;
6072 
6073  default:
6074  return CallWindowProcT(infoPtr->EditWndProc, hwnd, uMsg, wParam, lParam, isW);
6075  }
6076 
6077  /* kill the edit */
6078  if (infoPtr->hwndEdit)
6079  LISTVIEW_EndEditLabelT(infoPtr, save, isW);
6080 
6081  SendMessageW(hwnd, WM_CLOSE, 0, 0);
6082  return 0;
6083 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define WM_GETDLGCODE
Definition: winuser.h:1671
static LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW)
Definition: listview.c:1581
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define VK_ESCAPE
Definition: winuser.h:2189
int32_t INT
Definition: typedefs.h:56
#define VK_RETURN
Definition: winuser.h:2176
WPARAM wParam
Definition: combotst.c:138
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_KEYDOWN
Definition: winuser.h:1697
#define WM_DESTROY
Definition: winuser.h:1591
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_CLOSE
Definition: winuser.h:1603
static const WCHAR isW[]
Definition: tokenize.c:59
WNDPROC EditWndProc
Definition: listview.c:267
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define DLGC_WANTALLKEYS
Definition: winuser.h:2587
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *, BOOL, BOOL)
Definition: listview.c:5924
#define SetWindowLongPtrW
Definition: winuser.h:5321
LPARAM lParam
Definition: combotst.c:139
#define DLGC_WANTARROWS
Definition: winuser.h:2585

Referenced by EditLblWndProcA(), and EditLblWndProcW().

◆ EditLblWndProcW()

static LRESULT CALLBACK EditLblWndProcW ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 6097 of file listview.c.

6098 {
6099  return EditLblWndProcT(hwnd, uMsg, wParam, lParam, TRUE);
6100 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW)
Definition: listview.c:6043
LPARAM lParam
Definition: combotst.c:139

Referenced by CreateEditLabelT().

◆ get_ansi_notification()

static int get_ansi_notification ( UINT  unicodeNotificationCode)
static

Definition at line 743 of file listview.c.

744 {
745  switch (unicodeNotificationCode)
746  {
747  case LVN_BEGINLABELEDITA:
749  case LVN_ENDLABELEDITA:
751  case LVN_GETDISPINFOA:
752  case LVN_GETDISPINFOW: return LVN_GETDISPINFOA;
753  case LVN_SETDISPINFOA:
754  case LVN_SETDISPINFOW: return LVN_SETDISPINFOA;
755  case LVN_ODFINDITEMA:
756  case LVN_ODFINDITEMW: return LVN_ODFINDITEMA;
757  case LVN_GETINFOTIPA:
758  case LVN_GETINFOTIPW: return LVN_GETINFOTIPA;
759  /* header forwards */
760  case HDN_TRACKA:
761  case HDN_TRACKW: return HDN_TRACKA;
762  case HDN_ENDTRACKA:
763  case HDN_ENDTRACKW: return HDN_ENDTRACKA;
764  case HDN_BEGINDRAG: return HDN_BEGINDRAG;
765  case HDN_ENDDRAG: return HDN_ENDDRAG;
766  case HDN_ITEMCHANGINGA:
768  case HDN_ITEMCHANGEDA:
769  case HDN_ITEMCHANGEDW: return HDN_ITEMCHANGEDA;
770  case HDN_ITEMCLICKA:
771  case HDN_ITEMCLICKW: return HDN_ITEMCLICKA;
774  default: break;
775  }
776  FIXME("unknown notification %x\n", unicodeNotificationCode);
777  return unicodeNotificationCode;
778 }
#define HDN_ITEMCLICKW
Definition: commctrl.h:838
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:833
#define LVN_GETDISPINFOA
Definition: commctrl.h:3149
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:835
#define LVN_SETDISPINFOW
Definition: commctrl.h:3152
#define LVN_GETDISPINFOW
Definition: commctrl.h:3150
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:834
#define FIXME(fmt,...)
Definition: debug.h:110
#define LVN_GETINFOTIPW
Definition: commctrl.h:3219
#define LVN_BEGINLABELEDITW
Definition: commctrl.h:3132
#define LVN_ODFINDITEMW
Definition: commctrl.h:3141
#define HDN_ENDTRACKA
Definition: commctrl.h:845
#define HDN_TRACKW
Definition: commctrl.h:848
#define HDN_ITEMCLICKA
Definition: commctrl.h:837
#define HDN_ENDTRACKW
Definition: commctrl.h:846
#define LVN_ODFINDITEMA
Definition: commctrl.h:3140
#define HDN_TRACKA
Definition: commctrl.h:847
#define HDN_ENDDRAG
Definition: commctrl.h:852
#define HDN_DIVIDERDBLCLICKA
Definition: commctrl.h:841
#define LVN_ENDLABELEDITW
Definition: commctrl.h:3134
#define LVN_ENDLABELEDITA
Definition: commctrl.h:3133
#define HDN_BEGINDRAG
Definition: commctrl.h:851
#define LVN_BEGINLABELEDITA
Definition: commctrl.h:3131
#define LVN_SETDISPINFOA
Definition: commctrl.h:3151
#define HDN_DIVIDERDBLCLICKW
Definition: commctrl.h:842
#define LVN_GETINFOTIPA
Definition: commctrl.h:3218
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:836

Referenced by notify_dispinfoT(), and notify_forward_header().

◆ get_next_itemid()

static DWORD get_next_itemid ( const LISTVIEW_INFO infoPtr)
static

Definition at line 1628 of file listview.c.

1629 {
1630  INT count = DPA_GetPtrCount(infoPtr->hdpaItemIds);
1631 
1632  if (count > 0)
1633  {
1634  ITEM_ID *lpID = DPA_GetPtr(infoPtr->hdpaItemIds, count - 1);
1635  return lpID->id + 1;
1636  }
1637  return 0;
1638 }
UINT id
Definition: listview.c:180
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4951
#define DPA_GetPtr
Definition: commctrl.h:5

Referenced by LISTVIEW_InsertItemT().

◆ is_assignable_item()

static BOOL is_assignable_item ( const LVITEMW lpLVItem,
LONG  lStyle 
)
inlinestatic

Definition at line 4213 of file listview.c.

4214 {
4215  if ( (lpLVItem->mask & LVIF_TEXT) &&
4216  (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) &&
4217  (lStyle & (LVS_SORTASCENDING | LVS_SORTDESCENDING)) ) return FALSE;
4218 
4219  return TRUE;
4220 }
#define TRUE
Definition: types.h:120
#define LVS_SORTDESCENDING
Definition: commctrl.h:2265
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVS_SORTASCENDING
Definition: commctrl.h:2264
LPWSTR pszText
Definition: commctrl.h:2361
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2376
UINT mask
Definition: commctrl.h:2356

Referenced by LISTVIEW_InsertItemT(), and LISTVIEW_SetItemT().

◆ is_autoarrange()

static BOOL is_autoarrange ( const LISTVIEW_INFO infoPtr)
inlinestatic

Definition at line 1588 of file listview.c.

1589 {
1590  return (infoPtr->dwStyle & LVS_AUTOARRANGE) &&
1591  (infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON);
1592 }
#define LVS_AUTOARRANGE
Definition: commctrl.h:2268
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2838
#define LV_VIEW_ICON
Definition: commctrl.h:2836

Referenced by LISTVIEW_GetNextItem(), LISTVIEW_ScrollOnInsert(), LISTVIEW_SetRedraw(), LISTVIEW_Size(), and LISTVIEW_Update().

◆ is_redrawing()

◆ is_text()

static BOOL is_text ( LPCWSTR  text)
inlinestatic

◆ iterator_destroy()

static void iterator_destroy ( const ITERATOR i)
inlinestatic

Definition at line 1309 of file listview.c.

1310 {
1311  ranges_destroy(i->ranges);
1312 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void ranges_destroy(RANGES ranges)
Definition: listview.c:3181

Referenced by LISTVIEW_DeselectAllSkipItems(), LISTVIEW_HitTest(), LISTVIEW_InvalidateSelectedItems(), LISTVIEW_MarqueeHighlight(), LISTVIEW_Refresh(), LISTVIEW_RefreshReport(), LISTVIEW_RefreshReportGrid(), and LISTVIEW_SetGroupSelection().

◆ iterator_empty()

static void iterator_empty ( ITERATOR i)
inlinestatic

Definition at line 1317 of file listview.c.

1318 {
1319  ZeroMemory(i, sizeof(*i));
1320  i->nItem = i->nSpecial = i->range.lower = i->range.upper = -1;
1321 }
#define ZeroMemory
Definition: winbase.h:1642
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by iterator_frameditems_absolute(), iterator_rangeitems(), iterator_rangesitems(), and iterator_visibleitems().

◆ iterator_frameditems()

static BOOL iterator_frameditems ( ITERATOR i,
const LISTVIEW_INFO infoPtr,
const RECT lprc 
)
static

Definition at line 1446 of file listview.c.

1447 {
1448  RECT frame = *lprc;
1449  POINT Origin;
1450 
1451  TRACE("(lprc=%s)\n", wine_dbgstr_rect(lprc));
1452 
1453  LISTVIEW_GetOrigin(infoPtr, &Origin);
1454  OffsetRect(&frame, -Origin.x, -Origin.y);
1455 
1456  return iterator_frameditems_absolute(i, infoPtr, &frame);
1457 }
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4440
long y
Definition: polytest.cpp:48
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
long x
Definition: polytest.cpp:48
static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *, LPPOINT)
Definition: listview.c:7590
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4
const char * wine_dbgstr_rect(const RECT *rect)
static BOOL iterator_frameditems_absolute(ITERATOR *i, const LISTVIEW_INFO *infoPtr, const RECT *frame)
Definition: listview.c:1347

Referenced by iterator_visibleitems(), LISTVIEW_HitTest(), LISTVIEW_InvalidateSelectedItems(), and LISTVIEW_SetGroupSelection().

◆ iterator_frameditems_absolute()

static BOOL iterator_frameditems_absolute ( ITERATOR i,
const LISTVIEW_INFO infoPtr,
const RECT frame 
)
static

Definition at line 1347 of file listview.c.

1348 {
1349  RECT rcItem, rcTemp;
1350  RANGES ranges;
1351 
1352  TRACE("(frame=%s)\n", wine_dbgstr_rect(frame));
1353 
1354  /* in case we fail, we want to return an empty iterator */
1355  iterator_empty(i);
1356 
1357  if (infoPtr->nItemCount == 0)
1358  return TRUE;
1359 
1360  if (infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON)
1361  {
1362  INT nItem;
1363 
1364  if (infoPtr->uView == LV_VIEW_ICON && infoPtr->nFocusedItem != -1)
1365  {
1366  LISTVIEW_GetItemBox(infoPtr, infoPtr->nFocusedItem, &rcItem);
1367  if (IntersectRect(&rcTemp, &rcItem, frame))
1368  i->nSpecial = infoPtr->nFocusedItem;
1369  }
1370  if (!(ranges = ranges_create(50))) return FALSE;
1371  iterator_rangesitems(i, ranges);
1372  /* to do better here, we need to have PosX, and PosY sorted */
1373  TRACE("building icon ranges:\n");
1374  for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
1375  {
1376  rcItem.left = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
1377  rcItem.top = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
1378  rcItem.right = rcItem.left + infoPtr->nItemWidth;
1379  rcItem.bottom = rcItem.top + infoPtr->nItemHeight;
1380  if (IntersectRect(&rcTemp, &rcItem, frame))
1381  ranges_additem(i->ranges, nItem);
1382  }
1383  return TRUE;
1384  }
1385  else if (infoPtr->uView == LV_VIEW_DETAILS)
1386  {
1387  RANGE range;
1388 
1389  if (frame->left >= infoPtr->nItemWidth) return TRUE;
1390  if (frame->top >= infoPtr->nItemHeight * infoPtr->nItemCount) return TRUE;
1391 
1392  range.lower = max(frame->top / infoPtr->nItemHeight, 0);
1393  range.upper = min((frame->bottom - 1) / infoPtr->nItemHeight, infoPtr->nItemCount - 1) + 1;
1394  if (range.upper <= range.lower) return TRUE;
1396  TRACE(" report=%s\n", debugrange(&i->range));
1397  }
1398  else
1399  {
1400  INT nPerCol = max((infoPtr->rcList.bottom - infoPtr->rcList.top) / infoPtr->nItemHeight, 1);
1401  INT nFirstRow = max(frame->top / infoPtr->nItemHeight, 0);
1402  INT nLastRow = min((frame->bottom - 1) / infoPtr->nItemHeight, nPerCol - 1);
1403  INT nFirstCol;
1404  INT nLastCol;
1405  INT lower;
1406  RANGE item_range;
1407  INT nCol;
1408 
1409  if (infoPtr->nItemWidth)
1410  {
1411  nFirstCol = max(frame->left / infoPtr->nItemWidth, 0);
1412  nLastCol = min((frame->right - 1) / infoPtr->nItemWidth, (infoPtr->nItemCount + nPerCol - 1) / nPerCol);
1413  }
1414  else
1415  {
1416  nFirstCol = max(frame->left, 0);
1417  nLastCol = min(frame->right - 1, (infoPtr->nItemCount + nPerCol - 1) / nPerCol);
1418  }
1419 
1420  lower = nFirstCol * nPerCol + nFirstRow;
1421 
1422  TRACE("nPerCol=%d, nFirstRow=%d, nLastRow=%d, nFirstCol=%d, nLastCol=%d, lower=%d\n",
1423  nPerCol, nFirstRow, nLastRow, nFirstCol, nLastCol, lower);
1424 
1425  if (nLastCol < nFirstCol || nLastRow < nFirstRow) return TRUE;
1426 
1427  if (!(ranges = ranges_create(nLastCol - nFirstCol + 1))) return FALSE;
1428  iterator_rangesitems(i, ranges);
1429  TRACE("building list ranges:\n");
1430  for (nCol = nFirstCol; nCol <= nLastCol; nCol++)
1431  {
1432  item_range.lower = nCol * nPerCol + nFirstRow;
1433  if(item_range.lower >= infoPtr->nItemCount) break;
1434  item_range.upper = min(nCol * nPerCol + nLastRow + 1, infoPtr->nItemCount);
1435  TRACE(" list=%s\n", debugrange(&item_range));
1436  ranges_add(i->ranges, item_range);
1437  }
1438  }
1439 
1440  return TRUE;
1441 }
static BOOL ranges_additem(RANGES ranges, INT nItem)
Definition: listview.c:1139
#define LONG_PTR
Definition: treelist.c:79
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
LONG top
Definition: windef.h:307
static void iterator_rangeitems(ITERATOR *i, RANGE range)
Definition: listview.c:1326
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const char * debugrange(const RANGE *lprng)
Definition: listview.c:574
#define LV_VIEW_DETAILS
Definition: commctrl.h:2837
#define TRACE(s)
Definition: solgame.cpp:4
const char * wine_dbgstr_rect(const RECT *rect)
static void iterator_empty(ITERATOR *i)
Definition: listview.c:1317
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2838
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
GLenum GLint * range
Definition: glext.h:7539
static RANGES ranges_create(int count)
Definition: listview.c:3161
#define LV_VIEW_ICON
Definition: commctrl.h:2836
#define DPA_GetPtr
Definition: commctrl.h:5
#define min(a, b)
Definition: monoChain.cc:55
static void iterator_rangesitems(ITERATOR *i, RANGES ranges)
Definition: listview.c:1337
LONG bottom
Definition: windef.h:309
static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:2612
static BOOL ranges_add(RANGES ranges, RANGE range)
Definition: listview.c:3274

Referenced by iterator_frameditems(), and LISTVIEW_MarqueeHighlight().

◆ iterator_next()

static BOOL iterator_next ( ITERATOR i)
inlinestatic

Definition at line 1214 of file listview.c.

1215 {
1216  if (i->nItem == -1)
1217  {
1218  i->nItem = i->nSpecial;
1219  if (i->nItem != -1) return TRUE;
1220  }
1221  if (i->nItem == i->nSpecial)
1222  {
1223  if (i->ranges) i->index = 0;
1224  goto pickarange;
1225  }
1226 
1227  i->nItem++;
1228 testitem:
1229  if (i->nItem == i->nSpecial) i->nItem++;
1230  if (i->nItem < i->range.upper) return TRUE;
1231 
1232 pickarange:
1233  if (i->ranges)
1234  {
1235  if (i->index < DPA_GetPtrCount(i->ranges->hdpa))
1236  i->range = *(RANGE*)DPA_GetPtr(i->ranges->hdpa, i->index++);
1237  else goto end;
1238  }
1239  else if (i->nItem >= i->range.upper) goto end;
1240 
1241  i->nItem = i->range.lower;
1242  if (i->nItem >= 0) goto testitem;
1243 end:
1244  i->nItem = -1;
1245  return FALSE;
1246 }
#define TRUE
Definition: types.h:120
GLuint GLuint end
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4951
#define DPA_GetPtr
Definition: commctrl.h:5

Referenced by iterator_remove_common_items(), iterator_visibleitems(), LISTVIEW_DeselectAllSkipItems(), LISTVIEW_DrawItem(), LISTVIEW_HitTest(), LISTVIEW_InvalidateSelectedItems(), LISTVIEW_MarqueeHighlight(), LISTVIEW_RefreshOwnerDraw(), LISTVIEW_RefreshReport(), LISTVIEW_RefreshReportGrid(), and LISTVIEW_SetGroupSelection().

◆ iterator_prev()

static BOOL iterator_prev ( ITERATOR i)
inlinestatic

Definition at line 1254 of file listview.c.

1255 {
1256  BOOL start = FALSE;
1257 
1258  if (i->nItem == -1)
1259  {
1260  start = TRUE;
1261  if (i->ranges) i->index = DPA_GetPtrCount(i->ranges->hdpa);
1262  goto pickarange;
1263  }
1264  if (i->nItem == i->nSpecial)
1265  {
1266  i->nItem = -1;
1267  return FALSE;
1268  }
1269 
1270 testitem:
1271  i->nItem--;
1272  if (i->nItem == i->nSpecial) i->nItem--;
1273  if (i->nItem >= i->range.lower) return TRUE;
1274 
1275 pickarange:
1276  if (i->ranges)
1277  {
1278  if (i->index > 0)
1279  i->range = *(RANGE*)DPA_GetPtr(i->ranges->hdpa, --i->index);
1280  else goto end;
1281  }
1282  else if (!start && i->nItem < i->range.lower) goto end;
1283 
1284  i->nItem = i->range.upper;
1285  if (i->nItem > 0) goto testitem;
1286 end:
1287  return (i->nItem = i->nSpecial) != -1;
1288 }
#define TRUE
Definition: types.h:120
GLuint GLuint end
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4951
#define DPA_GetPtr
Definition: commctrl.h:5
GLuint start
Definition: gl.h:1545

Referenced by iterator_remove_common_items(), and LISTVIEW_RefreshList().

◆ iterator_range()

static RANGE iterator_range ( const ITERATOR i)
static

Definition at line 1290 of file listview.c.

1291 {
1292  RANGE range;
1293 
1294  if (!i->ranges) return i->range;
1295 
1296  if (DPA_GetPtrCount(i->ranges->hdpa) > 0)
1297  {
1298  range.lower = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, 0)).lower;
1299  range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, DPA_GetPtrCount(i->ranges->hdpa) - 1)).upper;
1300  }
1301  else range.lower = range.upper = 0;
1302 
1303  return range;
1304 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4951
GLenum GLint * range
Definition: glext.h:7539
#define DPA_GetPtr
Definition: commctrl.h:5

Referenced by LISTVIEW_Refresh().

◆ iterator_rangeitems()

static void iterator_rangeitems ( ITERATOR i,
RANGE  range 
)
inlinestatic

Definition at line 1326 of file listview.c.

1327 {
1328  iterator_empty(i);
1329  i->range = range;
1330 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void iterator_empty(ITERATOR *i)
Definition: listview.c:1317
GLenum GLint * range
Definition: glext.h:7539

Referenced by iterator_frameditems_absolute().

◆ iterator_rangesitems()

static void iterator_rangesitems ( ITERATOR i,
RANGES  ranges 
)
inlinestatic

Definition at line 1337 of file listview.c.

1338 {
1339  iterator_empty(i);
1340  i->ranges = ranges;
1341 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void iterator_empty(ITERATOR *i)
Definition: listview.c:1317

Referenced by iterator_frameditems_absolute(), LISTVIEW_DeselectAllSkipItems(), LISTVIEW_RefreshReport(), LISTVIEW_RefreshReportGrid(), and LISTVIEW_SetGroupSelection().

◆ iterator_remove_common_items()

static BOOL iterator_remove_common_items ( ITERATOR iter1,
ITERATOR iter2 
)
static

Definition at line 1517 of file listview.c.

1518 {
1519  if(!iter1->ranges || !iter2->ranges) {
1520  int lower, upper;
1521 
1522  if(iter1->ranges || iter2->ranges ||
1523  (iter1->range.lower<iter2->range.lower && iter1->range.upper>iter2->range.upper) ||
1524  (iter1->range.lower>iter2->range.lower && iter1->range.upper<iter2->range.upper)) {
1525  ERR("result is not a one range iterator\n");
1526  return FALSE;
1527  }
1528 
1529  if(iter1->range.lower==-1 || iter2->range.lower==-1)
1530  return TRUE;
1531 
1532  lower = iter1->range.lower;
1533  upper = iter1->range.upper;
1534 
1535  if(lower < iter2->range.lower)
1536  iter1->range.upper = iter2->range.lower;
1537  else if(upper > iter2->range.upper)
1538  iter1->range.lower = iter2->range.upper;
1539  else
1540  iter1->range.lower = iter1->range.upper = -1;
1541 
1542  if(iter2->range.lower < lower)
1543  iter2->range.upper = lower;
1544  else if(iter2->range.upper > upper)
1545  iter2->range.lower = upper;
1546  else
1547  iter2->range.lower = iter2->range.upper = -1;
1548 
1549  return TRUE;
1550  }
1551 
1552  iterator_next(iter1);
1553  iterator_next(iter2);
1554 
1555  while(1) {
1556  if(iter1->nItem==-1 || iter2->nItem==-1)
1557  break;
1558 
1559  if(iter1->nItem == iter2->nItem) {
1560  int delete = iter1->nItem;
1561 
1562  iterator_prev(iter1);
1563  iterator_prev(iter2);
1564  ranges_delitem(iter1->ranges, delete);
1565  ranges_delitem(iter2->ranges, delete);
1566  iterator_next(iter1);
1567  iterator_next(iter2);
1568  } else if(iter1->nItem > iter2->nItem)
1569  iterator_next(iter2);
1570  else
1571  iterator_next(iter1);
1572  }
1573 
1574  iter1->nItem = iter1->range.lower = iter1->range.upper = -1;
1575  iter2->nItem = iter2->range.lower = iter2->range.upper = -1;
1576  return TRUE;
1577 }
#define TRUE
Definition: types.h:120
RANGES ranges
Definition: listview.c:200
static BOOL iterator_next(ITERATOR *i)
Definition: listview.c:1214
RANGE range
Definition: listview.c:199
static BOOL iterator_prev(ITERATOR *i)
Definition: listview.c:1254
GLenum GLint * range
Definition: glext.h:7539
#define ERR(fmt,...)
Definition: debug.h:109
static BOOL ranges_delitem(RANGES ranges, INT nItem)
Definition: listview.c:1146

Referenced by LISTVIEW_MarqueeHighlight().

◆ iterator_visibleitems()

static BOOL iterator_visibleitems ( ITERATOR i,
const LISTVIEW_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 1462 of file listview.c.

1463 {
1464  POINT Origin, Position;
1465  RECT rcItem, rcClip;
1466  INT rgntype;
1467 
1468  rgntype = GetClipBox(hdc, &rcClip);
1469  if (rgntype == NULLREGION)
1470  {
1471  iterator_empty(i);
1472  return TRUE;
1473  }
1474  if (!iterator_frameditems(i, infoPtr, &rcClip)) return FALSE;
1475  if (rgntype == SIMPLEREGION) return TRUE;
1476 
1477  /* first deal with the special item */
1478  if (i->nSpecial != -1)
1479  {
1480  LISTVIEW_GetItemBox(infoPtr, i->nSpecial, &rcItem);
1481  if (!RectVisible(hdc, &rcItem)) i->nSpecial = -1;
1482  }
1483 
1484  /* if we can't deal with the region, we'll just go with the simple range */
1485  LISTVIEW_GetOrigin(infoPtr, &Origin);
1486  TRACE("building visible range:\n");
1487  if (!i->ranges && i->range.lower < i->range.upper)
1488  {
1489  if (!(i->ranges = ranges_create(50))) return TRUE;
1490  if (!ranges_add(i->ranges, i->range))
1491  {
1492  ranges_destroy(i->ranges);
1493  i->ranges = 0;
1494  return TRUE;
1495  }
1496  }
1497 
1498  /* now delete the invisible items from the list */
1499  while(iterator_next(i))
1500  {
1501  LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
1502  rcItem.left = (infoPtr->uView == LV_VIEW_DETAILS) ? Origin.x : Position.x + Origin.x;
1503  rcItem.top = Position.y + Origin.y;
1504  rcItem.right = rcItem.left + infoPtr->nItemWidth;
1505  rcItem.bottom = rcItem.top + infoPtr->nItemHeight;
1506  if (!RectVisible(hdc, &rcItem))
1507  ranges_delitem(i->ranges, i->nItem);
1508  }
1509  /* the iterator should restart on the next iterator_next */
1510  TRACE("done\n");
1511 
1512  return TRUE;
1513 }
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
static COORD Position
Definition: mouse.c:34
static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *, LPPOINT)
Definition: listview.c:7590
#define NULLREGION
Definition: wingdi.h:360
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
static BOOL iterator_next(ITERATOR *i)
Definition: listview.c:1214
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define LV_VIEW_DETAILS
Definition: commctrl.h:2837
#define TRACE(s)
Definition: solgame.cpp:4
if(!(yy_init))
Definition: macro.lex.yy.c:714
static void iterator_empty(ITERATOR *i)
Definition: listview.c:1317
static void ranges_destroy(RANGES ranges)
Definition: listview.c:3181
int WINAPI GetClipBox(_In_ HDC, _Out_ LPRECT)
HDC hdc
Definition: main.c:9
static BOOL iterator_frameditems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, const RECT *lprc)
Definition: listview.c:1446
#define SIMPLEREGION
Definition: wingdi.h:361
static RANGES ranges_create(int count)
Definition: listview.c:3161
BOOL WINAPI RectVisible(_In_ HDC, _In_ LPCRECT)
static BOOL ranges_delitem(RANGES ranges, INT nItem)
Definition: listview.c:1146
LONG bottom
Definition: windef.h:309
static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:2612
static BOOL ranges_add(RANGES ranges, RANGE range)
Definition: listview.c:3274
static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *, INT, LPPOINT)
Definition: listview.c:2303

Referenced by LISTVIEW_Refresh().

◆ LISTVIEW_AddGroupSelection()

static BOOL LISTVIEW_AddGroupSelection ( LISTVIEW_INFO infoPtr,
INT  nItem 
)
static

DESCRIPTION: Adds a block of selections.

PARAMETER(S): [I] infoPtr : valid pointer to the listview structure [I] nItem : item index

RETURN: Whether the window is still valid.

Definition at line 3599 of file listview.c.

3600 {
3601  INT nFirst = min(infoPtr->nSelectionMark, nItem);
3602  INT nLast = max(infoPtr->nSelectionMark, nItem);
3603  HWND hwndSelf = infoPtr->hwndSelf;
3604  NMLVODSTATECHANGE nmlv;
3605  DWORD old_mask;
3606  LVITEMW item;
3607  INT i;
3608 
3609  /* Temporarily disable change notification
3610  * If the control is LVS_OWNERDATA, we need to send
3611  * only one LVN_ODSTATECHANGED notification.
3612  * See MSDN documentation for LVN_ITEMCHANGED.
3613  */
3614  old_mask = infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE;
3615  if (infoPtr->dwStyle & LVS_OWNERDATA)
3616  infoPtr->notify_mask &= ~NOTIFY_MASK_ITEM_CHANGE;
3617 
3618  if (nFirst == -1) nFirst = nItem;
3619 
3620  item.state = LVIS_SELECTED;
3621  item.stateMask = LVIS_SELECTED;
3622 
3623  for (i = nFirst; i <= nLast; i++)
3624  LISTVIEW_SetItemState(infoPtr,i,&item);
3625 
3626  ZeroMemory(&nmlv, sizeof(nmlv));
3627  nmlv.iFrom = nFirst;
3628  nmlv.iTo = nLast;
3629  nmlv.uOldState = 0;
3630  nmlv.uNewState = item.state;
3631 
3632  notify_hdr(infoPtr, LVN_ODSTATECHANGED, (LPNMHDR)&nmlv);
3633  if (!IsWindow(hwndSelf))
3634  return FALSE;
3635  infoPtr->notify_mask |= old_mask;
3636  return TRUE;
3637 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define LVN_ODSTATECHANGED
Definition: commctrl.h:3144
#define ZeroMemory
Definition: winbase.h:1642
DWORD notify_mask
Definition: listview.c:231
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define LVIS_SELECTED
Definition: commctrl.h:2315
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVS_OWNERDATA
Definition: commctrl.h:2270
static ATOM item
Definition: dde.c:856
static LRESULT notify_hdr(const LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh)
Definition: listview.c:832
#define min(a, b)
Definition: monoChain.cc:55
static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *, INT, const LVITEMW *)
Definition: listview.c:9028

Referenced by LISTVIEW_LButtonDown().

◆ LISTVIEW_ApproximateViewRect()

static DWORD LISTVIEW_ApproximateViewRect ( const LISTVIEW_INFO infoPtr,
INT  nItemCount,
WORD  wWidth,
WORD  wHeight 
)
static

Definition at line 5347 of file listview.c.

5349 {
5350  DWORD dwViewRect = 0;
5351 
5352  if (nItemCount == -1)
5353  nItemCount = infoPtr->nItemCount;
5354 
5355  if (infoPtr->uView == LV_VIEW_LIST)
5356  {
5357  INT nItemCountPerColumn = 1;
5358  INT nColumnCount = 0;
5359 
5360  if (wHeight == 0xFFFF)
5361  {
5362  /* use current height */
5363  wHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
5364  }
5365 
5366  if (wHeight < infoPtr->nItemHeight)
5367  wHeight = infoPtr->nItemHeight;
5368 
5369  if (nItemCount > 0)
5370  {
5371  if (infoPtr->nItemHeight > 0)
5372  {
5373  nItemCountPerColumn = wHeight / infoPtr->nItemHeight;
5374  if (nItemCountPerColumn == 0)
5375  nItemCountPerColumn = 1;
5376 
5377  if (nItemCount % nItemCountPerColumn != 0)
5378  nColumnCount = nItemCount / nItemCountPerColumn;
5379  else
5380  nColumnCount = nItemCount / nItemCountPerColumn + 1;
5381  }
5382  }
5383 
5384  /* Microsoft padding magic */
5385  wHeight = nItemCountPerColumn * infoPtr->nItemHeight + 2;
5386  wWidth = nColumnCount * infoPtr->nItemWidth + 2;
5387 
5388  dwViewRect = MAKELONG(wWidth, wHeight);
5389  }
5390  else if (infoPtr->uView == LV_VIEW_DETAILS)
5391  {
5392  RECT rcBox;
5393 
5394  if (infoPtr->nItemCount > 0)
5395  {
5396  LISTVIEW_GetItemBox(infoPtr, 0, &rcBox);
5397  wWidth = rcBox.right - rcBox.left;
5398  wHeight = (rcBox.bottom - rcBox.top) * nItemCount;
5399  }
5400  else
5401  {
5402  /* use current height and width */
5403  if (wHeight == 0xffff)
5404  wHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
5405  if (wWidth == 0xffff)
5406  wWidth = infoPtr->rcList.right - infoPtr->rcList.left;
5407  }
5408 
5409  dwViewRect = MAKELONG(wWidth, wHeight);
5410  }
5411  else if (infoPtr->uView == LV_VIEW_ICON)
5412  {
5413  UINT rows,cols;
5414  UINT nItemWidth;
5415  UINT nItemHeight;
5416 
5417  nItemWidth = infoPtr->iconSpacing.cx;
5418  nItemHeight = infoPtr->iconSpacing.cy;
5419 
5420  if (wWidth == 0xffff)
5421  wWidth = infoPtr->rcList.right - infoPtr->rcList.left;
5422 
5423  if (wWidth < nItemWidth)
5424  wWidth = nItemWidth;
5425 
5426  cols = wWidth / nItemWidth;
5427  if (cols > nItemCount)
5428  cols = nItemCount;
5429  if (cols < 1)
5430  cols = 1;
5431 
5432  if (nItemCount)
5433  {
5434  rows = nItemCount / cols;
5435  if (nItemCount % cols)
5436  rows++;
5437  }
5438  else
5439  rows = 0;
5440 
5441  wHeight = (nItemHeight * rows)+2;
5442  wWidth = (nItemWidth * cols)+2;
5443 
5444  dwViewRect = MAKELONG(wWidth, wHeight);
5445  }
5446  else if (infoPtr->uView == LV_VIEW_SMALLICON)
5447  FIXME("uView == LV_VIEW_SMALLICON: not implemented\n");
5448 
5449  return dwViewRect;
5450 }
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:56
#define FIXME(fmt,...)
Definition: debug.h:110
#define MAKELONG(a, b)
Definition: typedefs.h:248
LONG cx
Definition: windef.h:334
#define LV_VIEW_DETAILS
Definition: commctrl.h:2837
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2838
#define LV_VIEW_ICON
Definition: commctrl.h:2836
unsigned int UINT
Definition: ndis.h:50
#define LV_VIEW_LIST
Definition: commctrl.h:2839
LONG bottom
Definition: windef.h:309
static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:2612
LONG cy
Definition: windef.h:335

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_Arrange()

static BOOL LISTVIEW_Arrange ( LISTVIEW_INFO infoPtr,
INT  nAlignCode 
)
static

Definition at line 2820 of file listview.c.

2821 {
2822  void (*next_pos)(LISTVIEW_INFO *, LPPOINT);
2823  POINT pos;
2824  INT i;
2825 
2826  if (infoPtr->uView != LV_VIEW_ICON && infoPtr->uView != LV_VIEW_SMALLICON) return FALSE;
2827 
2828  TRACE("nAlignCode=%d\n", nAlignCode);
2829 
2830  if (nAlignCode == LVA_DEFAULT)
2831  {
2832  if (infoPtr->dwStyle & LVS_ALIGNLEFT) nAlignCode = LVA_ALIGNLEFT;
2833  else nAlignCode = LVA_ALIGNTOP;
2834  }
2835 
2836  switch (nAlignCode)
2837  {
2838  case LVA_ALIGNLEFT: next_pos = LISTVIEW_NextIconPosLeft; break;
2839  case LVA_ALIGNTOP: next_pos = LISTVIEW_NextIconPosTop; break;
2840  case LVA_SNAPTOGRID: next_pos = LISTVIEW_NextIconPosTop; break; /* FIXME */
2841  default: return FALSE;
2842  }
2843 
2844  infoPtr->currIconPos.x = infoPtr->currIconPos.y = 0;
2845  for (i = 0; i < infoPtr->nItemCount; i++)
2846  {
2847  next_pos(infoPtr, &pos);
2848  LISTVIEW_MoveIconTo(infoPtr, i, &pos, FALSE);
2849  }
2850 
2851  return TRUE;
2852 }
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
static BOOL LISTVIEW_MoveIconTo(const LISTVIEW_INFO *infoPtr, INT nItem, const POINT *lppt, BOOL isNew)
Definition: listview.c:2785
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define LVS_ALIGNLEFT
Definition: commctrl.h:2276
#define LVA_SNAPTOGRID
Definition: commctrl.h:2526
#define LPPOINT
Definition: precomp.h:31
#define TRACE(s)
Definition: solgame.cpp:4
static void LISTVIEW_NextIconPosTop(LISTVIEW_INFO *infoPtr, LPPOINT lpPos)
Definition: listview.c:2730
#define LVA_ALIGNTOP
Definition: commctrl.h:2525
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2838
#define LV_VIEW_ICON
Definition: commctrl.h:2836
POINT currIconPos
Definition: listview.c:279
#define LVA_ALIGNLEFT
Definition: commctrl.h:2524
#define LVA_DEFAULT
Definition: commctrl.h:2523
static void LISTVIEW_NextIconPosLeft(LISTVIEW_INFO *infoPtr, LPPOINT lpPos)
Definition: listview.c:2756

Referenced by LISTVIEW_DeleteAllItems(), LISTVIEW_Paint(), LISTVIEW_ScrollOnInsert(), LISTVIEW_SetRedraw(), LISTVIEW_SetView(), LISTVIEW_Size(), LISTVIEW_StyleChanged(), LISTVIEW_Update(), and LISTVIEW_WindowProc().

◆ LISTVIEW_CalculateItemHeight()

static INT LISTVIEW_CalculateItemHeight ( const LISTVIEW_INFO infoPtr)
static

Definition at line 3033 of file listview.c.

3034 {
3035  INT nItemHeight;
3036 
3037  TRACE("uView=%d\n", infoPtr->uView);
3038 
3039  if (infoPtr->uView == LV_VIEW_ICON)
3040  nItemHeight = infoPtr->iconSpacing.cy;
3041  else
3042  {
3043  nItemHeight = infoPtr->ntmHeight;
3044  if (infoPtr->himlState)
3045  nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy);
3046  if (infoPtr->himlSmall)
3047  nItemHeight = max(nItemHeight, infoPtr->iconSize.cy);
3048  nItemHeight += HEIGHT_PADDING;
3049  if (infoPtr->nMeasureItemHeight > 0)
3050  nItemHeight = infoPtr->nMeasureItemHeight;
3051  }
3052 
3053  return max(nItemHeight, 1);
3054 }
#define max(a, b)
Definition: svc.c:63
HIMAGELIST himlState
Definition: listview.c:274
HIMAGELIST himlSmall
Definition: listview.c:273
int32_t INT
Definition: typedefs.h:56
#define HEIGHT_PADDING
Definition: listview.c:355
#define TRACE(s)
Definition: solgame.cpp:4
SIZE iconStateSize
Definition: listview.c:278
#define LV_VIEW_ICON
Definition: commctrl.h:2836
INT nMeasureItemHeight
Definition: listview.c:330
LONG cy
Definition: windef.h:335

Referenced by LISTVIEW_RefreshReportGrid(), LISTVIEW_SetFont(), LISTVIEW_SetImageList(), and LISTVIEW_UpdateItemSize().

◆ LISTVIEW_CalculateItemWidth()

static INT LISTVIEW_CalculateItemWidth ( const LISTVIEW_INFO infoPtr)
static

Definition at line 2973 of file listview.c.

2974 {
2975  INT nItemWidth = 0;
2976 
2977  TRACE("uView=%d\n", infoPtr->uView);
2978 
2979  if (infoPtr->uView == LV_VIEW_ICON)
2980  nItemWidth = infoPtr->iconSpacing.cx;
2981  else if (infoPtr->uView == LV_VIEW_DETAILS)
2982  {
2983  if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0)
2984  {
2985  RECT rcHeader;
2986  INT index;
2987 
2989  DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, 0);
2990 
2991  LISTVIEW_GetHeaderRect(infoPtr, index, &rcHeader);
2992  nItemWidth = rcHeader.right;
2993  }
2994  }
2995  else /* LV_VIEW_SMALLICON, or LV_VIEW_LIST */
2996  {
2997  WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
2998  LVITEMW lvItem;
2999  INT i;
3000 
3001  lvItem.mask = LVIF_TEXT;
3002  lvItem.iSubItem = 0;
3003 
3004  for (i = 0; i < infoPtr->nItemCount; i++)
3005  {
3006  lvItem.iItem = i;
3007  lvItem.pszText = szDispText;
3008  lvItem.cchTextMax = DISP_TEXT_SIZE;
3009  if (LISTVIEW_GetItemW(infoPtr, &lvItem))
3010  nItemWidth = max(LISTVIEW_GetStringWidthT(infoPtr, lvItem.pszText, TRUE),
3011  nItemWidth);
3012  }
3013 
3014  if (infoPtr->himlSmall) nItemWidth += infoPtr->iconSize.cx;
3015  if (infoPtr->himlState) nItemWidth += infoPtr->iconStateSize.cx;
3016 
3017  nItemWidth = max(DEFAULT_COLUMN_WIDTH, nItemWidth + WIDTH_PADDING);
3018  }
3019 
3020  return nItemWidth;
3021 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
#define HDM_ORDERTOINDEX
Definition: commctrl.h:796
static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *, LPCWSTR, BOOL)
Definition: listview.c:7631
HIMAGELIST himlState
Definition: listview.c:274
HIMAGELIST himlSmall
Definition: listview.c:273
LONG right
Definition: windef.h:308
static void LISTVIEW_GetHeaderRect(const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc)
Definition: listview.c:1701
int32_t INT
Definition: typedefs.h:56
#define LVIF_TEXT
Definition: commctrl.h:2305
int cchTextMax
Definition: commctrl.h:2362
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DEFAULT_COLUMN_WIDTH
Definition: listview.c:387
int iSubItem
Definition: commctrl.h:2358
LONG cx
Definition: windef.h:334
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4951
GLuint index
Definition: glext.h:6031
#define LV_VIEW_DETAILS
Definition: commctrl.h:2837
#define WIDTH_PADDING
Definition: listview.c:352
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR pszText
Definition: commctrl.h:2361
SIZE iconStateSize
Definition: listview.c:278
UINT mask
Definition: commctrl.h:2356
#define index(s, c)
Definition: various.h:29
#define LV_VIEW_ICON
Definition: commctrl.h:2836
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL LISTVIEW_GetItemW(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem)
Definition: listview.c:1713
#define DISP_TEXT_SIZE
Definition: listview.c:349

Referenced by LISTVIEW_UpdateItemSize().

◆ LISTVIEW_CallBackCompare()

static INT WINAPI LISTVIEW_CallBackCompare ( LPVOID  first,
LPVOID  second,
LPARAM  lParam 
)
static

Definition at line 9309 of file listview.c.

9310 {
9311  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam;
9312  ITEM_INFO* lv_first = DPA_GetPtr( first, 0 );
9313  ITEM_INFO* lv_second = DPA_GetPtr( second, 0 );
9314 
9315  /* Forward the call to the client defined callback */
9316  return (infoPtr->pfnCompare)( lv_first->lParam , lv_second->lParam, infoPtr->lParamSort );
9317 }
const GLint * first
Definition: glext.h:5794
LPARAM lParam
Definition: listview.c:173
LPARAM lParamSort
Definition: listview.c:258
#define DPA_GetPtr
Definition: commctrl.h:5
LPARAM lParam
Definition: combotst.c:139
PFNLVCOMPARE pfnCompare
Definition: listview.c:257

Referenced by LISTVIEW_SortItems().

◆ LISTVIEW_CallBackCompareEx()

static INT WINAPI LISTVIEW_CallBackCompareEx ( LPVOID  first,
LPVOID  second,
LPARAM  lParam 
)
static

Definition at line 9333 of file listview.c.

9334 {
9335  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam;
9336  INT first_idx = DPA_GetPtrIndex( infoPtr->hdpaItems, first );
9337  INT second_idx = DPA_GetPtrIndex( infoPtr->hdpaItems, second );
9338 
9339  /* Forward the call to the client defined callback */
9340  return (infoPtr->pfnCompare)( first_idx, second_idx, infoPtr->lParamSort );
9341 }
const GLint * first
Definition: glext.h:5794
int32_t INT
Definition: typedefs.h:56
LPARAM lParamSort
Definition: listview.c:258
INT WINAPI DPA_GetPtrIndex(HDPA hdpa, LPCVOID p)
Definition: dpa.c:561
LPARAM lParam
Definition: combotst.c:139
PFNLVCOMPARE pfnCompare
Definition: listview.c:257

Referenced by LISTVIEW_SortItems().

◆ LISTVIEW_CancelEditLabel()

static LRESULT LISTVIEW_CancelEditLabel ( LISTVIEW_INFO infoPtr)
static

Definition at line 5462 of file listview.c.

5463 {
5464  if (infoPtr->hwndEdit)
5465  {
5466  /* handle value will be lost after LISTVIEW_EndEditLabelT */
5467  HWND edit = infoPtr->hwndEdit;
5468 
5469  LISTVIEW_EndEditLabelT(infoPtr, TRUE, IsWindowUnicode(infoPtr->hwndEdit));
5470  SendMessageW(edit, WM_CLOSE, 0, 0);
5471  }
5472 
5473  return TRUE;
5474 }
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_CLOSE
Definition: winuser.h:1603
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *, BOOL, BOOL)
Definition: listview.c:5924

Referenced by LISTVIEW_Command(), and LISTVIEW_WindowProc().

◆ LISTVIEW_Command()

static LRESULT LISTVIEW_Command ( LISTVIEW_INFO infoPtr,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 11955 of file listview.c.

11956 {
11957 
11958  TRACE("(%p %x %x %lx)\n", infoPtr, HIWORD(wParam), LOWORD(wParam), lParam);
11959 
11960  if (!infoPtr->hwndEdit) return 0;
11961 
11962  switch (HIWORD(wParam))
11963  {
11964  case EN_UPDATE:
11965  {
11966  /*
11967  * Adjust the edit window size
11968  */
11969  WCHAR buffer[1024];
11970  HDC hdc = GetDC(infoPtr->hwndEdit);
11971  HFONT hFont, hOldFont = 0;
11972  RECT rect;
11973  SIZE sz;
11974 
11975  if (!infoPtr->hwndEdit || !hdc) return 0;
11977  GetWindowRect(infoPtr->hwndEdit, &rect);
11978 
11979  /* Select font to get the right dimension of the string */
11980  hFont = (HFONT)SendMessageW(infoPtr->hwndEdit, WM_GETFONT, 0, 0);
11981  if (hFont)
11982  {
11983  hOldFont = SelectObject(hdc, hFont);
11984  }
11985 
11987  {
11988  TEXTMETRICW textMetric;
11989 
11990  /* Add Extra spacing for the next character */
11991  GetTextMetricsW(hdc, &textMetric);
11992  sz.cx += (textMetric.tmMaxCharWidth * 2);
11993 
11994  SetWindowPos(infoPtr->hwndEdit, NULL, 0, 0, sz.cx,
11995  rect.bottom - rect.top, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOZORDER);
11996  }
11997  if (hFont)
11998  SelectObject(hdc, hOldFont);
11999 
12000  ReleaseDC(infoPtr->hwndEdit, hdc);
12001 
12002  break;
12003  }
12004  case EN_KILLFOCUS:
12005  {
12006  if (infoPtr->notify_mask & NOTIFY_MASK_END_LABEL_EDIT)
12007  LISTVIEW_CancelEditLabel(infoPtr);
12008  break;
12009  }
12010 
12011  default:
12012  return SendMessageW (infoPtr->hwndNotify, WM_COMMAND, wParam, lParam);
12013  }
12014 
12015  return 0;
12016 }
LONG tmMaxCharWidth
Definition: wingdi.h:2388
#define SWP_DRAWFRAME
Definition: winuser.h:1224
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HDC WINAPI GetDC(_In_opt_ HWND)
static LRESULT LISTVIEW_CancelEditLabel(LISTVIEW_INFO *infoPtr)
Definition: listview.c:5462
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
GLuint buffer
Definition: glext.h:5915
#define SWP_NOZORDER
Definition: winuser.h:1232
#define lstrlenW
Definition: compat.h:415
DWORD notify_mask
Definition: listview.c:231
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
HFONT hFont
Definition: main.c:53
#define EN_KILLFOCUS
Definition: winuser.h:2007
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
LONG cx
Definition: windef.h:334
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
HDC hdc
Definition: main.c:9
#define WM_COMMAND
Definition: winuser.h:1722
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1408
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define HIWORD(l)
Definition: typedefs.h:246
#define EN_UPDATE
Definition: winuser.h:2010
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_Create()

static LRESULT LISTVIEW_Create ( HWND  hwnd,
const CREATESTRUCTW lpcs 
)
static

Definition at line 9614 of file listview.c.

9615 {
9617 
9618  TRACE("(lpcs=%p, style=0x%08x)\n", lpcs, lpcs->style);
9619 
9620  infoPtr->dwStyle = lpcs->style;
9621  map_style_view(infoPtr);
9622 
9623  infoPtr->notifyFormat = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT,
9624  (WPARAM)infoPtr->hwndSelf, NF_QUERY);
9625  /* on error defaulting to ANSI notifications */
9626  if (infoPtr->notifyFormat == 0) infoPtr->notifyFormat = NFR_ANSI;
9627  TRACE("notify format=%d\n", infoPtr->notifyFormat);
9628 
9629  if ((infoPtr->uView == LV_VIEW_DETAILS) && (lpcs->style & WS_VISIBLE))
9630  {
9631  if (LISTVIEW_CreateHeader(infoPtr) < 0) return -1;
9632  }
9633  else
9634  infoPtr->hwndHeader = 0;
9635 
9636  /* init item size to avoid division by 0 */
9637  LISTVIEW_UpdateItemSize (infoPtr);
9638  LISTVIEW_UpdateSize (infoPtr);
9639 
9640  if (infoPtr->uView == LV_VIEW_DETAILS)
9641  {
9642  if (!(LVS_NOCOLUMNHEADER & lpcs->style) && (WS_VISIBLE & lpcs->style))
9643  {
9644  ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL);
9645  }
9646  LISTVIEW_UpdateScroll(infoPtr);
9647  /* send WM_MEASUREITEM notification */
9648  if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED) notify_measureitem(infoPtr);
9649  }
9650 
9652 
9653  /* initialize the icon sizes */
9654  set_icon_size(&infoPtr->iconSize, infoPtr->himlNormal, infoPtr->uView != LV_VIEW_ICON);
9655  set_icon_size(&infoPtr->iconStateSize, infoPtr->himlState, TRUE);
9656  return 0;
9657 }
static void LISTVIEW_UpdateSize(LISTVIEW_INFO *)
Definition: listview.c:11126
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
SHORT notifyFormat
Definition: listview.c:229
#define TRUE
Definition: types.h:120
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2280
static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr)
Definition: listview.c:2172
HIMAGELIST himlState
Definition: listview.c:274
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL is_small)
Definition: listview.c:8802
static BOOL notify_measureitem(LISTVIEW_INFO *infoPtr)
Definition: listview.c:1113
static const WCHAR themeClass[]
Definition: listview.c:427
#define LV_VIEW_DETAILS
Definition: commctrl.h:2837
#define TRACE(s)
Definition: solgame.cpp:4
HIMAGELIST himlNormal
Definition: listview.c:272
SIZE iconStateSize
Definition: listview.c:278
static INT LISTVIEW_CreateHeader(LISTVIEW_INFO *infoPtr)
Definition: listview.c:1666
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
static void LISTVIEW_UpdateItemSize(LISTVIEW_INFO *infoPtr)
Definition: listview.c:3066
static void map_style_view(LISTVIEW_INFO *infoPtr)
Definition: listview.c:1609
#define NF_QUERY
Definition: winuser.h:2435
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define LV_VIEW_ICON
Definition: commctrl.h:2836
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NFR_ANSI
Definition: winuser.h:2433
#define WS_VISIBLE
Definition: pedump.c:620
#define LVS_OWNERDRAWFIXED
Definition: commctrl.h:2279

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_CreateCheckBoxIL()

static HIMAGELIST LISTVIEW_CreateCheckBoxIL ( const LISTVIEW_INFO infoPtr)
static

Definition at line 8553 of file listview.c.

8554 {
8555  HDC hdc_wnd, hdc;
8556  HBITMAP hbm_im, hbm_mask, hbm_orig;
8557  RECT rc;
8558  HBRUSH hbr_white = GetStockObject(WHITE_BRUSH);
8559  HBRUSH hbr_black = GetStockObject(BLACK_BRUSH);
8560  HIMAGELIST himl;
8561 
8563  ILC_COLOR | ILC_MASK, 2, 2);
8564  hdc_wnd = GetDC(infoPtr->hwndSelf);
8565  hdc = CreateCompatibleDC(hdc_wnd);
8568  ReleaseDC(infoPtr->hwndSelf, hdc_wnd);
8569 
8571  hbm_orig = SelectObject(hdc, hbm_mask);
8572  FillRect(hdc, &rc, hbr_white);
8573  InflateRect(&rc, -2, -2);
8574  FillRect(hdc, &rc, hbr_black);
8575 
8576  SelectObject(hdc, hbm_im);
8578  SelectObject(hdc, hbm_orig);
8579  ImageList_Add(himl, hbm_im, hbm_mask);
8580 
8581  SelectObject(hdc, hbm_im);
8583  SelectObject(hdc, hbm_orig);
8584  ImageList_Add(himl, hbm_im, hbm_mask);
8585 
8586  DeleteObject(hbm_mask);
8587  DeleteObject(hbm_im);
8588  DeleteDC(hdc);
8589 
8590  return himl;
8591 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define DFC_BUTTON
Definition: winuser.h:476
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
#define DFCS_CHECKED
Definition: winuser.h:504
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define SM_CYSMICON
Definition: winuser.h:1003
#define WHITE_BRUSH
Definition: wingdi.h:901
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HIMAGELIST himl
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ILC_COLOR
Definition: commctrl.h:348
smooth NULL
Definition: ftsmooth.c:416
static HBITMAP
Definition: listview.c:33
#define BLACK_BRUSH
Definition: wingdi.h:895
#define DFCS_MONO
Definition: winuser.h:511
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
HDC hdc
Definition: main.c:9
#define ILC_MASK
Definition: commctrl.h:347
#define DFCS_BUTTONCHECK
Definition: winuser.h:496
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by LISTVIEW_SetExtendedListViewStyle().

◆ LISTVIEW_CreateDragImage()

static HIMAGELIST LISTVIEW_CreateDragImage ( LISTVIEW_INFO infoPtr,
INT  iItem,
LPPOINT  lppt 
)
static

Definition at line 5488 of file listview.c.

5489 {
5490  RECT rcItem;
5491  SIZE size;
5492  POINT pos;
5493  HDC hdc, hdcOrig;
5494  HBITMAP hbmp, hOldbmp;
5495  HFONT hOldFont;
5496  HIMAGELIST dragList = 0;
5497  TRACE("iItem=%d Count=%d\n", iItem, infoPtr->nItemCount);
5498 
5499  if (iItem < 0 || iItem >= infoPtr->nItemCount || !lppt)
5500  return 0;
5501 
5502  rcItem.left = LVIR_BOUNDS;
5503  if (!LISTVIEW_GetItemRect(infoPtr, iItem, &rcItem))
5504  return 0;
5505 
5506  lppt->x = rcItem.left;
5507  lppt->y = rcItem.top;
5508 
5509  size.cx = rcItem.right - rcItem.left;
5510  size.cy = rcItem.bottom - rcItem.top;
5511 
5512  hdcOrig = GetDC(infoPtr->hwndSelf);
5513  hdc = CreateCompatibleDC(hdcOrig);
5514  hbmp = CreateCompatibleBitmap(hdcOrig, size.cx, size.cy);
5515  hOldbmp = SelectObject(hdc, hbmp);
5516  hOldFont = SelectObject(hdc, infoPtr->hFont);
5517 
5518  SetRect(&rcItem, 0, 0, size.cx, size.cy);
5519  FillRect(hdc, &rcItem, infoPtr->hBkBrush);
5520 
5521  pos.x = pos.y = 0;
5522  if (LISTVIEW_DrawItem(infoPtr, hdc, iItem, NULL, pos, CDRF_DODEFAULT))
5523  {
5524  dragList = ImageList_Create(size.cx, size.cy, ILC_COLOR, 10, 10);
5525  SelectObject(hdc, hOldbmp);
5526  ImageList_Add(dragList, hbmp, 0);
5527  }
5528  else
5529  SelectObject(hdc, hOldbmp);
5530 
5531  SelectObject(hdc, hOldFont);
5532  DeleteObject(hbmp);
5533  DeleteDC(hdc);
5534  ReleaseDC(infoPtr->hwndSelf, hdcOrig);
5535 
5536  TRACE("ret=%p\n", dragList);
5537 
5538  return dragList;
5539 }
long y
Definition: polytest.cpp:48
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
long x
Definition: polytest.cpp:48
HBRUSH hBkBrush
Definition: listview.c:298
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERATOR *subitems, POINT pos, DWORD cdmode)
Definition: listview.c:4777
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define ILC_COLOR
Definition: commctrl.h:348
smooth NULL
Definition: ftsmooth.c:416
static HBITMAP
Definition: listview.c:33
HBITMAP hbmp
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define CDRF_DODEFAULT
Definition: commctrl.h:264
HDC hdc
Definition: main.c:9
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define LVIR_BOUNDS
Definition: commctrl.h:2468
BOOL WINAPI DeleteDC(_In_ HDC)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:7128
LONG bottom
Definition: windef.h:309
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_CreateHeader()

static INT LISTVIEW_CreateHeader ( LISTVIEW_INFO infoPtr)
static

Definition at line 1666 of file listview.c.

1667 {
1669  HINSTANCE hInst;
1670 
1671  if (infoPtr->hwndHeader) return 0;
1672 
1673  TRACE("Creating header for list %p\n", infoPtr->hwndSelf);
1674 
1675  /* setup creation flags */
1676  dFlags |= (LVS_NOSORTHEADER & infoPtr->dwStyle) ? 0 : HDS_BUTTONS;
1677  dFlags |= (LVS_NOCOLUMNHEADER & infoPtr->dwStyle) ? HDS_HIDDEN : 0;
1678 
1680 
1681  /* create header */
1682  infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL, dFlags,
1683  0, 0, 0, 0, infoPtr->hwndSelf, NULL, hInst, NULL);
1684  if (!infoPtr->hwndHeader) return -1;
1685 
1686  /* set header unicode format */
1688 
1689  /* set header font */
1690  SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, TRUE);
1691 
1692  /* set header image list */
1693  if (infoPtr->himlSmall)
1694  SendMessageW(infoPtr->hwndHeader, HDM_SETIMAGELIST, 0, (LPARAM)infoPtr->himlSmall);
1695 
1696  LISTVIEW_UpdateSize(infoPtr);
1697 
1698  return 0;
1699 }
static void LISTVIEW_UpdateSize(LISTVIEW_INFO *)
Definition: listview.c:11126
#define TRUE
Definition: types.h:120
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2280
UINT_PTR WPARAM
Definition: windef.h:207
HIMAGELIST himlSmall
Definition: listview.c:273
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define HDS_HORZ
Definition: commctrl.h:624
#define HDS_DRAGDROP
Definition: commctrl.h:628
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define HDS_HIDDEN
Definition: commctrl.h:627
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE HINSTANCE
Definition: typedefs.h:75
#define HDS_BUTTONS
Definition: commctrl.h:625
HINSTANCE hInst
Definition: dxdiag.c:13
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_SETIMAGELIST
Definition: commctrl.h:790
#define WM_SETFONT
Definition: winuser.h:1632
#define GWLP_HINSTANCE
Definition: winuser.h:850
#define WC_HEADERW
Definition: commctrl.h:620
#define LVS_NOSORTHEADER
Definition: commctrl.h:2281
#define HDS_FULLDRAG
Definition: commctrl.h:629
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:817

Referenced by LISTVIEW_Create(), LISTVIEW_InsertColumnT(), LISTVIEW_SetExtendedListViewStyle(), LISTVIEW_SetView(), LISTVIEW_ShowWindow(), and LISTVIEW_StyleChanged().

◆ LISTVIEW_DelayedEditItem()

static VOID CALLBACK LISTVIEW_DelayedEditItem ( HWND  hwnd,
UINT  uMsg,
UINT_PTR  idEvent,
DWORD  dwTime 
)
static

Definition at line 9500 of file listview.c.

9501 {
9502  DELAYED_ITEM_EDIT *editItem = (DELAYED_ITEM_EDIT *)idEvent;
9504 
9505  KillTimer(hwnd, idEvent);
9506  editItem->fEnabled = FALSE;
9507  /* check if the item is still selected */
9508  if (infoPtr->bFocus && LISTVIEW_GetItemState(infoPtr, editItem->iItem, LVIS_SELECTED))
9509  LISTVIEW_EditLabelT(infoPtr, editItem->iItem, TRUE);
9510 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static UINT LISTVIEW_GetItemState(const LISTVIEW_INFO *, INT, UINT)
Definition: listview.c:7334
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define LVIS_SELECTED
Definition: commctrl.h:2315
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
Definition: listview.c:6170

Referenced by LISTVIEW_LButtonUp().

◆ LISTVIEW_DeleteAllItems()

static BOOL LISTVIEW_DeleteAllItems ( LISTVIEW_INFO infoPtr,
BOOL  destroy 
)
static

Definition at line 5553 of file listview.c.

5554 {
5555  HDPA hdpaSubItems = NULL;
5556  BOOL suppress = FALSE;
5557  ITEMHDR *hdrItem;
5558  ITEM_INFO *lpItem;
5559  ITEM_ID *lpID;
5560  INT i, j;
5561 
5562  TRACE("()\n");
5563 
5564  /* we do it directly, to avoid notifications */
5565  ranges_clear(infoPtr->selectionRanges);
5566  infoPtr->nSelectionMark = -1;
5567  infoPtr->nFocusedItem = -1;
5568  SetRectEmpty(&infoPtr->rcFocus);
5569  /* But we are supposed to leave nHotItem as is! */
5570 
5571  /* send LVN_DELETEALLITEMS notification */
5572  if (!(infoPtr->dwStyle & LVS_OWNERDATA) || !destroy)
5573  {
5574  NMLISTVIEW nmlv;
5575 
5576  memset(&nmlv, 0, sizeof(NMLISTVIEW));
5577  nmlv.iItem = -1;
5578  suppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv);
5579  }
5580 
5581  for (i = infoPtr->nItemCount - 1; i >= 0; i<