ReactOS  0.4.14-dev-50-g13bb5e2
listview.c File Reference
#include "config.h"
#include "wine/port.h"
#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 "wine/unicode.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
 

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 BOOL iterator_empty (ITERATOR *i)
 
static BOOL iterator_rangeitems (ITERATOR *i, RANGE range)
 
static BOOL 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 397 of file listview.c.

◆ DEBUG_BUFFER_SIZE

#define DEBUG_BUFFER_SIZE   256

Definition at line 340 of file listview.c.

◆ DEBUG_BUFFERS

#define DEBUG_BUFFERS   20

Definition at line 338 of file listview.c.

◆ DEFAULT_COLUMN_WIDTH

#define DEFAULT_COLUMN_WIDTH   128

Definition at line 384 of file listview.c.

◆ DEFAULT_LABEL_WIDTH

#define DEFAULT_LABEL_WIDTH   40

Definition at line 379 of file listview.c.

◆ DISP_TEXT_SIZE

#define DISP_TEXT_SIZE   260

Definition at line 346 of file listview.c.

◆ HEIGHT_PADDING

#define HEIGHT_PADDING   1

Definition at line 352 of file listview.c.

◆ ICON_BOTTOM_PADDING

#define ICON_BOTTOM_PADDING   4

Definition at line 372 of file listview.c.

◆ ICON_LR_HALF

#define ICON_LR_HALF   (ICON_LR_PADDING/2)

Definition at line 376 of file listview.c.

◆ ICON_LR_PADDING

#define ICON_LR_PADDING   16

Definition at line 375 of file listview.c.

◆ ICON_TOP_PADDING

Definition at line 371 of file listview.c.

◆ ICON_TOP_PADDING_HITABLE

#define ICON_TOP_PADDING_HITABLE   2

Definition at line 370 of file listview.c.

◆ ICON_TOP_PADDING_NOTHITABLE

#define ICON_TOP_PADDING_NOTHITABLE   2

Definition at line 369 of file listview.c.

◆ IMAGE_PADDING

#define IMAGE_PADDING   2

Definition at line 390 of file listview.c.

◆ KEY_DELAY

#define KEY_DELAY   450

Definition at line 408 of file listview.c.

◆ LABEL_HOR_PADDING

#define LABEL_HOR_PADDING   5

Definition at line 373 of file listview.c.

◆ LABEL_VERT_PADDING

#define LABEL_VERT_PADDING   7

Definition at line 374 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 411 of file listview.c.

◆ LISTVIEW_SCROLL_ICON_LINE_SIZE

#define LISTVIEW_SCROLL_ICON_LINE_SIZE   37

Definition at line 387 of file listview.c.

◆ LV_FL_DT_FLAGS

Definition at line 401 of file listview.c.

◆ LV_ML_DT_FLAGS

Definition at line 400 of file listview.c.

◆ LV_SL_DT_FLAGS

Definition at line 402 of file listview.c.

◆ MAX_EMPTYTEXT_SELECT_WIDTH

#define MAX_EMPTYTEXT_SELECT_WIDTH   80

Definition at line 381 of file listview.c.

◆ ranges_check

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

Definition at line 3106 of file listview.c.

◆ REPORT_MARGINX

#define REPORT_MARGINX   2

Definition at line 355 of file listview.c.

◆ SB_INTERNAL

#define SB_INTERNAL   -1

Definition at line 343 of file listview.c.

◆ SCROLL_DOWN

#define SCROLL_DOWN   0x8

Definition at line 3839 of file listview.c.

◆ SCROLL_LEFT

#define SCROLL_LEFT   0x1

Definition at line 3836 of file listview.c.

◆ SCROLL_RIGHT

#define SCROLL_RIGHT   0x2

Definition at line 3837 of file listview.c.

◆ SCROLL_UP

#define SCROLL_UP   0x4

Definition at line 3838 of file listview.c.

◆ STATEIMAGEINDEX

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

Definition at line 405 of file listview.c.

◆ TRAILING_HEADER_PADDING

#define TRAILING_HEADER_PADDING   11

Definition at line 394 of file listview.c.

◆ TRAILING_LABEL_PADDING

#define TRAILING_LABEL_PADDING   12

Definition at line 393 of file listview.c.

◆ WIDTH_PADDING

#define WIDTH_PADDING   12

Definition at line 349 of file listview.c.

Typedef Documentation

◆ COLUMN_INFO

◆ DELAYED_ITEM_EDIT

◆ ITEM_ID

Definition at line 171 of file listview.c.

◆ ITEM_INFO

◆ ITEMHDR

◆ ITERATOR

◆ LISTVIEW_INFO

◆ LPITEMHDR

◆ RANGE

◆ RANGES

typedef struct tagRANGES * RANGES

◆ SUBITEM_INFO

Function Documentation

◆ CallWindowProcT()

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

Definition at line 1571 of file listview.c.

1573 {
1574  if (isW) return CallWindowProcW(proc, hwnd, uMsg, wParam, lParam);
1575  else return CallWindowProcA(proc, hwnd, uMsg, wParam, lParam);
1576 }
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 8101 of file listview.c.

8103 {
8104  if (lpColumn->mask & LVCF_FMT)
8105  {
8106  /* format member is valid */
8107  lphdi->mask |= HDI_FORMAT;
8108 
8109  /* set text alignment (leftmost column must be left-aligned) */
8110  if (nColumn == 0 || (lpColumn->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT)
8111  lphdi->fmt |= HDF_LEFT;
8112  else if ((lpColumn->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_RIGHT)
8113  lphdi->fmt |= HDF_RIGHT;
8114  else if ((lpColumn->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_CENTER)
8115  lphdi->fmt |= HDF_CENTER;
8116 
8117  if (lpColumn->fmt & LVCFMT_BITMAP_ON_RIGHT)
8118  lphdi->fmt |= HDF_BITMAP_ON_RIGHT;
8119 
8120  if (lpColumn->fmt & LVCFMT_COL_HAS_IMAGES)
8121  {
8122  lphdi->fmt |= HDF_IMAGE;
8123  lphdi->iImage = I_IMAGECALLBACK;
8124  }
8125 
8126  if (lpColumn->fmt & LVCFMT_FIXED_WIDTH)
8127  lphdi->fmt |= HDF_FIXEDWIDTH;
8128  }
8129 
8130  if (lpColumn->mask & LVCF_WIDTH)
8131  {
8132  lphdi->mask |= HDI_WIDTH;
8133  if(lpColumn->cx == LVSCW_AUTOSIZE_USEHEADER)
8134  {
8135  /* make it fill the remainder of the controls width */
8136  RECT rcHeader;
8137  INT item_index;
8138 
8139  for(item_index = 0; item_index < (nColumn - 1); item_index++)
8140  {
8141  LISTVIEW_GetHeaderRect(infoPtr, item_index, &rcHeader);
8142  lphdi->cxy += rcHeader.right - rcHeader.left;
8143  }
8144 
8145  /* retrieve the layout of the header */
8146  GetClientRect(infoPtr->hwndSelf, &rcHeader);
8147  TRACE("start cxy=%d rcHeader=%s\n", lphdi->cxy, wine_dbgstr_rect(&rcHeader));
8148 
8149  lphdi->cxy = (rcHeader.right - rcHeader.left) - lphdi->cxy;
8150  }
8151  else
8152  lphdi->cxy = lpColumn->cx;
8153  }
8154 
8155  if (lpColumn->mask & LVCF_TEXT)
8156  {
8157  lphdi->mask |= HDI_TEXT | HDI_FORMAT;
8158  lphdi->fmt |= HDF_STRING;
8159  lphdi->pszText = lpColumn->pszText;
8160  lphdi->cchTextMax = textlenT(lpColumn->pszText, isW);
8161  }
8162 
8163  if (lpColumn->mask & LVCF_IMAGE)
8164  {
8165  lphdi->mask |= HDI_IMAGE;
8166  lphdi->iImage = lpColumn->iImage;
8167  }
8168 
8169  if (lpColumn->mask & LVCF_ORDER)
8170  {
8171  lphdi->mask |= HDI_ORDER;
8172  lphdi->iOrder = lpColumn->iOrder;
8173  }
8174 }
#define HDF_RIGHT
Definition: commctrl.h:699
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define LVCF_TEXT
Definition: commctrl.h:2560
#define LVCFMT_CENTER
Definition: commctrl.h:2572
int iImage
Definition: commctrl.h:676
int cxy
Definition: commctrl.h:670
#define LVCFMT_RIGHT
Definition: commctrl.h:2571
LPWSTR pszText
Definition: commctrl.h:671
#define LVCFMT_LEFT
Definition: commctrl.h:2570
static int textlenT(LPCWSTR text, BOOL isW)
Definition: listview.c:465
LONG left
Definition: windef.h:291
#define HDI_TEXT
Definition: commctrl.h:689
LONG right
Definition: windef.h:293
static void LISTVIEW_GetHeaderRect(const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc)
Definition: listview.c:1691
int32_t INT
Definition: typedefs.h:56
#define HDF_CENTER
Definition: commctrl.h:700
#define HDF_STRING
Definition: commctrl.h:705
int iOrder
Definition: commctrl.h:677
#define LVCFMT_COL_HAS_IMAGES
Definition: commctrl.h:2576
#define HDI_FORMAT
Definition: commctrl.h:690
int cchTextMax
Definition: commctrl.h:673
#define TRACE(s)
Definition: solgame.cpp:4
const char * wine_dbgstr_rect(const RECT *rect)
LPWSTR pszText
Definition: commctrl.h:2539
#define HDF_BITMAP_ON_RIGHT
Definition: commctrl.h:707
#define HDI_IMAGE
Definition: commctrl.h:693
static const WCHAR isW[]
Definition: tokenize.c:59
#define HDF_LEFT
Definition: commctrl.h:698
#define HDI_ORDER
Definition: commctrl.h:695
#define I_IMAGECALLBACK
Definition: commctrl.h:2357
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2558
#define LVCFMT_JUSTIFYMASK
Definition: commctrl.h:2573
#define LVSCW_AUTOSIZE_USEHEADER
Definition: commctrl.h:2617
#define LVCFMT_BITMAP_ON_RIGHT
Definition: commctrl.h:2575
UINT mask
Definition: commctrl.h:669
#define LVCF_IMAGE
Definition: commctrl.h:2562
#define HDF_IMAGE
Definition: commctrl.h:708
#define HDI_WIDTH
Definition: commctrl.h:687
int fmt
Definition: commctrl.h:674
#define LVCF_ORDER
Definition: commctrl.h:2563

Referenced by LISTVIEW_InsertColumnT(), and LISTVIEW_SetColumnT().

◆ CreateEditLabelT()

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

Definition at line 6089 of file listview.c.

6090 {
6093  HWND hedit;
6094 
6095  TRACE("(%p, text=%s, isW=%d)\n", infoPtr, debugtext_t(text, isW), isW);
6096 
6097  /* window will be resized and positioned after LVN_BEGINLABELEDIT */
6098  if (isW)
6099  hedit = CreateWindowW(WC_EDITW, text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
6100  else
6101  hedit = CreateWindowA(WC_EDITA, (LPCSTR)text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0);
6102 
6103  if (!hedit) return 0;
6104 
6105  infoPtr->EditWndProc = (WNDPROC)
6108 
6109  SendMessageW(hedit, WM_SETFONT, (WPARAM)infoPtr->hFont, FALSE);
6111 
6112  return hedit;
6113 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WC_EDITW
Definition: commctrl.h:4658
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:551
static LRESULT CALLBACK EditLblWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: listview.c:6072
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
#define WC_EDITA
Definition: commctrl.h:4657
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4216
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:5246
WNDPROC EditWndProc
Definition: listview.c:264
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:2880
#define WS_BORDER
Definition: pedump.c:625
static LRESULT CALLBACK EditLblWndProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: listview.c:6055
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:5247
#define DISP_TEXT_SIZE
Definition: listview.c:346
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 1032 of file listview.c.

1034 {
1035  ZeroMemory(lpnmlvcd, sizeof(NMLVCUSTOMDRAW));
1036  lpnmlvcd->nmcd.hdc = hdc;
1037  lpnmlvcd->nmcd.rc = *rcBounds;
1038  lpnmlvcd->clrTextBk = infoPtr->clrTextBk;
1039  lpnmlvcd->clrText = infoPtr->clrText;
1040  if (!lplvItem) return;
1041  lpnmlvcd->nmcd.dwItemSpec = lplvItem->iItem + 1;
1042  lpnmlvcd->iSubItem = lplvItem->iSubItem;
1043  if (lplvItem->state & LVIS_SELECTED) lpnmlvcd->nmcd.uItemState |= CDIS_SELECTED;
1044  if (lplvItem->state & LVIS_FOCUSED) lpnmlvcd->nmcd.uItemState |= CDIS_FOCUS;
1045  if (lplvItem->iItem == infoPtr->nHotItem) lpnmlvcd->nmcd.uItemState |= CDIS_HOT;
1046  lpnmlvcd->nmcd.lItemlParam = lplvItem->lParam;
1047 }
#define ZeroMemory
Definition: winbase.h:1635
COLORREF clrText
Definition: commctrl.h:3035
NMCUSTOMDRAW nmcd
Definition: commctrl.h:3034
int iSubItem
Definition: commctrl.h:2334
LPARAM lParam
Definition: commctrl.h:2340
#define LVIS_SELECTED
Definition: commctrl.h:2291
#define CDIS_SELECTED
Definition: commctrl.h:276
#define CDIS_HOT
Definition: commctrl.h:282
#define CDIS_FOCUS
Definition: commctrl.h:280
HDC hdc
Definition: main.c:9
COLORREF clrTextBk
Definition: listview.c:298
UINT state
Definition: commctrl.h:2335
DWORD_PTR dwItemSpec
Definition: commctrl.h:292
COLORREF clrText
Definition: listview.c:297
COLORREF clrTextBk
Definition: commctrl.h:3036
#define LVIS_FOCUSED
Definition: commctrl.h:2290

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

◆ debug_getbuf()

static char* debug_getbuf ( void  )
static

Definition at line 564 of file listview.c.

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

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

◆ debuglvcolumn_t()

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

Definition at line 665 of file listview.c.

666 {
667  char* buf = debug_getbuf(), *text = buf;
668  int len, size = DEBUG_BUFFER_SIZE;
669 
670  if (lpColumn == NULL) return "(null)";
671  len = snprintf(buf, size, "{");
672  if (len == -1) goto end;
673  buf += len; size -= len;
674  if (lpColumn->mask & LVCF_SUBITEM)
675  len = snprintf(buf, size, "iSubItem=%d, ", lpColumn->iSubItem);
676  else len = 0;
677  if (len == -1) goto end;
678  buf += len; size -= len;
679  if (lpColumn->mask & LVCF_FMT)
680  len = snprintf(buf, size, "fmt=%x, ", lpColumn->fmt);
681  else len = 0;
682  if (len == -1) goto end;
683  buf += len; size -= len;
684  if (lpColumn->mask & LVCF_WIDTH)
685  len = snprintf(buf, size, "cx=%d, ", lpColumn->cx);
686  else len = 0;
687  if (len == -1) goto end;
688  buf += len; size -= len;
689  if (lpColumn->mask & LVCF_TEXT)
690  len = snprintf(buf, size, "pszText=%s, cchTextMax=%d, ", debugtext_tn(lpColumn->pszText, isW, 80), lpColumn->cchTextMax);
691  else len = 0;
692  if (len == -1) goto end;
693  buf += len; size -= len;
694  if (lpColumn->mask & LVCF_IMAGE)
695  len = snprintf(buf, size, "iImage=%d, ", lpColumn->iImage);
696  else len = 0;
697  if (len == -1) goto end;
698  buf += len; size -= len;
699  if (lpColumn->mask & LVCF_ORDER)
700  len = snprintf(buf, size, "iOrder=%d, ", lpColumn->iOrder);
701  else len = 0;
702  if (len == -1) goto end;
703  buf += len;
704  goto undo;
705 end:
706  buf = text + strlen(text);
707 undo:
708  if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; }
709  return text;
710 }
static char * debug_getbuf(void)
Definition: listview.c:564
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define LVCF_TEXT
Definition: commctrl.h:2560
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:340
#define LVCF_SUBITEM
Definition: commctrl.h:2561
smooth NULL
Definition: ftsmooth.c:416
static LPCSTR debugtext_tn(LPCWSTR text, BOOL isW, INT n)
Definition: listview.c:557
GLsizeiptr size
Definition: glext.h:5919
LPWSTR pszText
Definition: commctrl.h:2539
static const WCHAR isW[]
Definition: tokenize.c:59
GLenum GLsizei len
Definition: glext.h:6722
int cchTextMax
Definition: commctrl.h:2540
#define LVCF_FMT
Definition: commctrl.h:2558
#define LVCF_IMAGE
Definition: commctrl.h:2562
#define LVCF_ORDER
Definition: commctrl.h:2563

Referenced by LISTVIEW_InsertColumnT(), and LISTVIEW_SetColumnT().

◆ debuglvhittestinfo()

static const char* debuglvhittestinfo ( const LVHITTESTINFO lpht)
static

Definition at line 712 of file listview.c.

713 {
714  if (!lpht) return "(null)";
715 
716  return wine_dbg_sprintf("{pt=%s, flags=0x%x, iItem=%d, iSubItem=%d}",
717  wine_dbgstr_point(&lpht->pt), lpht->flags, lpht->iItem, lpht->iSubItem);
718 }
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 623 of file listview.c.

624 {
625  char* buf = debug_getbuf(), *text = buf;
626  int len, size = DEBUG_BUFFER_SIZE;
627 
628  if (lpLVItem == NULL) return "(null)";
629  len = snprintf(buf, size, "{iItem=%d, iSubItem=%d, ", lpLVItem->iItem, lpLVItem->iSubItem);
630  if (len == -1) goto end;
631  buf += len; size -= len;
632  if (lpLVItem->mask & LVIF_STATE)
633  len = snprintf(buf, size, "state=%x, stateMask=%x, ", lpLVItem->state, lpLVItem->stateMask);
634  else len = 0;
635  if (len == -1) goto end;
636  buf += len; size -= len;
637  if (lpLVItem->mask & LVIF_TEXT)
638  len = snprintf(buf, size, "pszText=%s, cchTextMax=%d, ", debugtext_tn(lpLVItem->pszText, isW, 80), lpLVItem->cchTextMax);
639  else len = 0;
640  if (len == -1) goto end;
641  buf += len; size -= len;
642  if (lpLVItem->mask & LVIF_IMAGE)
643  len = snprintf(buf, size, "iImage=%d, ", lpLVItem->iImage);
644  else len = 0;
645  if (len == -1) goto end;
646  buf += len; size -= len;
647  if (lpLVItem->mask & LVIF_PARAM)
648  len = snprintf(buf, size, "lParam=%lx, ", lpLVItem->lParam);
649  else len = 0;
650  if (len == -1) goto end;
651  buf += len; size -= len;
652  if (lpLVItem->mask & LVIF_INDENT)
653  len = snprintf(buf, size, "iIndent=%d, ", lpLVItem->iIndent);
654  else len = 0;
655  if (len == -1) goto end;
656  buf += len;
657  goto undo;
658 end:
659  buf = text + strlen(text);
660 undo:
661  if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; }
662  return text;
663 }
int iImage
Definition: commctrl.h:2339
static char * debug_getbuf(void)
Definition: listview.c:564
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:340
UINT stateMask
Definition: commctrl.h:2336
#define LVIF_TEXT
Definition: commctrl.h:2281
int cchTextMax
Definition: commctrl.h:2338
int iSubItem
Definition: commctrl.h:2334
LPARAM lParam
Definition: commctrl.h:2340
smooth NULL
Definition: ftsmooth.c:416
#define LVIF_INDENT
Definition: commctrl.h:2285
static LPCSTR debugtext_tn(LPCWSTR text, BOOL isW, INT n)
Definition: listview.c:557
GLsizeiptr size
Definition: glext.h:5919
LPWSTR pszText
Definition: commctrl.h:2337
#define LVIF_IMAGE
Definition: commctrl.h:2282
UINT mask
Definition: commctrl.h:2332
static const WCHAR isW[]
Definition: tokenize.c:59
GLenum GLsizei len
Definition: glext.h:6722
UINT state
Definition: commctrl.h:2335
#define LVIF_PARAM
Definition: commctrl.h:2283
#define LVIF_STATE
Definition: commctrl.h:2284
int iIndent
Definition: commctrl.h:2341

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 614 of file listview.c.

615 {
616  if (!plvnm) return "(null)";
617  return wine_dbg_sprintf("iItem=%d, iSubItem=%d, uNewState=0x%x,"
618  " uOldState=0x%x, uChanged=0x%x, ptAction=%s, lParam=%ld",
619  plvnm->iItem, plvnm->iSubItem, plvnm->uNewState, plvnm->uOldState,
620  plvnm->uChanged, wine_dbgstr_point(&plvnm->ptAction), plvnm->lParam);
621 }
UINT uNewState
Definition: commctrl.h:3008
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:271
UINT uOldState
Definition: commctrl.h:3009
const char * wine_dbgstr_point(const POINT *guid)
POINT ptAction
Definition: commctrl.h:3011
LPARAM lParam
Definition: commctrl.h:3012

Referenced by notify_listview().

◆ debugrange()

static const char* debugrange ( const RANGE lprng)
inlinestatic

Definition at line 571 of file listview.c.

572 {
573  if (!lprng) return "(null)";
574  return wine_dbg_sprintf("[%d, %d]", lprng->lower, lprng->upper);
575 }
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 721 of file listview.c.

722 {
723  switch(nScrollCode)
724  {
725  case SB_LINELEFT: return "SB_LINELEFT";
726  case SB_LINERIGHT: return "SB_LINERIGHT";
727  case SB_PAGELEFT: return "SB_PAGELEFT";
728  case SB_PAGERIGHT: return "SB_PAGERIGHT";
729  case SB_THUMBPOSITION: return "SB_THUMBPOSITION";
730  case SB_THUMBTRACK: return "SB_THUMBTRACK";
731  case SB_ENDSCROLL: return "SB_ENDSCROLL";
732  case SB_INTERNAL: return "SB_INTERNAL";
733  default: return "unknown";
734  }
735 }
#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:343
#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 577 of file listview.c.

578 {
579  char* buf = debug_getbuf(), *text = buf;
580  int len, size = DEBUG_BUFFER_SIZE;
581 
582  if (pScrollInfo == NULL) return "(null)";
583  len = snprintf(buf, size, "{cbSize=%u, ", pScrollInfo->cbSize);
584  if (len == -1) goto end;
585  buf += len; size -= len;
586  if (pScrollInfo->fMask & SIF_RANGE)
587  len = snprintf(buf, size, "nMin=%d, nMax=%d, ", pScrollInfo->nMin, pScrollInfo->nMax);
588  else len = 0;
589  if (len == -1) goto end;
590  buf += len; size -= len;
591  if (pScrollInfo->fMask & SIF_PAGE)
592  len = snprintf(buf, size, "nPage=%u, ", pScrollInfo->nPage);
593  else len = 0;
594  if (len == -1) goto end;
595  buf += len; size -= len;
596  if (pScrollInfo->fMask & SIF_POS)
597  len = snprintf(buf, size, "nPos=%d, ", pScrollInfo->nPos);
598  else len = 0;
599  if (len == -1) goto end;
600  buf += len; size -= len;
601  if (pScrollInfo->fMask & SIF_TRACKPOS)
602  len = snprintf(buf, size, "nTrackPos=%d, ", pScrollInfo->nTrackPos);
603  else len = 0;
604  if (len == -1) goto end;
605  buf += len;
606  goto undo;
607 end:
608  buf = text + strlen(text);
609 undo:
610  if (buf - text > 2) { buf[-2] = '}'; buf[-1] = 0; }
611  return text;
612 }
static char * debug_getbuf(void)
Definition: listview.c:564
#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:340
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 551 of file listview.c.

552 {
553  if (text == LPSTR_TEXTCALLBACKW) return "(callback)";
554  return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
555 }
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:2352
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 557 of file listview.c.

558 {
559  if (text == LPSTR_TEXTCALLBACKW) return "(callback)";
560  n = min(textlenT(text, isW), n);
561  return isW ? debugstr_wn(text, n) : debugstr_an((LPCSTR)text, n);
562 }
const WCHAR * text
Definition: package.c:1827
GLdouble n
Definition: glext.h:7729
static int textlenT(LPCWSTR text, BOOL isW)
Definition: listview.c:465
const char * LPCSTR
Definition: xmlstorage.h:183
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2352
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 6072 of file listview.c.

6073 {
6074  return EditLblWndProcT(hwnd, uMsg, wParam, lParam, FALSE);
6075 }
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:6001
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 6001 of file listview.c.

6002 {
6004  BOOL save = TRUE;
6005 
6006  TRACE("(hwnd=%p, uMsg=%x, wParam=%lx, lParam=%lx, isW=%d)\n",
6007  hwnd, uMsg, wParam, lParam, isW);
6008 
6009  switch (uMsg)
6010  {
6011  case WM_GETDLGCODE:
6013 
6014  case WM_DESTROY:
6015  {
6016  WNDPROC editProc = infoPtr->EditWndProc;
6017  infoPtr->EditWndProc = 0;
6019  return CallWindowProcT(editProc, hwnd, uMsg, wParam, lParam, isW);
6020  }
6021 
6022  case WM_KEYDOWN:
6023  if (VK_ESCAPE == (INT)wParam)
6024  {
6025  save = FALSE;
6026  break;
6027  }
6028  else if (VK_RETURN == (INT)wParam)
6029  break;
6030 
6031  default:
6032  return CallWindowProcT(infoPtr->EditWndProc, hwnd, uMsg, wParam, lParam, isW);
6033  }
6034 
6035  /* kill the edit */
6036  if (infoPtr->hwndEdit)
6037  LISTVIEW_EndEditLabelT(infoPtr, save, isW);
6038 
6039  SendMessageW(hwnd, WM_CLOSE, 0, 0);
6040  return 0;
6041 }
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:1571
#define GetWindowLongPtrW
Definition: winuser.h:4730
#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:264
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:2880
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:5886
#define SetWindowLongPtrW
Definition: winuser.h:5247
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 6055 of file listview.c.

6056 {
6057  return EditLblWndProcT(hwnd, uMsg, wParam, lParam, TRUE);
6058 }
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:6001
LPARAM lParam
Definition: combotst.c:139

Referenced by CreateEditLabelT().

◆ get_ansi_notification()

static int get_ansi_notification ( UINT  unicodeNotificationCode)
static

Definition at line 740 of file listview.c.

741 {
742  switch (unicodeNotificationCode)
743  {
744  case LVN_BEGINLABELEDITA:
746  case LVN_ENDLABELEDITA:
748  case LVN_GETDISPINFOA:
749  case LVN_GETDISPINFOW: return LVN_GETDISPINFOA;
750  case LVN_SETDISPINFOA:
751  case LVN_SETDISPINFOW: return LVN_SETDISPINFOA;
752  case LVN_ODFINDITEMA:
753  case LVN_ODFINDITEMW: return LVN_ODFINDITEMA;
754  case LVN_GETINFOTIPA:
755  case LVN_GETINFOTIPW: return LVN_GETINFOTIPA;
756  /* header forwards */
757  case HDN_TRACKA:
758  case HDN_TRACKW: return HDN_TRACKA;
759  case HDN_ENDTRACKA:
760  case HDN_ENDTRACKW: return HDN_ENDTRACKA;
761  case HDN_BEGINDRAG: return HDN_BEGINDRAG;
762  case HDN_ENDDRAG: return HDN_ENDDRAG;
763  case HDN_ITEMCHANGINGA:
765  case HDN_ITEMCHANGEDA:
766  case HDN_ITEMCHANGEDW: return HDN_ITEMCHANGEDA;
767  case HDN_ITEMCLICKA:
768  case HDN_ITEMCLICKW: return HDN_ITEMCLICKA;
771  default: break;
772  }
773  FIXME("unknown notification %x\n", unicodeNotificationCode);
774  return unicodeNotificationCode;
775 }
#define HDN_ITEMCLICKW
Definition: commctrl.h:827
#define HDN_ITEMCHANGINGA
Definition: commctrl.h:822
#define LVN_GETDISPINFOA
Definition: commctrl.h:3125
#define HDN_ITEMCHANGEDA
Definition: commctrl.h:824
#define LVN_SETDISPINFOW
Definition: commctrl.h:3128
#define LVN_GETDISPINFOW
Definition: commctrl.h:3126
#define HDN_ITEMCHANGINGW
Definition: commctrl.h:823
#define FIXME(fmt,...)
Definition: debug.h:110
#define LVN_GETINFOTIPW
Definition: commctrl.h:3195
#define LVN_BEGINLABELEDITW
Definition: commctrl.h:3108
#define LVN_ODFINDITEMW
Definition: commctrl.h:3117
#define HDN_ENDTRACKA
Definition: commctrl.h:834
#define HDN_TRACKW
Definition: commctrl.h:837
#define HDN_ITEMCLICKA
Definition: commctrl.h:826
#define HDN_ENDTRACKW
Definition: commctrl.h:835
#define LVN_ODFINDITEMA
Definition: commctrl.h:3116
#define HDN_TRACKA
Definition: commctrl.h:836
#define HDN_ENDDRAG
Definition: commctrl.h:841
#define HDN_DIVIDERDBLCLICKA
Definition: commctrl.h:830
#define LVN_ENDLABELEDITW
Definition: commctrl.h:3110
#define LVN_ENDLABELEDITA
Definition: commctrl.h:3109
#define HDN_BEGINDRAG
Definition: commctrl.h:840
#define LVN_BEGINLABELEDITA
Definition: commctrl.h:3107
#define LVN_SETDISPINFOA
Definition: commctrl.h:3127
#define HDN_DIVIDERDBLCLICKW
Definition: commctrl.h:831
#define LVN_GETINFOTIPA
Definition: commctrl.h:3194
#define HDN_ITEMCHANGEDW
Definition: commctrl.h:825

Referenced by notify_dispinfoT(), and notify_forward_header().

◆ get_next_itemid()

static DWORD get_next_itemid ( const LISTVIEW_INFO infoPtr)
static

Definition at line 1618 of file listview.c.

1619 {
1620  INT count = DPA_GetPtrCount(infoPtr->hdpaItemIds);
1621 
1622  if (count > 0)
1623  {
1624  ITEM_ID *lpID = DPA_GetPtr(infoPtr->hdpaItemIds, count - 1);
1625  return lpID->id + 1;
1626  }
1627  return 0;
1628 }
UINT id
Definition: listview.c:184
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4926
#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 4183 of file listview.c.

4184 {
4185  if ( (lpLVItem->mask & LVIF_TEXT) &&
4186  (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) &&
4187  (lStyle & (LVS_SORTASCENDING | LVS_SORTDESCENDING)) ) return FALSE;
4188 
4189  return TRUE;
4190 }
#define TRUE
Definition: types.h:120
#define LVS_SORTDESCENDING
Definition: commctrl.h:2241
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVS_SORTASCENDING
Definition: commctrl.h:2240
LPWSTR pszText
Definition: commctrl.h:2337
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2352
UINT mask
Definition: commctrl.h:2332

Referenced by LISTVIEW_InsertItemT(), and LISTVIEW_SetItemT().

◆ is_autoarrange()

static BOOL is_autoarrange ( const LISTVIEW_INFO infoPtr)
inlinestatic

Definition at line 1578 of file listview.c.

1579 {
1580  return (infoPtr->dwStyle & LVS_AUTOARRANGE) &&
1581  (infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON);
1582 }
#define LVS_AUTOARRANGE
Definition: commctrl.h:2244
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2814
#define LV_VIEW_ICON
Definition: commctrl.h:2812

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 1306 of file listview.c.

1307 {
1308  ranges_destroy(i->ranges);
1309 }
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:3152

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

◆ iterator_empty()

static BOOL iterator_empty ( ITERATOR i)
inlinestatic

Definition at line 1314 of file listview.c.

1315 {
1316  ZeroMemory(i, sizeof(*i));
1317  i->nItem = i->nSpecial = i->range.lower = i->range.upper = -1;
1318  return TRUE;
1319 }
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1635
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 1440 of file listview.c.

1441 {
1442  RECT frame = *lprc;
1443  POINT Origin;
1444 
1445  TRACE("(lprc=%s)\n", wine_dbgstr_rect(lprc));
1446 
1447  LISTVIEW_GetOrigin(infoPtr, &Origin);
1448  OffsetRect(&frame, -Origin.x, -Origin.y);
1449 
1450  return iterator_frameditems_absolute(i, infoPtr, &frame);
1451 }
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4366
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:7548
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 
1351  /* in case we fail, we want to return an empty iterator */
1352  if (!iterator_empty(i)) return FALSE;
1353 
1354  TRACE("(frame=%s)\n", wine_dbgstr_rect(frame));
1355 
1356  if (infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON)
1357  {
1358  INT nItem;
1359 
1360  if (infoPtr->uView == LV_VIEW_ICON && infoPtr->nFocusedItem != -1)
1361  {
1362  LISTVIEW_GetItemBox(infoPtr, infoPtr->nFocusedItem, &rcItem);
1363  if (IntersectRect(&rcTemp, &rcItem, frame))
1364  i->nSpecial = infoPtr->nFocusedItem;
1365  }
1366  if (!(iterator_rangesitems(i, ranges_create(50)))) return FALSE;
1367  /* to do better here, we need to have PosX, and PosY sorted */
1368  TRACE("building icon ranges:\n");
1369  for (nItem = 0; nItem < infoPtr->nItemCount; nItem++)
1370  {
1371  rcItem.left = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosX, nItem);
1372  rcItem.top = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem);
1373  rcItem.right = rcItem.left + infoPtr->nItemWidth;
1374  rcItem.bottom = rcItem.top + infoPtr->nItemHeight;
1375  if (IntersectRect(&rcTemp, &rcItem, frame))
1376  ranges_additem(i->ranges, nItem);
1377  }
1378  return TRUE;
1379  }
1380  else if (infoPtr->uView == LV_VIEW_DETAILS)
1381  {
1382  RANGE range;
1383 
1384  if (frame->left >= infoPtr->nItemWidth) return TRUE;
1385  if (frame->top >= infoPtr->nItemHeight * infoPtr->nItemCount) return TRUE;
1386 
1387  range.lower = max(frame->top / infoPtr->nItemHeight, 0);
1388  range.upper = min((frame->bottom - 1) / infoPtr->nItemHeight, infoPtr->nItemCount - 1) + 1;
1389  if (range.upper <= range.lower) return TRUE;
1390  if (!iterator_rangeitems(i, range)) return FALSE;
1391  TRACE(" report=%s\n", debugrange(&i->range));
1392  }
1393  else
1394  {
1395  INT nPerCol = max((infoPtr->rcList.bottom - infoPtr->rcList.top) / infoPtr->nItemHeight, 1);
1396  INT nFirstRow = max(frame->top / infoPtr->nItemHeight, 0);
1397  INT nLastRow = min((frame->bottom - 1) / infoPtr->nItemHeight, nPerCol - 1);
1398  INT nFirstCol;
1399  INT nLastCol;
1400  INT lower;
1401  RANGE item_range;
1402  INT nCol;
1403 
1404  if (infoPtr->nItemWidth)
1405  {
1406  nFirstCol = max(frame->left / infoPtr->nItemWidth, 0);
1407  nLastCol = min((frame->right - 1) / infoPtr->nItemWidth, (infoPtr->nItemCount + nPerCol - 1) / nPerCol);
1408  }
1409  else
1410  {
1411  nFirstCol = max(frame->left, 0);
1412  nLastCol = min(frame->right - 1, (infoPtr->nItemCount + nPerCol - 1) / nPerCol);
1413  }
1414 
1415  lower = nFirstCol * nPerCol + nFirstRow;
1416 
1417  TRACE("nPerCol=%d, nFirstRow=%d, nLastRow=%d, nFirstCol=%d, nLastCol=%d, lower=%d\n",
1418  nPerCol, nFirstRow, nLastRow, nFirstCol, nLastCol, lower);
1419 
1420  if (nLastCol < nFirstCol || nLastRow < nFirstRow) return TRUE;
1421 
1422  if (!(iterator_rangesitems(i, ranges_create(nLastCol - nFirstCol + 1)))) return FALSE;
1423  TRACE("building list ranges:\n");
1424  for (nCol = nFirstCol; nCol <= nLastCol; nCol++)
1425  {
1426  item_range.lower = nCol * nPerCol + nFirstRow;
1427  if(item_range.lower >= infoPtr->nItemCount) break;
1428  item_range.upper = min(nCol * nPerCol + nLastRow + 1, infoPtr->nItemCount);
1429  TRACE(" list=%s\n", debugrange(&item_range));
1430  ranges_add(i->ranges, item_range);
1431  }
1432  }
1433 
1434  return TRUE;
1435 }
static BOOL ranges_additem(RANGES ranges, INT nItem)
Definition: listview.c:1136
#define LONG_PTR
Definition: treelist.c:79
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
static BOOL iterator_rangesitems(ITERATOR *i, RANGES ranges)
Definition: listview.c:1336
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
static BOOL iterator_empty(ITERATOR *i)
Definition: listview.c:1314
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:571
#define LV_VIEW_DETAILS
Definition: commctrl.h:2813
#define TRACE(s)
Definition: solgame.cpp:4
const char * wine_dbgstr_rect(const RECT *rect)
static BOOL iterator_rangeitems(ITERATOR *i, RANGE range)
Definition: listview.c:1324
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2814
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:3132
#define LV_VIEW_ICON
Definition: commctrl.h:2812
#define DPA_GetPtr
Definition: commctrl.h:5
#define min(a, b)
Definition: monoChain.cc:55
LONG bottom
Definition: windef.h:294
static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:2583
static BOOL ranges_add(RANGES ranges, RANGE range)
Definition: listview.c:3245

Referenced by iterator_frameditems(), and LISTVIEW_MarqueeHighlight().

◆ iterator_next()

static BOOL iterator_next ( ITERATOR i)
inlinestatic

Definition at line 1211 of file listview.c.

1212 {
1213  if (i->nItem == -1)
1214  {
1215  i->nItem = i->nSpecial;
1216  if (i->nItem != -1) return TRUE;
1217  }
1218  if (i->nItem == i->nSpecial)
1219  {
1220  if (i->ranges) i->index = 0;
1221  goto pickarange;
1222  }
1223 
1224  i->nItem++;
1225 testitem:
1226  if (i->nItem == i->nSpecial) i->nItem++;
1227  if (i->nItem < i->range.upper) return TRUE;
1228 
1229 pickarange:
1230  if (i->ranges)
1231  {
1232  if (i->index < DPA_GetPtrCount(i->ranges->hdpa))
1233  i->range = *(RANGE*)DPA_GetPtr(i->ranges->hdpa, i->index++);
1234  else goto end;
1235  }
1236  else if (i->nItem >= i->range.upper) goto end;
1237 
1238  i->nItem = i->range.lower;
1239  if (i->nItem >= 0) goto testitem;
1240 end:
1241  i->nItem = -1;
1242  return FALSE;
1243 }
#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:4926
#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 1251 of file listview.c.

1252 {
1253  BOOL start = FALSE;
1254 
1255  if (i->nItem == -1)
1256  {
1257  start = TRUE;
1258  if (i->ranges) i->index = DPA_GetPtrCount(i->ranges->hdpa);
1259  goto pickarange;
1260  }
1261  if (i->nItem == i->nSpecial)
1262  {
1263  i->nItem = -1;
1264  return FALSE;
1265  }
1266 
1267 testitem:
1268  i->nItem--;
1269  if (i->nItem == i->nSpecial) i->nItem--;
1270  if (i->nItem >= i->range.lower) return TRUE;
1271 
1272 pickarange:
1273  if (i->ranges)
1274  {
1275  if (i->index > 0)
1276  i->range = *(RANGE*)DPA_GetPtr(i->ranges->hdpa, --i->index);
1277  else goto end;
1278  }
1279  else if (!start && i->nItem < i->range.lower) goto end;
1280 
1281  i->nItem = i->range.upper;
1282  if (i->nItem > 0) goto testitem;
1283 end:
1284  return (i->nItem = i->nSpecial) != -1;
1285 }
#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:4926
#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 1287 of file listview.c.

1288 {
1289  RANGE range;
1290 
1291  if (!i->ranges) return i->range;
1292 
1293  if (DPA_GetPtrCount(i->ranges->hdpa) > 0)
1294  {
1295  range.lower = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, 0)).lower;
1296  range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, DPA_GetPtrCount(i->ranges->hdpa) - 1)).upper;
1297  }
1298  else range.lower = range.upper = 0;
1299 
1300  return range;
1301 }
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:4926
GLenum GLint * range
Definition: glext.h:7539
#define DPA_GetPtr
Definition: commctrl.h:5

Referenced by LISTVIEW_Refresh().

◆ iterator_rangeitems()

static BOOL iterator_rangeitems ( ITERATOR i,
RANGE  range 
)
inlinestatic

Definition at line 1324 of file listview.c.

1325 {
1326  iterator_empty(i);
1327  i->range = range;
1328  return TRUE;
1329 }
#define TRUE
Definition: types.h:120
static BOOL iterator_empty(ITERATOR *i)
Definition: listview.c:1314
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
GLenum GLint * range
Definition: glext.h:7539

Referenced by iterator_frameditems_absolute().

◆ iterator_rangesitems()

static BOOL iterator_rangesitems ( ITERATOR i,
RANGES  ranges 
)
inlinestatic

Definition at line 1336 of file listview.c.

1337 {
1338  iterator_empty(i);
1339  i->ranges = ranges;
1340  return TRUE;
1341 }
#define TRUE
Definition: types.h:120
static BOOL iterator_empty(ITERATOR *i)
Definition: listview.c:1314
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(), 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 1507 of file listview.c.

1508 {
1509  if(!iter1->ranges || !iter2->ranges) {
1510  int lower, upper;
1511 
1512  if(iter1->ranges || iter2->ranges ||
1513  (iter1->range.lower<iter2->range.lower && iter1->range.upper>iter2->range.upper) ||
1514  (iter1->range.lower>iter2->range.lower && iter1->range.upper<iter2->range.upper)) {
1515  ERR("result is not a one range iterator\n");
1516  return FALSE;
1517  }
1518 
1519  if(iter1->range.lower==-1 || iter2->range.lower==-1)
1520  return TRUE;
1521 
1522  lower = iter1->range.lower;
1523  upper = iter1->range.upper;
1524 
1525  if(lower < iter2->range.lower)
1526  iter1->range.upper = iter2->range.lower;
1527  else if(upper > iter2->range.upper)
1528  iter1->range.lower = iter2->range.upper;
1529  else
1530  iter1->range.lower = iter1->range.upper = -1;
1531 
1532  if(iter2->range.lower < lower)
1533  iter2->range.upper = lower;
1534  else if(iter2->range.upper > upper)
1535  iter2->range.lower = upper;
1536  else
1537  iter2->range.lower = iter2->range.upper = -1;
1538 
1539  return TRUE;
1540  }
1541 
1542  iterator_next(iter1);
1543  iterator_next(iter2);
1544 
1545  while(1) {
1546  if(iter1->nItem==-1 || iter2->nItem==-1)
1547  break;
1548 
1549  if(iter1->nItem == iter2->nItem) {
1550  int delete = iter1->nItem;
1551 
1552  iterator_prev(iter1);
1553  iterator_prev(iter2);
1554  ranges_delitem(iter1->ranges, delete);
1555  ranges_delitem(iter2->ranges, delete);
1556  iterator_next(iter1);
1557  iterator_next(iter2);
1558  } else if(iter1->nItem > iter2->nItem)
1559  iterator_next(iter2);
1560  else
1561  iterator_next(iter1);
1562  }
1563 
1564  iter1->nItem = iter1->range.lower = iter1->range.upper = -1;
1565  iter2->nItem = iter2->range.lower = iter2->range.upper = -1;
1566  return TRUE;
1567 }
#define TRUE
Definition: types.h:120
RANGES ranges
Definition: listview.c:204
static BOOL iterator_next(ITERATOR *i)
Definition: listview.c:1211
RANGE range
Definition: listview.c:203
static BOOL iterator_prev(ITERATOR *i)
Definition: listview.c:1251
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:1143

Referenced by LISTVIEW_MarqueeHighlight().

◆ iterator_visibleitems()

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

Definition at line 1456 of file listview.c.

1457 {
1458  POINT Origin, Position;
1459  RECT rcItem, rcClip;
1460  INT rgntype;
1461 
1462  rgntype = GetClipBox(hdc, &rcClip);
1463  if (rgntype == NULLREGION) return iterator_empty(i);
1464  if (!iterator_frameditems(i, infoPtr, &rcClip)) return FALSE;
1465  if (rgntype == SIMPLEREGION) return TRUE;
1466 
1467  /* first deal with the special item */
1468  if (i->nSpecial != -1)
1469  {
1470  LISTVIEW_GetItemBox(infoPtr, i->nSpecial, &rcItem);
1471  if (!RectVisible(hdc, &rcItem)) i->nSpecial = -1;
1472  }
1473 
1474  /* if we can't deal with the region, we'll just go with the simple range */
1475  LISTVIEW_GetOrigin(infoPtr, &Origin);
1476  TRACE("building visible range:\n");
1477  if (!i->ranges && i->range.lower < i->range.upper)
1478  {
1479  if (!(i->ranges = ranges_create(50))) return TRUE;
1480  if (!ranges_add(i->ranges, i->range))
1481  {
1482  ranges_destroy(i->ranges);
1483  i->ranges = 0;
1484  return TRUE;
1485  }
1486  }
1487 
1488  /* now delete the invisible items from the list */
1489  while(iterator_next(i))
1490  {
1491  LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
1492  rcItem.left = (infoPtr->uView == LV_VIEW_DETAILS) ? Origin.x : Position.x + Origin.x;
1493  rcItem.top = Position.y + Origin.y;
1494  rcItem.right = rcItem.left + infoPtr->nItemWidth;
1495  rcItem.bottom = rcItem.top + infoPtr->nItemHeight;
1496  if (!RectVisible(hdc, &rcItem))
1497  ranges_delitem(i->ranges, i->nItem);
1498  }
1499  /* the iterator should restart on the next iterator_next */
1500  TRACE("done\n");
1501 
1502  return TRUE;
1503 }
#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:7548
#define NULLREGION
Definition: wingdi.h:360
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
static BOOL iterator_next(ITERATOR *i)
Definition: listview.c:1211
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
static BOOL iterator_empty(ITERATOR *i)
Definition: listview.c:1314
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:2813
#define TRACE(s)
Definition: solgame.cpp:4
if(!(yy_init))
Definition: macro.lex.yy.c:714
static void ranges_destroy(RANGES ranges)
Definition: listview.c:3152
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:1440
#define SIMPLEREGION
Definition: wingdi.h:361
static RANGES ranges_create(int count)
Definition: listview.c:3132
BOOL WINAPI RectVisible(_In_ HDC, _In_ LPCRECT)
static BOOL ranges_delitem(RANGES ranges, INT nItem)
Definition: listview.c:1143
LONG bottom
Definition: windef.h:294
static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:2583
static BOOL ranges_add(RANGES ranges, RANGE range)
Definition: listview.c:3245
static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *, INT, LPPOINT)
Definition: listview.c:2274

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 3570 of file listview.c.

3571 {
3572  INT nFirst = min(infoPtr->nSelectionMark, nItem);
3573  INT nLast = max(infoPtr->nSelectionMark, nItem);
3574  HWND hwndSelf = infoPtr->hwndSelf;
3575  NMLVODSTATECHANGE nmlv;
3576  LVITEMW item;
3577  BOOL bOldChange;
3578  INT i;
3579 
3580  /* Temporarily disable change notification
3581  * If the control is LVS_OWNERDATA, we need to send
3582  * only one LVN_ODSTATECHANGED notification.
3583  * See MSDN documentation for LVN_ITEMCHANGED.
3584  */
3585  bOldChange = infoPtr->bDoChangeNotify;
3586  if (infoPtr->dwStyle & LVS_OWNERDATA) infoPtr->bDoChangeNotify = FALSE;
3587 
3588  if (nFirst == -1) nFirst = nItem;
3589 
3590  item.state = LVIS_SELECTED;
3591  item.stateMask = LVIS_SELECTED;
3592 
3593  for (i = nFirst; i <= nLast; i++)
3594  LISTVIEW_SetItemState(infoPtr,i,&item);
3595 
3596  ZeroMemory(&nmlv, sizeof(nmlv));
3597  nmlv.iFrom = nFirst;
3598  nmlv.iTo = nLast;
3599  nmlv.uOldState = 0;
3600  nmlv.uNewState = item.state;
3601 
3602  notify_hdr(infoPtr, LVN_ODSTATECHANGED, (LPNMHDR)&nmlv);
3603  if (!IsWindow(hwndSelf))
3604  return FALSE;
3605  infoPtr->bDoChangeNotify = bOldChange;
3606  return TRUE;
3607 }
#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:3120
#define ZeroMemory
Definition: winbase.h:1635
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LVIS_SELECTED
Definition: commctrl.h:2291
#define LVS_OWNERDATA
Definition: commctrl.h:2246
static ATOM item
Definition: dde.c:856
static LRESULT notify_hdr(const LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh)
Definition: listview.c:829
#define min(a, b)
Definition: monoChain.cc:55
BOOL bDoChangeNotify
Definition: listview.c:228
static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *, INT, const LVITEMW *)
Definition: listview.c:8986

Referenced by LISTVIEW_LButtonDown().

◆ LISTVIEW_ApproximateViewRect()

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

Definition at line 5309 of file listview.c.

5311 {
5312  DWORD dwViewRect = 0;
5313 
5314  if (nItemCount == -1)
5315  nItemCount = infoPtr->nItemCount;
5316 
5317  if (infoPtr->uView == LV_VIEW_LIST)
5318  {
5319  INT nItemCountPerColumn = 1;
5320  INT nColumnCount = 0;
5321 
5322  if (wHeight == 0xFFFF)
5323  {
5324  /* use current height */
5325  wHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
5326  }
5327 
5328  if (wHeight < infoPtr->nItemHeight)
5329  wHeight = infoPtr->nItemHeight;
5330 
5331  if (nItemCount > 0)
5332  {
5333  if (infoPtr->nItemHeight > 0)
5334  {
5335  nItemCountPerColumn = wHeight / infoPtr->nItemHeight;
5336  if (nItemCountPerColumn == 0)
5337  nItemCountPerColumn = 1;
5338 
5339  if (nItemCount % nItemCountPerColumn != 0)
5340  nColumnCount = nItemCount / nItemCountPerColumn;
5341  else
5342  nColumnCount = nItemCount / nItemCountPerColumn + 1;
5343  }
5344  }
5345 
5346  /* Microsoft padding magic */
5347  wHeight = nItemCountPerColumn * infoPtr->nItemHeight + 2;
5348  wWidth = nColumnCount * infoPtr->nItemWidth + 2;
5349 
5350  dwViewRect = MAKELONG(wWidth, wHeight);
5351  }
5352  else if (infoPtr->uView == LV_VIEW_DETAILS)
5353  {
5354  RECT rcBox;
5355 
5356  if (infoPtr->nItemCount > 0)
5357  {
5358  LISTVIEW_GetItemBox(infoPtr, 0, &rcBox);
5359  wWidth = rcBox.right - rcBox.left;
5360  wHeight = (rcBox.bottom - rcBox.top) * nItemCount;
5361  }
5362  else
5363  {
5364  /* use current height and width */
5365  if (wHeight == 0xffff)
5366  wHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
5367  if (wWidth == 0xffff)
5368  wWidth = infoPtr->rcList.right - infoPtr->rcList.left;
5369  }
5370 
5371  dwViewRect = MAKELONG(wWidth, wHeight);
5372  }
5373  else if (infoPtr->uView == LV_VIEW_ICON)
5374  {
5375  UINT rows,cols;
5376  UINT nItemWidth;
5377  UINT nItemHeight;
5378 
5379  nItemWidth = infoPtr->iconSpacing.cx;
5380  nItemHeight = infoPtr->iconSpacing.cy;
5381 
5382  if (wWidth == 0xffff)
5383  wWidth = infoPtr->rcList.right - infoPtr->rcList.left;
5384 
5385  if (wWidth < nItemWidth)
5386  wWidth = nItemWidth;
5387 
5388  cols = wWidth / nItemWidth;
5389  if (cols > nItemCount)
5390  cols = nItemCount;
5391  if (cols < 1)
5392  cols = 1;
5393 
5394  if (nItemCount)
5395  {
5396  rows = nItemCount / cols;
5397  if (nItemCount % cols)
5398  rows++;
5399  }
5400  else
5401  rows = 0;
5402 
5403  wHeight = (nItemHeight * rows)+2;
5404  wWidth = (nItemWidth * cols)+2;
5405 
5406  dwViewRect = MAKELONG(wWidth, wHeight);
5407  }
5408  else if (infoPtr->uView == LV_VIEW_SMALLICON)
5409  FIXME("uView == LV_VIEW_SMALLICON: not implemented\n");
5410 
5411  return dwViewRect;
5412 }
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
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:319
#define LV_VIEW_DETAILS
Definition: commctrl.h:2813
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2814
#define LV_VIEW_ICON
Definition: commctrl.h:2812
unsigned int UINT
Definition: ndis.h:50
#define LV_VIEW_LIST
Definition: commctrl.h:2815
LONG bottom
Definition: windef.h:294
static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *, INT, LPRECT)
Definition: listview.c:2583
LONG cy
Definition: windef.h:320

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_Arrange()

static BOOL LISTVIEW_Arrange ( LISTVIEW_INFO infoPtr,
INT  nAlignCode 
)
static

Definition at line 2791 of file listview.c.

2792 {
2793  void (*next_pos)(LISTVIEW_INFO *, LPPOINT);
2794  POINT pos;
2795  INT i;
2796 
2797  if (infoPtr->uView != LV_VIEW_ICON && infoPtr->uView != LV_VIEW_SMALLICON) return FALSE;
2798 
2799  TRACE("nAlignCode=%d\n", nAlignCode);
2800 
2801  if (nAlignCode == LVA_DEFAULT)
2802  {
2803  if (infoPtr->dwStyle & LVS_ALIGNLEFT) nAlignCode = LVA_ALIGNLEFT;
2804  else nAlignCode = LVA_ALIGNTOP;
2805  }
2806 
2807  switch (nAlignCode)
2808  {
2809  case LVA_ALIGNLEFT: next_pos = LISTVIEW_NextIconPosLeft; break;
2810  case LVA_ALIGNTOP: next_pos = LISTVIEW_NextIconPosTop; break;
2811  case LVA_SNAPTOGRID: next_pos = LISTVIEW_NextIconPosTop; break; /* FIXME */
2812  default: return FALSE;
2813  }
2814 
2815  infoPtr->currIconPos.x = infoPtr->currIconPos.y = 0;
2816  for (i = 0; i < infoPtr->nItemCount; i++)
2817  {
2818  next_pos(infoPtr, &pos);
2819  LISTVIEW_MoveIconTo(infoPtr, i, &pos, FALSE);
2820  }
2821 
2822  return TRUE;
2823 }
#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:2756
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:2252
#define LVA_SNAPTOGRID
Definition: commctrl.h:2502
#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:2701
#define LVA_ALIGNTOP
Definition: commctrl.h:2501
#define LV_VIEW_SMALLICON
Definition: commctrl.h:2814
#define LV_VIEW_ICON
Definition: commctrl.h:2812
POINT currIconPos
Definition: listview.c:276
#define LVA_ALIGNLEFT
Definition: commctrl.h:2500
#define LVA_DEFAULT
Definition: commctrl.h:2499
static void LISTVIEW_NextIconPosLeft(LISTVIEW_INFO *infoPtr, LPPOINT lpPos)
Definition: listview.c:2727

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 3004 of file listview.c.

3005 {
3006  INT nItemHeight;
3007 
3008  TRACE("uView=%d\n", infoPtr->uView);
3009 
3010  if (infoPtr->uView == LV_VIEW_ICON)
3011  nItemHeight = infoPtr->iconSpacing.cy;
3012  else
3013  {
3014  nItemHeight = infoPtr->ntmHeight;
3015  if (infoPtr->himlState)
3016  nItemHeight = max(nItemHeight, infoPtr->iconStateSize.cy);
3017  if (infoPtr->himlSmall)
3018  nItemHeight = max(nItemHeight, infoPtr->iconSize.cy);
3019  nItemHeight += HEIGHT_PADDING;
3020  if (infoPtr->nMeasureItemHeight > 0)
3021  nItemHeight = infoPtr->nMeasureItemHeight;
3022  }
3023 
3024  return max(nItemHeight, 1);
3025 }
#define max(a, b)
Definition: svc.c:63
HIMAGELIST himlState
Definition: listview.c:271
HIMAGELIST himlSmall
Definition: listview.c:270
int32_t INT
Definition: typedefs.h:56
#define HEIGHT_PADDING
Definition: listview.c:352
#define TRACE(s)
Definition: solgame.cpp:4
SIZE iconStateSize
Definition: listview.c:275
#define LV_VIEW_ICON
Definition: commctrl.h:2812
INT nMeasureItemHeight
Definition: listview.c:327
LONG cy
Definition: windef.h:320

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 2944 of file listview.c.

2945 {
2946  INT nItemWidth = 0;
2947 
2948  TRACE("uView=%d\n", infoPtr->uView);
2949 
2950  if (infoPtr->uView == LV_VIEW_ICON)
2951  nItemWidth = infoPtr->iconSpacing.cx;
2952  else if (infoPtr->uView == LV_VIEW_DETAILS)
2953  {
2954  if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0)
2955  {
2956  RECT rcHeader;
2957  INT index;
2958 
2960  DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, 0);
2961 
2962  LISTVIEW_GetHeaderRect(infoPtr, index, &rcHeader);
2963  nItemWidth = rcHeader.right;
2964  }
2965  }
2966  else /* LV_VIEW_SMALLICON, or LV_VIEW_LIST */
2967  {
2968  WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
2969  LVITEMW lvItem;
2970  INT i;
2971 
2972  lvItem.mask = LVIF_TEXT;
2973  lvItem.iSubItem = 0;
2974 
2975  for (i = 0; i < infoPtr->nItemCount; i++)
2976  {
2977  lvItem.iItem = i;
2978  lvItem.pszText = szDispText;
2979  lvItem.cchTextMax = DISP_TEXT_SIZE;
2980  if (LISTVIEW_GetItemW(infoPtr, &lvItem))
2981  nItemWidth = max(LISTVIEW_GetStringWidthT(infoPtr, lvItem.pszText, TRUE),
2982  nItemWidth);
2983  }
2984 
2985  if (infoPtr->himlSmall) nItemWidth += infoPtr->iconSize.cx;
2986  if (infoPtr->himlState) nItemWidth += infoPtr->iconStateSize.cx;
2987 
2988  nItemWidth = max(DEFAULT_COLUMN_WIDTH, nItemWidth + WIDTH_PADDING);
2989  }
2990 
2991  return nItemWidth;
2992 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
#define HDM_ORDERTOINDEX
Definition: commctrl.h:785
static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *, LPCWSTR, BOOL)
Definition: listview.c:7589
HIMAGELIST himlState
Definition: listview.c:271
HIMAGELIST himlSmall
Definition: listview.c:270
LONG right
Definition: windef.h:293
static void LISTVIEW_GetHeaderRect(const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc)
Definition: listview.c:1691
int32_t INT
Definition: typedefs.h:56
#define LVIF_TEXT
Definition: commctrl.h:2281
int cchTextMax
Definition: commctrl.h:2338
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:384
int iSubItem
Definition: commctrl.h:2334
LONG cx
Definition: windef.h:319
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4926
GLuint index
Definition: glext.h:6031
#define LV_VIEW_DETAILS
Definition: commctrl.h:2813
#define WIDTH_PADDING
Definition: listview.c:349
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR pszText
Definition: commctrl.h:2337
SIZE iconStateSize
Definition: listview.c:275
UINT mask
Definition: commctrl.h:2332
#define index(s, c)
Definition: various.h:29
#define LV_VIEW_ICON
Definition: commctrl.h:2812
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL LISTVIEW_GetItemW(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem)
Definition: listview.c:1703
#define DISP_TEXT_SIZE
Definition: listview.c:346

Referenced by LISTVIEW_UpdateItemSize().

◆ LISTVIEW_CallBackCompare()

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

Definition at line 9267 of file listview.c.

9268 {
9269  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam;
9270  ITEM_INFO* lv_first = DPA_GetPtr( first, 0 );
9271  ITEM_INFO* lv_second = DPA_GetPtr( second, 0 );
9272 
9273  /* Forward the call to the client defined callback */
9274  return (infoPtr->pfnCompare)( lv_first->lParam , lv_second->lParam, infoPtr->lParamSort );
9275 }
const GLint * first
Definition: glext.h:5794
LPARAM lParam
Definition: listview.c:177
LPARAM lParamSort
Definition: listview.c:255
#define DPA_GetPtr
Definition: commctrl.h:5
LPARAM lParam
Definition: combotst.c:139
PFNLVCOMPARE pfnCompare
Definition: listview.c:254

Referenced by LISTVIEW_SortItems().

◆ LISTVIEW_CallBackCompareEx()

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

Definition at line 9291 of file listview.c.

9292 {
9293  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam;
9294  INT first_idx = DPA_GetPtrIndex( infoPtr->hdpaItems, first );
9295  INT second_idx = DPA_GetPtrIndex( infoPtr->hdpaItems, second );
9296 
9297  /* Forward the call to the client defined callback */
9298  return (infoPtr->pfnCompare)( first_idx, second_idx, infoPtr->lParamSort );
9299 }
const GLint * first
Definition: glext.h:5794
int32_t INT
Definition: typedefs.h:56
LPARAM lParamSort
Definition: listview.c:255
INT WINAPI DPA_GetPtrIndex(HDPA hdpa, LPCVOID p)
Definition: dpa.c:561
LPARAM lParam
Definition: combotst.c:139
PFNLVCOMPARE pfnCompare
Definition: listview.c:254

Referenced by LISTVIEW_SortItems().

◆ LISTVIEW_CancelEditLabel()

static LRESULT LISTVIEW_CancelEditLabel ( LISTVIEW_INFO infoPtr)
static

Definition at line 5424 of file listview.c.

5425 {
5426  if (infoPtr->hwndEdit)
5427  {
5428  /* handle value will be lost after LISTVIEW_EndEditLabelT */
5429  HWND edit = infoPtr->hwndEdit;
5430 
5431  LISTVIEW_EndEditLabelT(infoPtr, TRUE, IsWindowUnicode(infoPtr->hwndEdit));
5432  SendMessageW(edit, WM_CLOSE, 0, 0);
5433  }
5434 
5435  return TRUE;
5436 }
#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:5886

Referenced by LISTVIEW_Command(), and LISTVIEW_WindowProc().

◆ LISTVIEW_Command()

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

Definition at line 11901 of file listview.c.

11902 {
11903 
11904  TRACE("(%p %x %x %lx)\n", infoPtr, HIWORD(wParam), LOWORD(wParam), lParam);
11905 
11906  if (!infoPtr->hwndEdit) return 0;
11907 
11908  switch (HIWORD(wParam))
11909  {
11910  case EN_UPDATE:
11911  {
11912  /*
11913  * Adjust the edit window size
11914  */
11915  WCHAR buffer[1024];
11916  HDC hdc = GetDC(infoPtr->hwndEdit);
11917  HFONT hFont, hOldFont = 0;
11918  RECT rect;
11919  SIZE sz;
11920 
11921  if (!infoPtr->hwndEdit || !hdc) return 0;
11923  GetWindowRect(infoPtr->hwndEdit, &rect);
11924 
11925  /* Select font to get the right dimension of the string */
11926  hFont = (HFONT)SendMessageW(infoPtr->hwndEdit, WM_GETFONT, 0, 0);
11927  if (hFont)
11928  {
11929  hOldFont = SelectObject(hdc, hFont);
11930  }
11931 
11933  {
11934  TEXTMETRICW textMetric;
11935 
11936  /* Add Extra spacing for the next character */
11937  GetTextMetricsW(hdc, &textMetric);
11938  sz.cx += (textMetric.tmMaxCharWidth * 2);
11939 
11940  SetWindowPos(infoPtr->hwndEdit, NULL, 0, 0, sz.cx,
11941  rect.bottom - rect.top, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOZORDER);
11942  }
11943  if (hFont)
11944  SelectObject(hdc, hOldFont);
11945 
11946  ReleaseDC(infoPtr->hwndEdit, hdc);
11947 
11948  break;
11949  }
11950  case EN_KILLFOCUS:
11951  {
11952  LISTVIEW_CancelEditLabel(infoPtr);
11953  break;
11954  }
11955 
11956  default:
11957  return SendMessageW (infoPtr->hwndNotify, WM_COMMAND, wParam, lParam);
11958  }
11959 
11960  return 0;
11961 }
LONG tmMaxCharWidth
Definition: wingdi.h:2384
#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:5424
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:407
& 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:319
#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 9572 of file listview.c.

9573 {
9575 
9576  TRACE("(lpcs=%p, style=0x%08x)\n", lpcs, lpcs->style);
9577 
9578  infoPtr->dwStyle = lpcs->style;
9579  map_style_view(infoPtr);
9580 
9581  infoPtr->notifyFormat = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT,
9582  (WPARAM)infoPtr->hwndSelf, NF_QUERY);
9583  /* on error defaulting to ANSI notifications */
9584  if (infoPtr->notifyFormat == 0) infoPtr->notifyFormat = NFR_ANSI;
9585  TRACE("notify format=%d\n", infoPtr->notifyFormat);
9586 
9587  if ((infoPtr->uView == LV_VIEW_DETAILS) && (lpcs->style & WS_VISIBLE))
9588  {
9589  if (LISTVIEW_CreateHeader(infoPtr) < 0) return -1;
9590  }
9591  else
9592  infoPtr->hwndHeader = 0;
9593 
9594  /* init item size to avoid division by 0 */
9595  LISTVIEW_UpdateItemSize (infoPtr);
9596  LISTVIEW_UpdateSize (infoPtr);
9597 
9598  if (infoPtr->uView == LV_VIEW_DETAILS)
9599  {
9600  if (!(LVS_NOCOLUMNHEADER & lpcs->style) && (WS_VISIBLE & lpcs->style))
9601  {
9602  ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL);
9603  }
9604  LISTVIEW_UpdateScroll(infoPtr);
9605  /* send WM_MEASUREITEM notification */
9606  if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED) notify_measureitem(infoPtr);
9607  }
9608 
9610 
9611  /* initialize the icon sizes */
9612  set_icon_size(&infoPtr->iconSize, infoPtr->himlNormal, infoPtr->uView != LV_VIEW_ICON);
9613  set_icon_size(&infoPtr->iconStateSize, infoPtr->himlState, TRUE);
9614  return 0;
9615 }
static void LISTVIEW_UpdateSize(LISTVIEW_INFO *)
Definition: listview.c:11082
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
SHORT notifyFormat
Definition: listview.c:226
#define TRUE
Definition: types.h:120
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2256
static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr)
Definition: listview.c:2143
HIMAGELIST himlState
Definition: listview.c:271
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL is_small)
Definition: listview.c:8760
static BOOL notify_measureitem(LISTVIEW_INFO *infoPtr)
Definition: listview.c:1110
static const WCHAR themeClass[]
Definition: listview.c:424
#define LV_VIEW_DETAILS
Definition: commctrl.h:2813
#define TRACE(s)
Definition: solgame.cpp:4
HIMAGELIST himlNormal
Definition: listview.c:269
SIZE iconStateSize
Definition: listview.c:275
static INT LISTVIEW_CreateHeader(LISTVIEW_INFO *infoPtr)
Definition: listview.c:1656
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
static void LISTVIEW_UpdateItemSize(LISTVIEW_INFO *infoPtr)
Definition: listview.c:3037
static void map_style_view(LISTVIEW_INFO *infoPtr)
Definition: listview.c:1599
#define NF_QUERY
Definition: winuser.h:2435
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define LV_VIEW_ICON
Definition: commctrl.h:2812
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:2255

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_CreateCheckBoxIL()

static HIMAGELIST LISTVIEW_CreateCheckBoxIL ( const LISTVIEW_INFO infoPtr)
static

Definition at line 8511 of file listview.c.

8512 {
8513  HDC hdc_wnd, hdc;
8514  HBITMAP hbm_im, hbm_mask, hbm_orig;
8515  RECT rc;
8516  HBRUSH hbr_white = GetStockObject(WHITE_BRUSH);
8517  HBRUSH hbr_black = GetStockObject(BLACK_BRUSH);
8518  HIMAGELIST himl;
8519 
8521  ILC_COLOR | ILC_MASK, 2, 2);
8522  hdc_wnd = GetDC(infoPtr->hwndSelf);
8523  hdc = CreateCompatibleDC(hdc_wnd);
8526  ReleaseDC(infoPtr->hwndSelf, hdc_wnd);
8527 
8529  hbm_orig = SelectObject(hdc, hbm_mask);
8530  FillRect(hdc, &rc, hbr_white);
8531  InflateRect(&rc, -2, -2);
8532  FillRect(hdc, &rc, hbr_black);
8533 
8534  SelectObject(hdc, hbm_im);
8536  SelectObject(hdc, hbm_orig);
8537  ImageList_Add(himl, hbm_im, hbm_mask);
8538 
8539  SelectObject(hdc, hbm_im);
8541  SelectObject(hdc, hbm_orig);
8542  ImageList_Add(himl, hbm_im, hbm_mask);
8543 
8544  DeleteObject(hbm_mask);
8545  DeleteObject(hbm_im);
8546  DeleteDC(hdc);
8547 
8548  return himl;
8549 }
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:337
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:336
#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 5450 of file listview.c.

5451 {
5452  RECT rcItem;
5453  SIZE size;
5454  POINT pos;
5455  HDC hdc, hdcOrig;
5456  HBITMAP hbmp, hOldbmp;
5457  HFONT hOldFont;
5458  HIMAGELIST dragList = 0;
5459  TRACE("iItem=%d Count=%d\n", iItem, infoPtr->nItemCount);
5460 
5461  if (iItem < 0 || iItem >= infoPtr->nItemCount || !lppt)
5462  return 0;
5463 
5464  rcItem.left = LVIR_BOUNDS;
5465  if (!LISTVIEW_GetItemRect(infoPtr, iItem, &rcItem))
5466  return 0;
5467 
5468  lppt->x = rcItem.left;
5469  lppt->y = rcItem.top;
5470 
5471  size.cx = rcItem.right - rcItem.left;
5472  size.cy = rcItem.bottom - rcItem.top;
5473 
5474  hdcOrig = GetDC(infoPtr->hwndSelf);
5475  hdc = CreateCompatibleDC(hdcOrig);
5476  hbmp = CreateCompatibleBitmap(hdcOrig, size.cx, size.cy);
5477  hOldbmp = SelectObject(hdc, hbmp);
5478  hOldFont = SelectObject(hdc, infoPtr->hFont);
5479 
5480  SetRect(&rcItem, 0, 0, size.cx, size.cy);
5481  FillRect(hdc, &rcItem, infoPtr->hBkBrush);
5482 
5483  pos.x = pos.y = 0;
5484  if (LISTVIEW_DrawItem(infoPtr, hdc, iItem, NULL, pos, CDRF_DODEFAULT))
5485  {
5486  dragList = ImageList_Create(size.cx, size.cy, ILC_COLOR, 10, 10);
5487  SelectObject(hdc, hOldbmp);
5488  ImageList_Add(dragList, hbmp, 0);
5489  }
5490  else
5491  SelectObject(hdc, hOldbmp);
5492 
5493  SelectObject(hdc, hOldFont);
5494  DeleteObject(hbmp);
5495  DeleteDC(hdc);
5496  ReleaseDC(infoPtr->hwndSelf, hdcOrig);
5497 
5498  TRACE("ret=%p\n", dragList);
5499 
5500  return dragList;
5501 }
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:295
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:292
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:291
LONG right
Definition: windef.h:293
static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERATOR *subitems, POINT pos, DWORD cdmode)
Definition: listview.c:4743
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:337
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:253
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:2444
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:7086
LONG bottom
Definition: windef.h:294
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)

Referenced by LISTVIEW_WindowProc().

◆ LISTVIEW_CreateHeader()

static INT LISTVIEW_CreateHeader ( LISTVIEW_INFO infoPtr)
static

Definition at line 1656 of file listview.c.

1657 {
1659  HINSTANCE hInst;
1660 
1661  if (infoPtr->hwndHeader) return 0;
1662 
1663  TRACE("Creating header for list %p\n", infoPtr->hwndSelf);
1664 
1665  /* setup creation flags */
1666  dFlags |= (LVS_NOSORTHEADER & infoPtr->dwStyle) ? 0 : HDS_BUTTONS;
1667  dFlags |= (LVS_NOCOLUMNHEADER & infoPtr->dwStyle) ? HDS_HIDDEN : 0;
1668 
1670 
1671  /* create header */
1672  infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL, dFlags,
1673  0, 0, 0, 0, infoPtr->hwndSelf, NULL, hInst, NULL);
1674  if (!infoPtr->hwndHeader) return -1;
1675 
1676  /* set header unicode format */
1678 
1679  /* set header font */
1680  SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, TRUE);
1681 
1682  /* set header image list */
1683  if (infoPtr->himlSmall)
1684  SendMessageW(infoPtr->hwndHeader, HDM_SETIMAGELIST, 0, (LPARAM)infoPtr->himlSmall);
1685 
1686  LISTVIEW_UpdateSize(infoPtr);
1687 
1688  return 0;
1689 }
static void LISTVIEW_UpdateSize(LISTVIEW_INFO *)
Definition: listview.c:11082
#define TRUE
Definition: types.h:120
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2256
UINT_PTR WPARAM
Definition: windef.h:207
HIMAGELIST himlSmall
Definition: listview.c:270
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
#define HDS_HORZ
Definition: commctrl.h:613
#define HDS_DRAGDROP
Definition: commctrl.h:617
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:616
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE HINSTANCE
Definition: typedefs.h:75
#define HDS_BUTTONS
Definition: commctrl.h:614
HINSTANCE hInst
Definition: dxdiag.c:13
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HDM_SETIMAGELIST
Definition: commctrl.h:779
#define WM_SETFONT
Definition: winuser.h:1632
#define GWLP_HINSTANCE
Definition: winuser.h:850
#define WC_HEADERW
Definition: commctrl.h:609
#define LVS_NOSORTHEADER
Definition: commctrl.h:2257
#define HDS_FULLDRAG
Definition: commctrl.h:618
#define HDM_SETUNICODEFORMAT
Definition: commctrl.h:806

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 9458 of file listview.c.

9459 {
9460  DELAYED_ITEM_EDIT *editItem = (DELAYED_ITEM_EDIT *)idEvent;
9462 
9463  KillTimer(hwnd, idEvent);
9464  editItem->fEnabled = FALSE;
9465  /* check if the item is still selected */
9466  if (infoPtr->bFocus && LISTVIEW_GetItemState(infoPtr, editItem->iItem, LVIS_SELECTED))
9467  LISTVIEW_EditLabelT(infoPtr, editItem->iItem, TRUE);
9468 }
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:7292
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define LVIS_SELECTED
Definition: commctrl.h:2291
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
Definition: listview.c:6128

Referenced by LISTVIEW_LButtonUp().

◆ LISTVIEW_DeleteAllItems()

static BOOL LISTVIEW_DeleteAllItems ( LISTVIEW_INFO infoPtr,
BOOL  destroy 
)
static

Definition at line 5515 of file listview.c.

5516 {
5517  HDPA hdpaSubItems = NULL;
5518  BOOL suppress = FALSE;
5519  ITEMHDR *hdrItem;
5520  ITEM_INFO *lpItem;
5521  ITEM_ID *lpID;
5522  INT i, j;
5523 
5524  TRACE("()\n");
5525 
5526  /* we do it directly, to avoid notifications */
5527  ranges_clear(infoPtr->selectionRanges);
5528  infoPtr->nSelectionMark = -1;
5529  infoPtr->nFocusedItem = -1;
5530  SetRectEmpty(&infoPtr->rcFocus);
5531  /* But we are supposed to leave nHotItem as is! */
5532 
5533  /* send LVN_DELETEALLITEMS notification */
5534  if (!(infoPtr->dwStyle & LVS_OWNERDATA) || !destroy)
5535  {
5536  NMLISTVIEW nmlv;
5537 
5538  memset(&nmlv, 0, sizeof(NMLISTVIEW));
5539  nmlv.iItem = -1;
5540  suppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv);
5541  }
5542 
5543  for (i = infoPtr->nItemCount - 1; i >= 0; i--)
5544  {
5545  if (!(infoPtr->dwStyle & LVS_OWNERDATA))
5546  {
5547  /* send LVN_DELETEITEM notification, if not suppressed
5548  and if it is not a virtual listview */
5549  if (!suppress) notify_deleteitem(infoPtr, i);
5550  hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i);
5551  lpItem = DPA_GetPtr(hdpaSubItems, 0);
5552  /* free id struct */
5553  j = DPA_GetPtrIndex(infoPtr->hdpaItemIds, lpItem->id);
5554  lpID = DPA_GetPtr(infoPtr->hdpaItemIds, j);
5555  DPA_DeletePtr(infoPtr->hdpaItemIds, j);
5556  Free(lpID);
5557  /* both item and subitem start with ITEMHDR header */
5558  for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++)
5559  {
5560  hdrItem = DPA_GetPtr(hdpaSubItems, j);
5561  if (is_text(hdrItem->pszText)) Free(hdrItem->pszText);
5562