#define ANIMATE_COLOR_NONE 0xffffffff
-static void ANIMATE_Notify(ANIMATE_INFO *infoPtr, UINT notif)
+static void ANIMATE_Notify(const ANIMATE_INFO *infoPtr, UINT notif)
{
SendMessageW(infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID(infoPtr->hwndSelf), notif),
(LPARAM)infoPtr->hwndSelf);
}
-static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPWSTR lpName)
+static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpName)
{
static const WCHAR aviW[] = { 'A', 'V', 'I', 0 };
HRSRC hrsrc;
infoPtr->transparentColor = ANIMATE_COLOR_NONE;
}
-static void ANIMATE_TransparentBlt(ANIMATE_INFO *infoPtr, HDC hdcDest, HDC hdcSource)
+static void ANIMATE_TransparentBlt(ANIMATE_INFO const *infoPtr, HDC hdcDest, HDC hdcSource)
{
HDC hdcMask;
HBITMAP hbmMask;
static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
{
- void *pBitmapData;
- LPBITMAPINFO pBitmapInfo;
+ void const *pBitmapData;
+ BITMAPINFO const *pBitmapInfo;
HDC hdcMem;
HBITMAP hbmOld;
int nOffsetX = 0;
}
-static BOOL ANIMATE_Create(HWND hWnd, LPCREATESTRUCTW lpcs)
+static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
{
static const WCHAR msvfw32W[] = { 'm', 's', 'v', 'f', 'w', '3', '2', '.', 'd', 'l', 'l', 0 };
ANIMATE_INFO *infoPtr;
}
-static BOOL ANIMATE_EraseBackground(ANIMATE_INFO *infoPtr, HDC hdc)
+static BOOL ANIMATE_EraseBackground(ANIMATE_INFO const *infoPtr, HDC hdc)
{
RECT rect;
HBRUSH hBrush = 0;
}
-static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT lpss)
+static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{
TRACE("(styletype=%x, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr);
typedef INT (WINAPI *cmp_func_t)(LPCWSTR, LPCWSTR);
-inline static BOOL is_textW(LPCWSTR str)
+static inline BOOL is_textW(LPCWSTR str)
{
return str && str != LPSTR_TEXTCALLBACKW;
}
-inline static BOOL is_textA(LPCSTR str)
+static inline BOOL is_textA(LPCSTR str)
{
return str && str != LPSTR_TEXTCALLBACKA;
}
-inline static LPCSTR debugstr_txt(LPCWSTR str)
+static inline LPCSTR debugstr_txt(LPCWSTR str)
{
if (str == LPSTR_TEXTCALLBACKW) return "(callback)";
return debugstr_w(str);
}
-static void COMBOEX_DumpItem (CBE_ITEMDATA *item)
+static void COMBOEX_DumpItem (CBE_ITEMDATA const *item)
{
TRACE("item %p - mask=%08x, pszText=%p, cchTM=%d, iImage=%d\n",
item, item->mask, item->pszText, item->cchTextMax, item->iImage);
}
-static void COMBOEX_DumpInput (COMBOBOXEXITEMW *input)
+static void COMBOEX_DumpInput (COMBOBOXEXITEMW const *input)
{
TRACE("input - mask=%08x, iItem=%d, pszText=%p, cchTM=%d, iImage=%d\n",
input->mask, input->iItem, input->pszText, input->cchTextMax,
}
-inline static CBE_ITEMDATA *get_item_data(COMBOEX_INFO *infoPtr, INT index)
+static inline CBE_ITEMDATA *get_item_data(COMBOEX_INFO *infoPtr, INT index)
{
return (CBE_ITEMDATA *)SendMessageW (infoPtr->hwndCombo, CB_GETITEMDATA,
(WPARAM)index, 0);
}
-inline static cmp_func_t get_cmp_func(COMBOEX_INFO *infoPtr)
+static inline cmp_func_t get_cmp_func(COMBOEX_INFO const *infoPtr)
{
return infoPtr->dwExtStyle & CBES_EX_CASESENSITIVE ? lstrcmpW : lstrcmpiW;
}
}
-static INT COMBOEX_GetIndex(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
+static INT COMBOEX_GetIndex(COMBOEX_INFO const *infoPtr, CBE_ITEMDATA const *item)
{
- CBE_ITEMDATA *moving;
+ CBE_ITEMDATA const *moving;
INT index;
-
+
moving = infoPtr->items;
index = infoPtr->nb_items - 1;
}
-static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO *infoPtr)
+static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO const *infoPtr)
{
return infoPtr->hwndEdit ? TRUE : FALSE;
}
static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index)
{
- CBE_ITEMDATA *item;
+ CBE_ITEMDATA const *item;
TRACE("(index=%d)\n", index);
}
-inline static BOOL COMBOEX_HasEditChanged (COMBOEX_INFO *infoPtr)
+static inline BOOL COMBOEX_HasEditChanged (COMBOEX_INFO const *infoPtr)
{
return COMBOEX_HasEdit(infoPtr) &&
(infoPtr->flags & WCBE_EDITHASCHANGED) == WCBE_EDITHASCHANGED;
}
-static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
+static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *cit)
{
INT index;
CBE_ITEMDATA *item;
}
-static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
+static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit)
{
COMBOBOXEXITEMW citW;
LPWSTR wstr = NULL;
return TRUE;
}
-static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
+static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit)
{
COMBOBOXEXITEMW citW;
LPWSTR wstr = NULL;
static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index)
{
- CBE_ITEMDATA *item1, *item2;
+ CBE_ITEMDATA const *item1;
+ CBE_ITEMDATA const *item2;
DWORD_PTR ret = 0;
item1 = get_item_data(infoPtr, index);
static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD_PTR data)
{
- CBE_ITEMDATA *item1, *item2;
+ CBE_ITEMDATA *item1;
+ CBE_ITEMDATA const *item2;
item1 = get_item_data(infoPtr, index);
if ((item1 != NULL) && ((LRESULT)item1 != CB_ERR)) {
}
-static INT COMBOEX_SetItemHeight (COMBOEX_INFO *infoPtr, INT index, UINT height)
+static INT COMBOEX_SetItemHeight (COMBOEX_INFO const *infoPtr, INT index, UINT height)
{
RECT cb_wrect, cbx_wrect, cbx_crect;
/* *** WM_xxx message support *** */
-static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs)
+static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
{
static const WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 };
static const WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 };
}
-static BOOL COMBOEX_WM_DeleteItem (COMBOEX_INFO *infoPtr, DELETEITEMSTRUCT *dis)
+static BOOL COMBOEX_WM_DeleteItem (COMBOEX_INFO *infoPtr, DELETEITEMSTRUCT const *dis)
{
CBE_ITEMDATA *item, *olditem;
NMCOMBOBOXEXW nmcit;
}
-static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
+static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *dis)
{
static const WCHAR nil[] = { 0 };
CBE_ITEMDATA *item = 0;
}
-static LRESULT COMBOEX_MeasureItem (COMBOEX_INFO *infoPtr, MEASUREITEMSTRUCT *mis)
+static LRESULT COMBOEX_MeasureItem (COMBOEX_INFO const *infoPtr, MEASUREITEMSTRUCT *mis)
{
static const WCHAR strW[] = { 'W', 0 };
SIZE mysize;
===================================================================
--- listview.c (revision 23123)
+++ listview.c (working copy)
-@@ -3804,9 +3804,8 @@
+@@ -3805,9 +3805,8 @@
if (himl && lvItem.iImage >= 0 && !IsRectEmpty(&rcIcon))
{
TRACE("iImage=%d\n", lvItem.iImage);
===================================================================
--- propsheet.c (revision 25766)
+++ propsheet.c (working copy)
-@@ -2429,6 +2429,28 @@
+@@ -2434,6 +2434,28 @@
return FALSE;
}
/******************************************************************************
* PROPSHEET_SetWizButtons
*
-@@ -2451,17 +2473,6 @@
+@@ -2456,17 +2478,6 @@
EnableWindow(hwndNext, FALSE);
EnableWindow(hwndFinish, FALSE);
if (dwFlags & PSWIZB_BACK)
EnableWindow(hwndBack, TRUE);
-@@ -2491,6 +2502,32 @@
+@@ -2496,6 +2507,32 @@
}
else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
EnableWindow(hwndFinish, TRUE);
INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData,
LPINT lpRegNum)
{
- LPWINEMRULIST mp = (LPWINEMRULIST)hList;
+ const WINEMRULIST *mp = (LPWINEMRULIST)hList;
INT ret;
UINT i;
LPSTR dataA = NULL;
*
* See CreateMRUListLazyA.
*/
-HANDLE WINAPI CreateMRUListLazyW (LPCREATEMRULISTW lpcml, DWORD dwParam2,
+HANDLE WINAPI CreateMRUListLazyW (const CREATEMRULISTW *lpcml, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4)
{
LPWINEMRULIST mp;
* RETURNS
* Handle to MRU list.
*/
-HANDLE WINAPI CreateMRUListLazyA (LPCREATEMRULISTA lpcml, DWORD dwParam2,
+HANDLE WINAPI CreateMRUListLazyA (const CREATEMRULISTA *lpcml, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4)
{
LPWINEMRULIST mp;
*
* See CreateMRUListA.
*/
-HANDLE WINAPI CreateMRUListW (LPCREATEMRULISTW lpcml)
+HANDLE WINAPI CreateMRUListW (const CREATEMRULISTW *lpcml)
{
return CreateMRUListLazyW(lpcml, 0, 0, 0);
}
* RETURNS
* Handle to MRU list.
*/
-HANDLE WINAPI CreateMRUListA (LPCREATEMRULISTA lpcml)
+HANDLE WINAPI CreateMRUListA (const CREATEMRULISTA *lpcml)
{
return CreateMRUListLazyA (lpcml, 0, 0, 0);
}
INT WINAPI EnumMRUListW (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize)
{
- LPWINEMRULIST mp = (LPWINEMRULIST) hList;
- LPWINEMRUITEM witem;
+ const WINEMRULIST *mp = (LPWINEMRULIST) hList;
+ const WINEMRUITEM *witem;
INT desired, datasize;
if (nItemPos >= mp->cursize) return -1;
INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize)
{
- LPWINEMRULIST mp = (LPWINEMRULIST) hList;
+ const WINEMRULIST *mp = (LPWINEMRULIST) hList;
LPWINEMRUITEM witem;
INT desired, datasize;
DWORD lenA;
* DoNotify [Internal]
*/
-static LRESULT DoNotify (LPNOTIFYDATA lpNotify, UINT uCode, LPNMHDR lpHdr)
+static LRESULT DoNotify (const NOTIFYDATA *lpNotify, UINT uCode, LPNMHDR lpHdr)
{
NMHDR nmhdr;
LPNMHDR lpNmh = NULL;
*
* TODO
* -- implement GetMUILanguage + InitMUILanguage
- * -- LibMain => DLLMain ("DLLMain takes over the functionality of both the
- * LibMain and the WEP function.", MSDN)
* -- finish NOTES for MenuHelp, GetEffectiveClientRect and GetStatusTextW
* -- FIXMEs + BUGS (search for them)
*
/* Get all the colors at DLL load */
COMCTL32_RefreshSysColors();
- /* register all Win95 common control classes */
+ /* like comctl32 5.82+ register all the common control classes */
ANIMATE_Register ();
+ COMBOEX_Register ();
+ DATETIME_Register ();
FLATSB_Register ();
HEADER_Register ();
HOTKEY_Register ();
+ IPADDRESS_Register ();
LISTVIEW_Register ();
+ MONTHCAL_Register ();
+ NATIVEFONT_Register ();
+ PAGER_Register ();
PROGRESS_Register ();
+ REBAR_Register ();
STATUS_Register ();
SYSLINK_Register ();
TAB_Register ();
*/
VOID WINAPI
-GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, LPINT lpInfo)
+GetEffectiveClientRect (HWND hwnd, LPRECT lpRect, const INT *lpInfo)
{
RECT rcCtrl;
- INT *lpRun;
+ const INT *lpRun;
HWND hwndCtrl;
TRACE("(%p %p %p)\n",
* (will be written ...)
*/
-void WINAPI DrawStatusTextW (HDC hdc, LPRECT lprc, LPCWSTR text, UINT style)
+void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style)
{
RECT r = *lprc;
UINT border = BDR_SUNKENOUTER;
* No return value.
*/
-void WINAPI DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style)
+void WINAPI DrawStatusTextA (HDC hdc, LPCRECT lprc, LPCSTR text, UINT style)
{
INT len;
LPWSTR textW = NULL;
* No return values.
*
* NOTES
- * This function is just a dummy.
- * The Win95 controls are registered at the DLL's initialization.
- * To register other controls InitCommonControlsEx() must be used.
+ * This function is just a dummy - all the controls are registered at
+ * the DLL's initialization. See InitCommonContolsEx for details.
*/
VOID WINAPI
* Failure: FALSE
*
* NOTES
- * Only the additional common controls are registered by this function.
- * The Win95 controls are registered at the DLL's initialization.
- *
- * FIXME
- * implement the following control classes:
- * ICC_LINK_CLASS
- * ICC_STANDARD_CLASSES
+ * Probaly all versions of comctl32 initializes the Win95 controls in DllMain
+ * during DLL initializaiton. Starting from comctl32 v5.82 all the controls
+ * are initialized there. We follow this behaviour and this function is just
+ * a dummy.
+ *
+ * Note: when writing programs under Windows, if you don't call any function
+ * from comctl32 the linker may not link this DLL. If InitCommonControlsEx
+ * was the only comctl32 function you were calling and you remove it you may
+ * have a false impression that InitCommonControlsEx actually did something.
*/
BOOL WINAPI
InitCommonControlsEx (const INITCOMMONCONTROLSEX *lpInitCtrls)
{
- INT cCount;
- DWORD dwMask;
-
- if (!lpInitCtrls)
- return FALSE;
- if (lpInitCtrls->dwSize != sizeof(INITCOMMONCONTROLSEX))
- return FALSE;
+ if (!lpInitCtrls || lpInitCtrls->dwSize != sizeof(INITCOMMONCONTROLSEX))
+ return FALSE;
TRACE("(0x%08x)\n", lpInitCtrls->dwICC);
-
- for (cCount = 0; cCount < 32; cCount++) {
- dwMask = 1 << cCount;
- if (!(lpInitCtrls->dwICC & dwMask))
- continue;
-
- switch (lpInitCtrls->dwICC & dwMask) {
- /* dummy initialization */
- case ICC_ANIMATE_CLASS:
- case ICC_BAR_CLASSES:
- case ICC_LISTVIEW_CLASSES:
- case ICC_TREEVIEW_CLASSES:
- case ICC_TAB_CLASSES:
- case ICC_UPDOWN_CLASS:
- case ICC_PROGRESS_CLASS:
- case ICC_HOTKEY_CLASS:
- break;
-
- /* advanced classes - not included in Win95 */
- case ICC_DATE_CLASSES:
- MONTHCAL_Register ();
- DATETIME_Register ();
- break;
-
- case ICC_USEREX_CLASSES:
- COMBOEX_Register ();
- break;
-
- case ICC_COOL_CLASSES:
- REBAR_Register ();
- break;
-
- case ICC_INTERNET_CLASSES:
- IPADDRESS_Register ();
- break;
-
- case ICC_PAGESCROLLER_CLASS:
- PAGER_Register ();
- break;
-
- case ICC_NATIVEFNTCTL_CLASS:
- NATIVEFONT_Register ();
- break;
-
- case ICC_LINK_CLASS:
- SYSLINK_Register ();
- break;
-
- default:
- FIXME("Unknown class! dwICC=0x%X\n", dwMask);
- break;
- }
- }
-
return TRUE;
}
/* set bitmap and button size */
/*If CreateToolbarEx receives 0, windows sets default values*/
- if (dxBitmap <= 0)
+ if (dxBitmap < 0)
dxBitmap = 16;
- if (dyBitmap <= 0)
- dyBitmap = 15;
- SendMessageW (hwndTB, TB_SETBITMAPSIZE, 0,
- MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap));
+ if (dyBitmap < 0)
+ dyBitmap = 16;
+ if (dxBitmap == 0 || dyBitmap == 0)
+ dxBitmap = dyBitmap = 16;
+ SendMessageW(hwndTB, TB_SETBITMAPSIZE, 0, MAKELPARAM(dxBitmap, dyBitmap));
- if (dxButton <= 0)
- dxButton = 24;
- if (dyButton <= 0)
- dyButton = 22;
- SendMessageW (hwndTB, TB_SETBUTTONSIZE, 0,
- MAKELPARAM((WORD)dxButton, (WORD)dyButton));
+ if (dxButton < 0)
+ dxButton = dxBitmap;
+ if (dyButton < 0)
+ dyButton = dyBitmap;
+ /* TB_SETBUTTONSIZE -> TB_SETBITMAPSIZE bug introduced for Windows compatibility */
+ if (dxButton != 0 && dyButton != 0)
+ SendMessageW(hwndTB, TB_SETBITMAPSIZE, 0, MAKELPARAM(dxButton, dyButton));
/* add bitmaps */
{
HGLOBAL hglb;
HRSRC hRsrc;
- LPBITMAPINFOHEADER lpBitmap, lpBitmapInfo;
+ const BITMAPINFOHEADER *lpBitmap;
+ LPBITMAPINFOHEADER lpBitmapInfo;
UINT nSize, nColorTableSize, iColor;
RGBQUAD *pColorTable;
INT i, iMaps, nWidth, nHeight;
if (hbm) {
HDC hdcDst = CreateCompatibleDC (hdcScreen);
HBITMAP hbmOld = SelectObject (hdcDst, hbm);
- LPBYTE lpBits = (LPBYTE)(lpBitmap + 1);
+ const BYTE *lpBits = (const BYTE *)(lpBitmap + 1);
lpBits += nColorTableSize * sizeof(RGBQUAD);
StretchDIBits (hdcDst, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS,
BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
UINT_PTR uID, DWORD_PTR *pdwRef)
{
- LPSUBCLASS_INFO stack;
- LPSUBCLASSPROCS proc;
+ const SUBCLASS_INFO *stack;
+ const SUBCLASSPROCS *proc;
TRACE ("(%p, %p, %x, %p)\n", hWnd, pfnSubclass, uID, pdwRef);
else
ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam);
} else {
- LPSUBCLASSPROCS proc = stack->stackpos;
+ const SUBCLASSPROCS *proc = stack->stackpos;
stack->stackpos = stack->stackpos->next;
/* call the Subclass procedure from the stack */
ret = proc->subproc (hWnd, uMsg, wParam, lParam,
return FALSE;
}
-static int CALLBACK PathWordBreakProc(LPWSTR lpch, int ichCurrent, int cch, int code)
+static int CALLBACK PathWordBreakProc(LPCWSTR lpch, int ichCurrent, int cch, int code)
{
if (code == WB_ISDELIMITER)
return IsDelimiter(lpch[ichCurrent]);
#define DTHT_MCPOPUP 0x300 /* & DTHT_DATEFIELD 0 when DATETIME_KeyDown */
#define DTHT_GOTFOCUS 0x400 /* tests for date-fields */
-static BOOL DATETIME_SendSimpleNotify (DATETIME_INFO *infoPtr, UINT code);
-static BOOL DATETIME_SendDateTimeChangeNotify (DATETIME_INFO *infoPtr);
+static BOOL DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code);
+static BOOL DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr);
extern void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to);
static const WCHAR allowedformatchars[] = {'d', 'h', 'H', 'm', 'M', 's', 't', 'y', 'X', '\'', 0};
static const int maxrepetition [] = {4,2,2,2,4,2,2,4,-1,-1};
static DWORD
-DATETIME_GetSystemTime (DATETIME_INFO *infoPtr, SYSTEMTIME *lprgSysTimeArray)
+DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *lprgSysTimeArray)
{
if (!lprgSysTimeArray) return GDT_NONE;
static BOOL
-DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, SYSTEMTIME *lprgSysTimeArray)
+DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *lprgSysTimeArray)
{
if (!lprgSysTimeArray) return 0;
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay,
lprgSysTimeArray->wHour, lprgSysTimeArray->wMinute, lprgSysTimeArray->wSecond);
- if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
- lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
- lprgSysTimeArray->wDayOfWeek > 6 ||
- lprgSysTimeArray->wDay < 1 || lprgSysTimeArray->wDay > 31 ||
- lprgSysTimeArray->wHour > 23 ||
- lprgSysTimeArray->wMinute > 59 ||
- lprgSysTimeArray->wSecond > 59 ||
- lprgSysTimeArray->wMilliseconds > 999
- )
- return 0;
-
if (flag == GDT_VALID) {
+ if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
+ lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
+ lprgSysTimeArray->wDayOfWeek > 6 ||
+ lprgSysTimeArray->wDay < 1 || lprgSysTimeArray->wDay > 31 ||
+ lprgSysTimeArray->wHour > 23 ||
+ lprgSysTimeArray->wMinute > 59 ||
+ lprgSysTimeArray->wSecond > 59 ||
+ lprgSysTimeArray->wMilliseconds > 999
+ )
+ return 0;
+
infoPtr->dateValid = TRUE;
MONTHCAL_CopyTime (lprgSysTimeArray, &infoPtr->date);
SendMessageW (infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0);
- } else if (flag == GDT_NONE) {
+ } else if ((infoPtr->dwStyle & DTS_SHOWNONE) && (flag == GDT_NONE)) {
infoPtr->dateValid = FALSE;
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_UNCHECKED, 0);
}
+ else
+ return 0;
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
return TRUE;
DATETIME_UseFormat (infoPtr, lpszFormat);
InvalidateRect (infoPtr->hwndSelf, NULL, TRUE);
- return infoPtr->nrFields;
+ return 1;
}
static void
-DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, LPWSTR result, int resultSize)
+DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int resultSize)
{
static const WCHAR fmt_dW[] = { '%', 'd', 0 };
static const WCHAR fmt__2dW[] = { '%', '.', '2', 'd', 0 };
static void
-DATETIME_ReturnFieldWidth (DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *fieldWidthPtr)
+DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *fieldWidthPtr)
{
/* fields are a fixed width, determined by the largest possible string */
/* presumably, these widths should be language dependent */
static INT
-DATETIME_HitTest (DATETIME_INFO *infoPtr, POINT pt)
+DATETIME_HitTest (const DATETIME_INFO *infoPtr, POINT pt)
{
int i;
if(IsWindowVisible(infoPtr->hMonthCal)) {
ShowWindow(infoPtr->hMonthCal, SW_HIDE);
} else {
- SYSTEMTIME *lprgSysTimeArray = &infoPtr->date;
+ const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date;
TRACE("update calendar %04d/%02d/%02d\n",
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay);
SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
static LRESULT
-DATETIME_EraseBackground (DATETIME_INFO *infoPtr, HDC hdc)
+DATETIME_EraseBackground (const DATETIME_INFO *infoPtr, HDC hdc)
{
HBRUSH hBrush, hSolidBrush = NULL;
RECT rc;
static LRESULT
-DATETIME_NCCreate (HWND hwnd, LPCREATESTRUCTW lpcs)
+DATETIME_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
{
DWORD dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
/* force control to have client edge */
static BOOL
-DATETIME_SendDateTimeChangeNotify (DATETIME_INFO *infoPtr)
+DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr)
{
NMDATETIMECHANGE dtdtc;
static BOOL
-DATETIME_SendSimpleNotify (DATETIME_INFO *infoPtr, UINT code)
+DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code)
{
NMHDR nmhdr;
static LRESULT
-DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT lpss)
+DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{
static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 };
static LRESULT
-DATETIME_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
+DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 };
DATETIME_INFO *infoPtr = (DATETIME_INFO *)Alloc (sizeof(DATETIME_INFO));
static BOOL HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask);
static void HEADER_FreeCallbackItems(HEADER_ITEM *lpItem);
static LRESULT HEADER_SendNotify(HWND hwnd, UINT code, NMHDR *hdr);
-static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT *rect);
+static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, const RECT *rect);
static const WCHAR themeClass[] = {'H','e','a','d','e','r',0};
static WCHAR emptyString[] = {0};
-static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *phdi, BOOL fUnicode)
+static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, const HDITEMW *phdi, BOOL fUnicode)
{
if (mask & HDI_UNSUPPORTED_FIELDS)
FIXME("unsupported header fields %x\n", (mask & HDI_UNSUPPORTED_FIELDS));
}
}
-inline static LRESULT
+static inline LRESULT
HEADER_IndexToOrder (HWND hwnd, INT iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
}
static void
-HEADER_ChangeItemOrder(HEADER_INFO *infoPtr, INT iItem, INT iNewOrder)
+HEADER_ChangeItemOrder(const HEADER_INFO *infoPtr, INT iItem, INT iNewOrder)
{
HEADER_ITEM *lpItem = &infoPtr->items[iItem];
INT i, nMin, nMax;
return 0;
}
-static void HEADER_GetHotDividerRect(HWND hwnd, HEADER_INFO *infoPtr, RECT *r)
+static void HEADER_GetHotDividerRect(HWND hwnd, const HEADER_INFO *infoPtr, RECT *r)
{
INT iDivider = infoPtr->iHotDivider;
if (infoPtr->uNumItem > 0)
static void
-HEADER_InternalHitTest (HWND hwnd, LPPOINT lpPt, UINT *pFlags, INT *pItem)
+HEADER_InternalHitTest (HWND hwnd, const POINT *lpPt, UINT *pFlags, INT *pItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
RECT rect, rcTest;
*
* NOTE: We depend on HDITEMA and HDITEMW having the same structure
*/
-static void HEADER_CopyHDItemForNotify(HEADER_INFO *infoPtr, HDITEMW *dest,
- HDITEMW *src, BOOL fSourceUnicode, LPVOID *ppvScratch)
+static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest,
+ const HDITEMW *src, BOOL fSourceUnicode, LPVOID *ppvScratch)
{
*ppvScratch = NULL;
*dest = *src;
}
static LRESULT
-HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT *rect)
+HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc, const RECT *rect)
{
NMCUSTOMDRAW nm;
nm.dwDrawStage = dwDrawStage;
HDC hMemoryDC;
HDC hDeviceDC;
int height, width;
+ HFONT hFont;
if (wParam < 0 || wParam >= infoPtr->uNumItem)
return FALSE;
ReleaseDC(NULL, hDeviceDC);
hOldBitmap = SelectObject(hMemoryDC, hMemory);
SetViewportOrgEx(hMemoryDC, -lpItem->rect.left, -lpItem->rect.top, NULL);
+ hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject(SYSTEM_FONT);
+ SelectObject(hMemoryDC, hFont);
GetClientRect(hwnd, &rc);
lCDFlags = HEADER_SendCtrlCustomDraw(hwnd, CDDS_PREPAINT, hMemoryDC, &rc);
}
-inline static LRESULT
+static inline LRESULT
HEADER_GetItemCount (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
return TRUE;
}
-inline static LRESULT
+static inline LRESULT
HEADER_GetUnicodeFormat (HWND hwnd)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
static LRESULT
-HEADER_InsertItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
+HEADER_InsertItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem;
}
static LRESULT
-HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
+HEADER_SetItemT (HWND hwnd, INT nItem, const HDITEMW *phdi, BOOL bUnicode)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem;
return TRUE;
}
-inline static LRESULT
+static inline LRESULT
HEADER_SetUnicodeFormat (HWND hwnd, WPARAM wParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
static BOOL
-HEADER_IsDragDistance(HEADER_INFO *infoPtr, POINT *pt)
+HEADER_IsDragDistance(const HEADER_INFO *infoPtr, const POINT *pt)
{
/* Windows allows for a mouse movement before starting the drag. We use the
* SM_CXDOUBLECLICK/SM_CYDOUBLECLICK as that distance.
#define IsOnlySet(flags) (infoPtr->CurrMod == (flags))
static BOOL
-HOTKEY_IsCombInv(HOTKEY_INFO *infoPtr)
+HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr)
{
TRACE("(infoPtr=%p)\n", infoPtr);
if((infoPtr->InvComb & HKCOMB_NONE) && !infoPtr->CurrMod)
}
static LRESULT
-HOTKEY_GetHotKey(HOTKEY_INFO *infoPtr)
+HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr)
{
TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
static LRESULT
-HOTKEY_Create (HOTKEY_INFO *infoPtr, LPCREATESTRUCTW lpcs)
+HOTKEY_Create (HOTKEY_INFO *infoPtr, const CREATESTRUCTW *lpcs)
{
infoPtr->hwndNotify = lpcs->hwndParent;
static LRESULT
-HOTKEY_EraseBackground (HOTKEY_INFO *infoPtr, HDC hdc)
+HOTKEY_EraseBackground (const HOTKEY_INFO *infoPtr, HDC hdc)
{
HBRUSH hBrush, hSolidBrush = NULL;
RECT rc;
}
-inline static LRESULT
-HOTKEY_GetFont (HOTKEY_INFO *infoPtr)
+static inline LRESULT
+HOTKEY_GetFont (const HOTKEY_INFO *infoPtr)
{
return (LRESULT)infoPtr->hFont;
}
static LRESULT
-HOTKEY_LButtonDown (HOTKEY_INFO *infoPtr)
+HOTKEY_LButtonDown (const HOTKEY_INFO *infoPtr)
{
if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED))
SetFocus (infoPtr->hwndSelf);
}
-inline static LRESULT
-HOTKEY_NCCreate (HWND hwnd, LPCREATESTRUCTW lpcs)
+static inline LRESULT
+HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
{
HOTKEY_INFO *infoPtr;
DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
himl->cx = cx;
himl->cy = cy;
himl->flags = flags;
- himl->cMaxImage = cInitial + cGrow;
+ himl->cMaxImage = cInitial + 1;
himl->cInitial = cInitial;
himl->cGrow = cGrow;
himl->clrFg = CLR_DEFAULT;
* RETURNS
* Success: TRUE
* Failure: FALSE
+ *
+ * FIXME: as the image list storage test shows, native comctl32 simply shifts
+ * images without creating a new bitmap.
*/
-
BOOL WINAPI
ImageList_Remove (HIMAGELIST himl, INT i)
{
HBITMAP hbmNewImage, hbmNewMask;
HDC hdcBmp;
- INT nCount;
SIZE sz;
TRACE("(himl=%p i=%d)\n", himl, i);
}
if (i == -1) {
+ INT nCount;
+
/* remove all */
if (himl->cCurImage == 0) {
/* remove all on empty ImageList is allowed */
return TRUE;
}
- himl->cMaxImage = himl->cInitial + himl->cGrow;
+ himl->cMaxImage = himl->cInitial + himl->cGrow - 1;
himl->cCurImage = 0;
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1;
TRACE("Remove single image! %d\n", i);
/* create new bitmap(s) */
- nCount = (himl->cCurImage + himl->cGrow - 1);
-
TRACE(" - Number of images: %d / %d (Old/New)\n",
himl->cCurImage, himl->cCurImage - 1);
- TRACE(" - Max. number of images: %d / %d (Old/New)\n",
- himl->cMaxImage, himl->cCurImage + himl->cGrow - 1);
- hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, nCount, himl->cx);
+ hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cx);
- imagelist_get_bitmap_size(himl, nCount, himl->cx, &sz );
+ imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cx, &sz );
if (himl->hbmMask)
hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
else
TRACE("Post image copy!\n");
SelectObject (hdcBmp, hbmNewImage);
- imagelist_copy_images( himl, himl->hdcImage, hdcBmp, i,
- (himl->cCurImage - i - 1), i - 1 );
+ imagelist_copy_images( himl, himl->hdcImage, hdcBmp, i + 1,
+ (himl->cCurImage - i), i );
if (himl->hbmMask) {
SelectObject (hdcBmp, hbmNewMask);
- imagelist_copy_images( himl, himl->hdcMask, hdcBmp, i,
- (himl->cCurImage - i - 1), i - 1 );
+ imagelist_copy_images( himl, himl->hdcMask, hdcBmp, i + 1,
+ (himl->cCurImage - i), i );
}
}
}
himl->cCurImage--;
- himl->cMaxImage = himl->cCurImage + himl->cGrow;
}
return TRUE;
return FALSE;
/* remove all images */
- himl->cMaxImage = himl->cInitial + himl->cGrow;
+ himl->cMaxImage = himl->cInitial + 1;
himl->cCurImage = 0;
himl->cx = cx;
himl->cy = cy;
/* setup BITMAPFILEHEADER */
bmfh->bfType = (('M' << 8) | 'B');
- bmfh->bfSize = 0;
+ bmfh->bfSize = offBits;
bmfh->bfReserved1 = 0;
bmfh->bfReserved2 = 0;
bmfh->bfOffBits = offBits;
#include "winbase.h"
#include "wingdi.h"
-#include "pshpack1.h"
-
/* the ones with offsets at the end are the same as in Windows */
struct _IMAGELIST
{
#define IMAGELIST_MAGIC 0x53414D58
/* Header used by ImageList_Read() and ImageList_Write() */
+#include "pshpack2.h"
typedef struct _ILHEAD
{
USHORT usMagic;
WORD flags;
SHORT ovls[4];
} ILHEAD;
-
#include "poppack.h"
+
#endif /* __WINE_IMAGELIST_H */
static LRESULT CALLBACK
IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-static LRESULT IPADDRESS_Notify (IPADDRESS_INFO *infoPtr, UINT command)
+static LRESULT IPADDRESS_Notify (const IPADDRESS_INFO *infoPtr, UINT command)
{
HWND hwnd = infoPtr->Self;
MAKEWPARAM (GetWindowLongPtrW (hwnd, GWLP_ID), command), (LPARAM)hwnd);
}
-static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value)
+static INT IPADDRESS_IPNotify (const IPADDRESS_INFO *infoPtr, INT field, INT value)
{
NMIPADDRESS nmip;
}
-static int IPADDRESS_GetPartIndex(IPADDRESS_INFO *infoPtr, HWND hwnd)
+static int IPADDRESS_GetPartIndex(const IPADDRESS_INFO *infoPtr, HWND hwnd)
{
int i;
}
-static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
+static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
{
static const WCHAR dotW[] = { '.', 0 };
RECT rect, rcPart;
}
-static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
+static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
{
static const WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 };
IPADDRESS_INFO *infoPtr;
}
-static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc)
+static LRESULT IPADDRESS_Paint (const IPADDRESS_INFO *infoPtr, HDC hdc)
{
PAINTSTRUCT ps;
}
-static BOOL IPADDRESS_IsBlank (IPADDRESS_INFO *infoPtr)
+static BOOL IPADDRESS_IsBlank (const IPADDRESS_INFO *infoPtr)
{
int i;
}
-static int IPADDRESS_GetAddress (IPADDRESS_INFO *infoPtr, LPDWORD ip_address)
+static int IPADDRESS_GetAddress (const IPADDRESS_INFO *infoPtr, LPDWORD ip_address)
{
WCHAR field[5];
int i, invalid = 0;
}
-static void IPADDRESS_ClearAddress (IPADDRESS_INFO *infoPtr)
+static void IPADDRESS_ClearAddress (const IPADDRESS_INFO *infoPtr)
{
WCHAR nil[1] = { 0 };
int i;
}
-static LRESULT IPADDRESS_SetAddress (IPADDRESS_INFO *infoPtr, DWORD ip_address)
+static LRESULT IPADDRESS_SetAddress (const IPADDRESS_INFO *infoPtr, DWORD ip_address)
{
WCHAR buf[20];
static const WCHAR fmt[] = { '%', 'd', 0 };
TRACE("\n");
for (i = 3; i >= 0; i--) {
- IPPART_INFO* part = &infoPtr->Part[i];
+ const IPPART_INFO* part = &infoPtr->Part[i];
int value = ip_address & 0xff;
if ( (value >= part->LowerLimit) && (value <= part->UpperLimit) ) {
wsprintfW (buf, fmt, value);
}
-static void IPADDRESS_SetFocusToField (IPADDRESS_INFO *infoPtr, INT index)
+static void IPADDRESS_SetFocusToField (const IPADDRESS_INFO *infoPtr, INT index)
{
TRACE("(index=%d)\n", index);
}
-static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield)
+static BOOL IPADDRESS_ConstrainField (const IPADDRESS_INFO *infoPtr, int currentfield)
{
- IPPART_INFO *part = &infoPtr->Part[currentfield];
+ const IPPART_INFO *part = &infoPtr->Part[currentfield];
WCHAR field[10];
static const WCHAR fmt[] = { '%', 'd', 0 };
int curValue, newValue;
}
-static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel)
+static BOOL IPADDRESS_GotoNextField (const IPADDRESS_INFO *infoPtr, int cur, int sel)
{
TRACE("\n");
IPADDRESS_ConstrainField(infoPtr, cur);
if(cur < 3) {
- IPPART_INFO *next = &infoPtr->Part[cur + 1];
+ const IPPART_INFO *next = &infoPtr->Part[cur + 1];
int start = 0, end = 0;
SetFocus (next->EditHwnd);
if (sel != POS_DEFAULT) {
/*
* forward declarations
*/
-static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *, LPLVITEMW, BOOL);
-static void LISTVIEW_GetItemBox(LISTVIEW_INFO *, INT, LPRECT);
-static void LISTVIEW_GetItemOrigin(LISTVIEW_INFO *, INT, LPPOINT);
-static BOOL LISTVIEW_GetItemPosition(LISTVIEW_INFO *, INT, LPPOINT);
-static BOOL LISTVIEW_GetItemRect(LISTVIEW_INFO *, INT, LPRECT);
-static INT LISTVIEW_GetLabelWidth(LISTVIEW_INFO *, INT);
-static void LISTVIEW_GetOrigin(LISTVIEW_INFO *, LPPOINT);
-static BOOL LISTVIEW_GetViewRect(LISTVIEW_INFO *, LPRECT);
+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 INT LISTVIEW_GetLabelWidth(const LISTVIEW_INFO *, INT);
+static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *, LPPOINT);
+static BOOL LISTVIEW_GetViewRect(const LISTVIEW_INFO *, LPRECT);
static void LISTVIEW_SetGroupSelection(LISTVIEW_INFO *, INT);
-static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *, const LVITEMW *, BOOL);
-static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *);
+static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *, LVITEMW *, BOOL);
+static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *);
static void LISTVIEW_SetSelection(LISTVIEW_INFO *, INT);
static void LISTVIEW_UpdateSize(LISTVIEW_INFO *);
static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *, INT, BOOL);
-static LRESULT LISTVIEW_Command(LISTVIEW_INFO *, WPARAM, LPARAM);
+static LRESULT LISTVIEW_Command(const LISTVIEW_INFO *, WPARAM, LPARAM);
static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *, PFNLVCOMPARE, LPARAM);
-static INT LISTVIEW_GetStringWidthT(LISTVIEW_INFO *, LPCWSTR, BOOL);
+static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *, LPCWSTR, BOOL);
static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *, INT);
-static UINT LISTVIEW_GetItemState(LISTVIEW_INFO *, INT, UINT);
+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, HWND);
static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *, INT, INT, HWND);
-static INT LISTVIEW_GetTopIndex(LISTVIEW_INFO *);
+static INT LISTVIEW_GetTopIndex(const LISTVIEW_INFO *);
static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL);
static HWND CreateEditLabelT(LISTVIEW_INFO *, LPCWSTR, DWORD, INT, INT, INT, INT, BOOL);
static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST);
-static INT LISTVIEW_HitTest(LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL);
+static INT LISTVIEW_HitTest(const LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL);
/******** Text handling functions *************************************/
* dest is a pointer to a Unicode string
* src is a pointer to a string (Unicode if isW, ANSI if !isW)
*/
-static BOOL textsetptrT(LPWSTR *dest, LPWSTR src, BOOL isW)
+static BOOL textsetptrT(LPWSTR *dest, LPCWSTR src, BOOL isW)
{
BOOL bResult = TRUE;
/******** Notification functions i************************************/
-static LRESULT notify_forward_header(LISTVIEW_INFO *infoPtr, const NMHEADERW *lpnmh)
+static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, const NMHEADERW *lpnmh)
{
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM)lpnmh->hdr.idFrom, (LPARAM)lpnmh);
}
-static LRESULT notify_hdr(LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh)
+static LRESULT notify_hdr(const LISTVIEW_INFO *infoPtr, INT code, LPNMHDR pnmh)
{
LRESULT result;
return result;
}
-static inline BOOL notify(LISTVIEW_INFO *infoPtr, INT code)
+static inline BOOL notify(const LISTVIEW_INFO *infoPtr, INT code)
{
NMHDR nmh;
HWND hwnd = infoPtr->hwndSelf;
return IsWindow(hwnd);
}
-static inline void notify_itemactivate(LISTVIEW_INFO *infoPtr, LVHITTESTINFO *htInfo)
+static inline void notify_itemactivate(const LISTVIEW_INFO *infoPtr, const LVHITTESTINFO *htInfo)
{
NMITEMACTIVATE nmia;
LVITEMW item;
notify_hdr(infoPtr, LVN_ITEMACTIVATE, (LPNMHDR)&nmia);
}
-static inline LRESULT notify_listview(LISTVIEW_INFO *infoPtr, INT code, LPNMLISTVIEW plvnm)
+static inline LRESULT notify_listview(const LISTVIEW_INFO *infoPtr, INT code, LPNMLISTVIEW plvnm)
{
TRACE("(code=%d, plvnm=%s)\n", code, debugnmlistview(plvnm));
return notify_hdr(infoPtr, code, (LPNMHDR)plvnm);
}
-static BOOL notify_click(LISTVIEW_INFO *infoPtr, INT code, LVHITTESTINFO *lvht)
+static BOOL notify_click(const LISTVIEW_INFO *infoPtr, INT code, const LVHITTESTINFO *lvht)
{
NMLISTVIEW nmlv;
LVITEMW item;
return IsWindow(hwnd);
}
-static BOOL notify_deleteitem(LISTVIEW_INFO *infoPtr, INT nItem)
+static BOOL notify_deleteitem(const LISTVIEW_INFO *infoPtr, INT nItem)
{
NMLISTVIEW nmlv;
LVITEMW item;
pdi : dispinfo structure (can be unicode or ansi)
isW : TRUE if dispinfo is Unicode
*/
-static BOOL notify_dispinfoT(LISTVIEW_INFO *infoPtr, INT notificationCode, LPNMLVDISPINFOW pdi, BOOL isW)
+static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, INT notificationCode, LPNMLVDISPINFOW pdi, BOOL isW)
{
BOOL bResult = FALSE;
BOOL convertToAnsi = FALSE, convertToUnicode = FALSE;
return bResult;
}
-static void customdraw_fill(NMLVCUSTOMDRAW *lpnmlvcd, LISTVIEW_INFO *infoPtr, HDC hdc,
+static void customdraw_fill(NMLVCUSTOMDRAW *lpnmlvcd, const LISTVIEW_INFO *infoPtr, HDC hdc,
const RECT *rcBounds, const LVITEMW *lplvItem)
{
ZeroMemory(lpnmlvcd, sizeof(NMLVCUSTOMDRAW));
lpnmlvcd->nmcd.lItemlParam = lplvItem->lParam;
}
-static inline DWORD notify_customdraw (LISTVIEW_INFO *infoPtr, DWORD dwDrawStage, NMLVCUSTOMDRAW *lpnmlvcd)
+static inline DWORD notify_customdraw (const LISTVIEW_INFO *infoPtr, DWORD dwDrawStage, NMLVCUSTOMDRAW *lpnmlvcd)
{
BOOL isForItem = (lpnmlvcd->nmcd.dwItemSpec != 0);
DWORD result;
return result;
}
-static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd)
+static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd)
{
if (lpnmlvcd->clrTextBk == CLR_DEFAULT)
lpnmlvcd->clrTextBk = comctl32_color.clrWindow;
SetTextColor(hdc, lpnmlvcd->clrText);
}
-static inline DWORD notify_postpaint (LISTVIEW_INFO *infoPtr, NMLVCUSTOMDRAW *lpnmlvcd)
+static inline DWORD notify_postpaint (const LISTVIEW_INFO *infoPtr, NMLVCUSTOMDRAW *lpnmlvcd)
{
return notify_customdraw(infoPtr, CDDS_POSTPAINT, lpnmlvcd);
}
return (i->nItem = i->nSpecial) != -1;
}
-static RANGE iterator_range(ITERATOR* i)
+static RANGE iterator_range(const ITERATOR *i)
{
RANGE range;
/***
* Releases resources associated with this ierator.
*/
-static inline void iterator_destroy(ITERATOR* i)
+static inline void iterator_destroy(const ITERATOR *i)
{
ranges_destroy(i->ranges);
}
/***
* Creates an iterator over the items which intersect lprc.
*/
-static BOOL iterator_frameditems(ITERATOR* i, LISTVIEW_INFO* infoPtr, const RECT *lprc)
+static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, const RECT *lprc)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
RECT frame = *lprc, rcItem, rcTemp;
/***
* Creates an iterator over the items which intersect the visible region of hdc.
*/
-static BOOL iterator_visibleitems(ITERATOR *i, LISTVIEW_INFO *infoPtr, HDC hdc)
+static BOOL iterator_visibleitems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC hdc)
{
POINT Origin, Position;
RECT rcItem, rcClip;
else return CallWindowProcA(proc, hwnd, uMsg, wParam, lParam);
}
-static inline BOOL is_autoarrange(LISTVIEW_INFO *infoPtr)
+static inline BOOL is_autoarrange(const LISTVIEW_INFO *infoPtr)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
/******** Internal API functions ************************************/
-static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(LISTVIEW_INFO *infoPtr, INT nSubItem)
+static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(const LISTVIEW_INFO *infoPtr, INT nSubItem)
{
static COLUMN_INFO mainItem;
return (COLUMN_INFO *)DPA_GetPtr(infoPtr->hdpaColumns, nSubItem);
}
-static inline void LISTVIEW_GetHeaderRect(LISTVIEW_INFO *infoPtr, INT nSubItem, RECT *lprc)
+static inline void LISTVIEW_GetHeaderRect(const LISTVIEW_INFO *infoPtr, INT nSubItem, LPRECT lprc)
{
*lprc = LISTVIEW_GetColumnInfo(infoPtr, nSubItem)->rcHeader;
}
-static inline BOOL LISTVIEW_GetItemW(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem)
+static inline BOOL LISTVIEW_GetItemW(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem)
{
return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE);
}
/* Listview invalidation functions: use _only_ these functions to invalidate */
-static inline BOOL is_redrawing(LISTVIEW_INFO *infoPtr)
+static inline BOOL is_redrawing(const LISTVIEW_INFO *infoPtr)
{
return infoPtr->bRedraw;
}
-static inline void LISTVIEW_InvalidateRect(LISTVIEW_INFO *infoPtr, const RECT* rect)
+static inline void LISTVIEW_InvalidateRect(const LISTVIEW_INFO *infoPtr, const RECT* rect)
{
if(!is_redrawing(infoPtr)) return;
TRACE(" invalidating rect=%s\n", wine_dbgstr_rect(rect));
InvalidateRect(infoPtr->hwndSelf, rect, TRUE);
}
-static inline void LISTVIEW_InvalidateItem(LISTVIEW_INFO *infoPtr, INT nItem)
+static inline void LISTVIEW_InvalidateItem(const LISTVIEW_INFO *infoPtr, INT nItem)
{
RECT rcBox;
LISTVIEW_InvalidateRect(infoPtr, &rcBox);
}
-static inline void LISTVIEW_InvalidateSubItem(LISTVIEW_INFO *infoPtr, INT nItem, INT nSubItem)
+static inline void LISTVIEW_InvalidateSubItem(const LISTVIEW_INFO *infoPtr, INT nItem, INT nSubItem)
{
POINT Origin, Position;
RECT rcBox;
LISTVIEW_InvalidateRect(infoPtr, &rcBox);
}
-static inline void LISTVIEW_InvalidateList(LISTVIEW_INFO *infoPtr)
+static inline void LISTVIEW_InvalidateList(const LISTVIEW_INFO *infoPtr)
{
LISTVIEW_InvalidateRect(infoPtr, NULL);
}
-static inline void LISTVIEW_InvalidateColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
+static inline void LISTVIEW_InvalidateColumn(const LISTVIEW_INFO *infoPtr, INT nColumn)
{
RECT rcCol;
* RETURN:
* Number of items per row.
*/
-static inline INT LISTVIEW_GetCountPerRow(LISTVIEW_INFO *infoPtr)
+static inline INT LISTVIEW_GetCountPerRow(const LISTVIEW_INFO *infoPtr)
{
INT nListWidth = infoPtr->rcList.right - infoPtr->rcList.left;
* RETURN:
* Number of items per column.
*/
-static inline INT LISTVIEW_GetCountPerColumn(LISTVIEW_INFO *infoPtr)
+static inline INT LISTVIEW_GetCountPerColumn(const LISTVIEW_INFO *infoPtr)
{
INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
* RETURNS
* None.
*/
-static void LISTVIEW_UpdateHeaderSize(LISTVIEW_INFO *infoPtr, INT nNewScrollPos)
+static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScrollPos)
{
RECT winRect;
POINT point[2];
* RETURN:
* None
*/
-static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr)
+static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
SCROLLINFO horzInfo, vertInfo;
* RETURN:
* None
*/
-static void LISTVIEW_ShowFocusRect(LISTVIEW_INFO *infoPtr, BOOL fShow)
+static void LISTVIEW_ShowFocusRect(const LISTVIEW_INFO *infoPtr, BOOL fShow)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
HDC hdc;
/***
* Invalidates all visible selected items.
*/
-static void LISTVIEW_InvalidateSelectedItems(LISTVIEW_INFO *infoPtr)
+static void LISTVIEW_InvalidateSelectedItems(const LISTVIEW_INFO *infoPtr)
{
ITERATOR i;
* RETURN:
* None.
*/
-static void LISTVIEW_GetItemOrigin(LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lpptPosition)
+static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lpptPosition)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
* RETURN:
* None.
*/
-static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
+static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
LPRECT lprcBox, LPRECT lprcSelectBox,
LPRECT lprcIcon, LPRECT lprcStateIcon, LPRECT lprcLabel)
{
(!lpColumnInfo || lpLVItem->iSubItem == 0 || (lpColumnInfo->fmt & LVCFMT_IMAGE) ||
((infoPtr->dwLvExStyle & LVS_EX_SUBITEMIMAGES) && lpLVItem->iImage != I_IMAGECALLBACK)))
Icon.right += infoPtr->iconSize.cx;
- Icon.bottom = Icon.top + infoPtr->nItemHeight;
+ Icon.bottom = Icon.top + infoPtr->iconSize.cy;
}
if(lprcIcon) *lprcIcon = Icon;
TRACE(" - icon=%s\n", wine_dbgstr_rect(&Icon));
* RETURN:
* None.
*/
-static void LISTVIEW_GetItemBox(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprcBox)
+static void LISTVIEW_GetItemBox(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprcBox)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
* Success: TRUE
* Failure: FALSE
*/
-static BOOL LISTVIEW_MoveIconTo(LISTVIEW_INFO *infoPtr, INT nItem, const POINT *lppt, BOOL isNew)
+static BOOL LISTVIEW_MoveIconTo(const LISTVIEW_INFO *infoPtr, INT nItem, const POINT *lppt, BOOL isNew)
{
POINT old;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static void LISTVIEW_GetAreaRect(LISTVIEW_INFO *infoPtr, LPRECT lprcView)
+static void LISTVIEW_GetAreaRect(const LISTVIEW_INFO *infoPtr, LPRECT lprcView)
{
INT i, x, y;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_GetViewRect(LISTVIEW_INFO *infoPtr, LPRECT lprcView)
+static BOOL LISTVIEW_GetViewRect(const LISTVIEW_INFO *infoPtr, LPRECT lprcView)
{
POINT ptOrigin;
* RETURN:
* The desired item width.
*/
-static INT LISTVIEW_CalculateItemWidth(LISTVIEW_INFO *infoPtr)
+static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT nItemWidth = 0;
* RETURN:
* The desired item height.
*/
-static INT LISTVIEW_CalculateItemHeight(LISTVIEW_INFO *infoPtr)
+static INT LISTVIEW_CalculateItemHeight(const LISTVIEW_INFO *infoPtr)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT nItemHeight;
* RETURN:
* Number of items selected.
*/
-static INT LISTVIEW_GetSelectedCount(LISTVIEW_INFO *infoPtr)
+static INT LISTVIEW_GetSelectedCount(const LISTVIEW_INFO *infoPtr)
{
INT nSelectedCount = 0;
}
/* Helper function for LISTVIEW_ShiftIndices *only* */
-static INT shift_item(LISTVIEW_INFO *infoPtr, INT nShiftItem, INT nItem, INT direction)
+static INT shift_item(const LISTVIEW_INFO *infoPtr, INT nShiftItem, INT nItem, INT direction)
{
if (nShiftItem < nItem) return nShiftItem;
return bResult;
}
-static BOOL LISTVIEW_GetItemAtPt(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, POINT pt)
+static BOOL LISTVIEW_GetItemAtPt(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, POINT pt)
{
LVHITTESTINFO lvHitTestInfo;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isW, BOOL *bChanged)
+static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isW, BOOL *bChanged)
{
HDPA hdpaSubItems;
SUBITEM_INFO *lpSubItem;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL isW)
+static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL isW)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
HWND hwndSelf = infoPtr->hwndSelf;
if ((lpLVItem->mask & LVIF_TEXT) && is_textW(lpLVItem->pszText))
{
pszText = lpLVItem->pszText;
- ((LVITEMW *)lpLVItem)->pszText = textdupTtoW(lpLVItem->pszText, isW);
+ lpLVItem->pszText = textdupTtoW(lpLVItem->pszText, isW);
}
/* actually set the fields */
if (pszText)
{
textfreeT(lpLVItem->pszText, isW);
- ((LVITEMW *)lpLVItem)->pszText = pszText;
+ lpLVItem->pszText = pszText;
}
return bResult;
* RETURN:
* item index
*/
-static INT LISTVIEW_GetTopIndex(LISTVIEW_INFO *infoPtr)
+static INT LISTVIEW_GetTopIndex(const LISTVIEW_INFO *infoPtr)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT nItem = 0;
* Success: TRUE
* Failure: FALSE
*/
-static inline BOOL LISTVIEW_FillBkgnd(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *lprcBox)
+static inline BOOL LISTVIEW_FillBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *lprcBox)
{
if (!infoPtr->hBkBrush) return FALSE;
{
UINT uFormat, uView = infoPtr->dwStyle & LVS_TYPEMASK;
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
- static const WCHAR szCallback[] = { '(', 'c', 'a', 'l', 'l', 'b', 'a', 'c', 'k', ')', 0 };
+ static WCHAR szCallback[] = { '(', 'c', 'a', 'l', 'l', 'b', 'a', 'c', 'k', ')', 0 };
DWORD cdsubitemmode = CDRF_DODEFAULT;
- RECT *lprcFocus, rcSelect, rcBox, rcIcon, rcLabel, rcStateIcon;
+ LPRECT lprcFocus;
+ RECT rcSelect, rcBox, rcIcon, rcLabel, rcStateIcon;
NMLVCUSTOMDRAW nmlvcd;
HIMAGELIST himl;
LVITEMW lvItem;
if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE;
if (nSubItem > 0 && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
lvItem.state = LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED);
- if (lvItem.pszText == LPSTR_TEXTCALLBACKW) lvItem.pszText = (LPWSTR)szCallback;
+ if (lvItem.pszText == LPSTR_TEXTCALLBACKW) lvItem.pszText = szCallback;
TRACE(" lvItem=%s\n", debuglvitem_t(&lvItem, TRUE));
/* now check if we need to update the focus rectangle */
* RETURN:
* None
*/
-static void LISTVIEW_RefreshOwnerDraw(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, DWORD cdmode)
+static void LISTVIEW_RefreshOwnerDraw(const LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, DWORD cdmode)
{
UINT uID = (UINT)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
DWORD cditemmode = CDRF_DODEFAULT;
* RETURN:
* NoneX
*/
-static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, RECT *prcErase)
+static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcErase)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
COLORREF oldTextColor = 0, oldBkColor = 0, oldClrTextBk, oldClrText;
* RETURN:
* Returns a DWORD. The width in the low word and the height in high word.
*/
-static DWORD LISTVIEW_ApproximateViewRect(LISTVIEW_INFO *infoPtr, INT nItemCount,
+static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nItemCount,
WORD wWidth, WORD wHeight)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
* SUCCESS : index of item
* FAILURE : -1
*/
-static INT LISTVIEW_FindItemW(LISTVIEW_INFO *infoPtr, INT nStart,
+static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
const LVFINDINFOW *lpFindInfo)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
* SUCCESS : index of item
* FAILURE : -1
*/
-static INT LISTVIEW_FindItemA(LISTVIEW_INFO *infoPtr, INT nStart,
+static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart,
const LVFINDINFOA *lpFindInfo)
{
BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL);
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-/* static BOOL LISTVIEW_GetBkImage(LISTVIEW_INFO *infoPtr, LPLVBKIMAGE lpBkImage) */
+/* static BOOL LISTVIEW_GetBkImage(const LISTVIEW_INFO *infoPtr, LPLVBKIMAGE lpBkImage) */
/* { */
/* FIXME (listview, "empty stub!\n"); */
/* return FALSE; */
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_GetColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, LPLVCOLUMNW lpColumn, BOOL isW)
+static BOOL LISTVIEW_GetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn, LPLVCOLUMNW lpColumn, BOOL isW)
{
COLUMN_INFO *lpColumnInfo;
HDITEMW hdi;
}
-static BOOL LISTVIEW_GetColumnOrderArray(LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
+static BOOL LISTVIEW_GetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, LPINT lpiArray)
{
INT i;
* SUCCESS : column width
* FAILURE : zero
*/
-static INT LISTVIEW_GetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn)
+static INT LISTVIEW_GetColumnWidth(const LISTVIEW_INFO *infoPtr, INT nColumn)
{
INT nColumnWidth = 0;
RECT rcHeader;
* RETURN:
* Number of fully visible items.
*/
-static INT LISTVIEW_GetCountPerPage(LISTVIEW_INFO *infoPtr)
+static INT LISTVIEW_GetCountPerPage(const LISTVIEW_INFO *infoPtr)
{
switch (infoPtr->dwStyle & LVS_TYPEMASK)
{
* SUCCESS : image list handle
* FAILURE : NULL
*/
-static HIMAGELIST LISTVIEW_GetImageList(LISTVIEW_INFO *infoPtr, INT nImageList)
+static HIMAGELIST LISTVIEW_GetImageList(const LISTVIEW_INFO *infoPtr, INT nImageList)
{
switch (nImageList)
{
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
+static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
{
ITEMHDR callbackHdr = { LPSTR_TEXTCALLBACKW, I_IMAGECALLBACK };
NMLVDISPINFOW dispInfo;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_GetItemExtT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
+static BOOL LISTVIEW_GetItemExtT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL isW)
{
LPWSTR pszText;
BOOL bResult;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_GetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lpptPosition)
+static BOOL LISTVIEW_GetItemPosition(const LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lpptPosition)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
POINT Origin;
* is the one with the focus. Ensure that the control's record of which
* item has the focus agrees with the items' records.
*/
-static BOOL LISTVIEW_GetItemRect(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
+static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
* TRUE: success
* FALSE: failure
*/
-static BOOL LISTVIEW_GetSubItemRect(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
+static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
{
POINT Position;
LVITEMW lvItem;
* SUCCESS : string width (in pixels)
* FAILURE : zero
*/
-static INT LISTVIEW_GetLabelWidth(LISTVIEW_INFO *infoPtr, INT nItem)
+static INT LISTVIEW_GetLabelWidth(const LISTVIEW_INFO *infoPtr, INT nItem)
{
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
LVITEMW lvItem;
* RETURN:
* Horizontal + vertical spacing
*/
-static LONG LISTVIEW_GetItemSpacing(LISTVIEW_INFO *infoPtr, BOOL bSmall)
+static LONG LISTVIEW_GetItemSpacing(const LISTVIEW_INFO *infoPtr, BOOL bSmall)
{
LONG lResult;
* RETURN:
* State specified by the mask.
*/
-static UINT LISTVIEW_GetItemState(LISTVIEW_INFO *infoPtr, INT nItem, UINT uMask)
+static UINT LISTVIEW_GetItemState(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uMask)
{
LVITEMW lvItem;
* SUCCESS : string length
* FAILURE : 0
*/
-static INT LISTVIEW_GetItemTextT(LISTVIEW_INFO *infoPtr, INT nItem, LPLVITEMW lpLVItem, BOOL isW)
+static INT LISTVIEW_GetItemTextT(const LISTVIEW_INFO *infoPtr, INT nItem, LPLVITEMW lpLVItem, BOOL isW)
{
if (!lpLVItem || nItem < 0 || nItem >= infoPtr->nItemCount) return 0;
* SUCCESS : item index
* FAILURE : -1
*/
-static INT LISTVIEW_GetNextItem(LISTVIEW_INFO *infoPtr, INT nItem, UINT uFlags)
+static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uFlags)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
UINT uMask = 0;
* RETURN:
* None.
*/
-static void LISTVIEW_GetOrigin(LISTVIEW_INFO *infoPtr, LPPOINT lpptOrigin)
+static void LISTVIEW_GetOrigin(const LISTVIEW_INFO *infoPtr, LPPOINT lpptOrigin)
{
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT nHorzPos = 0, nVertPos = 0;
* SUCCESS : string width (in pixels)
* FAILURE : zero
*/
-static INT LISTVIEW_GetStringWidthT(LISTVIEW_INFO *infoPtr, LPCWSTR lpszText, BOOL isW)
+static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *infoPtr, LPCWSTR lpszText, BOOL isW)
{
SIZE stringSize;
* SUCCESS : item index
* FAILURE : -1
*/
-static INT LISTVIEW_HitTest(LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, BOOL subitem, BOOL select)
+static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, BOOL subitem, BOOL select)
{
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
INT cmpv = textcmpWT(lv_first->hdr.pszText, lv_second->hdr.pszText, TRUE);
/* if we're sorting descending, negate the return value */
- return (((LISTVIEW_INFO *)lParam)->dwStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv;
+ return (((const LISTVIEW_INFO *)lParam)->dwStyle & LVS_SORTDESCENDING) ? -cmpv : cmpv;
}
/***
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_RedrawItems(LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast)
+static BOOL LISTVIEW_RedrawItems(const LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast)
{
INT i;
/* LISTVIEW_SetBkImage */
/*** Helper for {Insert,Set}ColumnT *only* */
-static void column_fill_hditem(LISTVIEW_INFO *infoPtr, HDITEMW *lphdi, INT nColumn, const LVCOLUMNW *lpColumn, BOOL isW)
+static void column_fill_hditem(const LISTVIEW_INFO *infoPtr, HDITEMW *lphdi, INT nColumn,
+ const LVCOLUMNW *lpColumn, BOOL isW)
{
if (lpColumn->mask & LVCF_FMT)
{
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_SetColumnT(LISTVIEW_INFO *infoPtr, INT nColumn,
+static BOOL LISTVIEW_SetColumnT(const LISTVIEW_INFO *infoPtr, INT nColumn,
const LVCOLUMNW *lpColumn, BOOL isW)
{
HDITEMW hdi, hdiget;
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_SetColumnOrderArray(LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
+static BOOL LISTVIEW_SetColumnOrderArray(const LISTVIEW_INFO *infoPtr, INT iCount, const INT *lpiArray)
{
FIXME("iCount %d lpiArray %p\n", iCount, lpiArray);
* Creates the checkbox imagelist. Helper for LISTVIEW_SetExtendedListViewStyle
*
*/
-static HIMAGELIST LISTVIEW_CreateCheckBoxIL(LISTVIEW_INFO *infoPtr)
+static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr)
{
HDC hdc_wnd, hdc;
HBITMAP hbm_im, hbm_mask, hbm_orig;
* SUCCESS : 0
* FAILURE : something else
*/
-static LRESULT LISTVIEW_ThemeChanged(LISTVIEW_INFO *infoPtr)
+static LRESULT LISTVIEW_ThemeChanged(const LISTVIEW_INFO *infoPtr)
{
HTHEME theme = GetWindowTheme(infoPtr->hwndSelf);
CloseThemeData(theme);
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_DrawTrackLine(LISTVIEW_INFO *infoPtr)
+static BOOL LISTVIEW_DrawTrackLine(const LISTVIEW_INFO *infoPtr)
{
HPEN hOldPen;
HDC hdc;
* Success: 0
* Failure: -1
*/
-static LRESULT LISTVIEW_Destroy(LISTVIEW_INFO *infoPtr)
+static LRESULT LISTVIEW_Destroy(const LISTVIEW_INFO *infoPtr)
{
HTHEME theme = GetWindowTheme(infoPtr->hwndSelf);
CloseThemeData(theme);
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static BOOL LISTVIEW_Enable(LISTVIEW_INFO *infoPtr, BOOL bEnable)
+static BOOL LISTVIEW_Enable(const LISTVIEW_INFO *infoPtr, BOOL bEnable)
{
if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED)
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
* SUCCESS : TRUE
* FAILURE : FALSE
*/
-static inline BOOL LISTVIEW_EraseBkgnd(LISTVIEW_INFO *infoPtr, HDC hdc)
+static inline BOOL LISTVIEW_EraseBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc)
{
RECT rc;
* TRUE - frame was painted
* FALSE - call default window proc
*/
-static BOOL LISTVIEW_NCPaint(LISTVIEW_INFO *infoPtr, HRGN region)
+static BOOL LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
{
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
HDC dc;
* RETURN:
* Zero
*/
-static LRESULT LISTVIEW_RButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
+static LRESULT LISTVIEW_RButtonDblClk(const LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT y)
{
LVHITTESTINFO lvHitTestInfo;
* TRUE if cursor is set
* FALSE otherwise
*/
-static BOOL LISTVIEW_SetCursor(LISTVIEW_INFO *infoPtr, HWND hwnd, UINT nHittest, UINT wMouseMsg)
+static BOOL LISTVIEW_SetCursor(const LISTVIEW_INFO *infoPtr, HWND hwnd, UINT nHittest, UINT wMouseMsg)
{
LVHITTESTINFO lvHitTestInfo;
* RETURN:
* Zero.
*/
-static LRESULT LISTVIEW_Command(LISTVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+static LRESULT LISTVIEW_Command(const LISTVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
switch (HIWORD(wParam))
{
/* control moves when user clicks a scroll button */
int visible; /* # of months visible */
int firstDay; /* Start month calendar with firstDay's day */
+ int firstDayHighWord; /* High word only used externally */
int monthRange;
MONTHDAYSTATE *monthdayState;
SYSTEMTIME todaysDate;
/* From a given point, calculate the row (weekpos), column(daypos)
and day in the calendar. day== 0 mean the last day of tha last month
*/
-static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y,
+static int MONTHCAL_CalcDayFromPos(const MONTHCAL_INFO *infoPtr, int x, int y,
int *daypos,int *weekpos)
{
int retval, firstDay;
/* day is the day of the month, 1 == 1st day of the month */
/* sets x and y to be the position of the day */
/* x == day, y == week where(0,0) == firstDay, 1st week */
-static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month,
+static void MONTHCAL_CalcDayXY(const MONTHCAL_INFO *infoPtr, int day, int month,
int *x, int *y)
{
int firstDay, prevMonth;
/* x: column(day), y: row(week) */
-static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
+static void MONTHCAL_CalcDayRect(const MONTHCAL_INFO *infoPtr, RECT *r, int x, int y)
{
r->left = infoPtr->days.left + x * infoPtr->width_increment;
r->right = r->left + infoPtr->width_increment;
/* sets the RECT struct r to the rectangle around the day and month */
/* day is the day value of the month(1 == 1st), month is the month */
/* value(january == 1, december == 12) */
-static inline void MONTHCAL_CalcPosFromDay(MONTHCAL_INFO *infoPtr,
+static inline void MONTHCAL_CalcPosFromDay(const MONTHCAL_INFO *infoPtr,
int day, int month, RECT *r)
{
int x, y;
/* day is the day in the month(1 == 1st of the month) */
/* month is the month value(1 == january, 12 == december) */
-static void MONTHCAL_CircleDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month)
+static void MONTHCAL_CircleDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month)
{
HPEN hRedPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
HPEN hOldPen2 = SelectObject(hdc, hRedPen);
}
-static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month,
+static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month,
int x, int y, int bold)
{
static const WCHAR fmtW[] = { '%','d',0 };
}
-static void paint_button (MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext,
+static void paint_button (const MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext,
BOOL pressed, RECT* r)
{
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
}
-static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
+static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps)
{
static const WCHAR todayW[] = { 'T','o','d','a','y',':',0 };
static const WCHAR fmt1W[] = { '%','s',' ','%','l','d',0 };
static LRESULT
-MONTHCAL_GetMinReqRect(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
LPRECT lpRect = (LPRECT) lParam;
static LRESULT
-MONTHCAL_GetColor(MONTHCAL_INFO *infoPtr, WPARAM wParam)
+MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, WPARAM wParam)
{
TRACE("\n");
static LRESULT
-MONTHCAL_GetMonthDelta(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMonthDelta(const MONTHCAL_INFO *infoPtr)
{
TRACE("\n");
static LRESULT
-MONTHCAL_GetFirstDayOfWeek(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetFirstDayOfWeek(const MONTHCAL_INFO *infoPtr)
{
- return infoPtr->firstDay;
+ return MAKELONG(infoPtr->firstDay, infoPtr->firstDayHighWord);
}
static LRESULT
MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
- int prev = infoPtr->firstDay;
+ int prev = MAKELONG(infoPtr->firstDay, infoPtr->firstDayHighWord);
+ int localFirstDay;
WCHAR buf[40];
TRACE("day %ld\n", lParam);
- if((lParam >= 0) && (lParam < 7)) {
- infoPtr->firstDay = (int)lParam;
+ GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, countof(buf));
+ TRACE("%s %d\n", debugstr_w(buf), strlenW(buf));
+
+ localFirstDay = atoiW(buf);
+
+ if(lParam == -1)
+ {
+ infoPtr->firstDay = localFirstDay;
+ infoPtr->firstDayHighWord = FALSE;
+ }
+ else if(lParam >= 7)
+ {
+ infoPtr->firstDay = localFirstDay;
+ infoPtr->firstDayHighWord = TRUE;
}
else
- {
- GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, countof(buf));
- TRACE("%s %d\n", debugstr_w(buf), strlenW(buf));
- infoPtr->firstDay = (atoiW(buf)+1)%7;
- }
+ {
+ infoPtr->firstDay = lParam;
+ infoPtr->firstDayHighWord = TRUE;
+ }
+
return prev;
}
static LRESULT
-MONTHCAL_GetMonthRange(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMonthRange(const MONTHCAL_INFO *infoPtr)
{
TRACE("\n");
static LRESULT
-MONTHCAL_GetMaxTodayWidth(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMaxTodayWidth(const MONTHCAL_INFO *infoPtr)
{
return(infoPtr->todayrect.right - infoPtr->todayrect.left);
}
static LRESULT
-MONTHCAL_SetDayState(MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
int i, iMonths = (int)wParam;
}
static LRESULT
-MONTHCAL_GetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
SYSTEMTIME *lpSel = (SYSTEMTIME *) lParam;
static LRESULT
-MONTHCAL_GetMaxSelCount(MONTHCAL_INFO *infoPtr)
+MONTHCAL_GetMaxSelCount(const MONTHCAL_INFO *infoPtr)
{
return infoPtr->maxSelCount;
}
static LRESULT
-MONTHCAL_GetSelRange(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetSelRange(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
SYSTEMTIME *lprgSysTimeArray = (SYSTEMTIME *) lParam;
static LRESULT
-MONTHCAL_GetToday(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_GetToday(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
SYSTEMTIME *lpToday = (SYSTEMTIME *) lParam;
static LRESULT
-MONTHCAL_HitTest(MONTHCAL_INFO *infoPtr, LPARAM lParam)
+MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, LPARAM lParam)
{
PMCHITTESTINFO lpht = (PMCHITTESTINFO)lParam;
UINT x,y;
static LRESULT
-MONTHCAL_KillFocus(MONTHCAL_INFO *infoPtr)
+MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr)
{
TRACE("\n");
static LRESULT
-MONTHCAL_SetFocus(MONTHCAL_INFO *infoPtr)
+MONTHCAL_SetFocus(const MONTHCAL_INFO *infoPtr)
{
TRACE("\n");
return 0;
}
-static LRESULT MONTHCAL_GetFont(MONTHCAL_INFO *infoPtr)
+static LRESULT MONTHCAL_GetFont(const MONTHCAL_INFO *infoPtr)
{
return (LRESULT)infoPtr->hFont;
}
}
/* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (MONTHCAL_INFO* infoPtr)
+static LRESULT theme_changed (const MONTHCAL_INFO* infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
CloseThemeData (theme);
/* FIXME: calculate systemtime ->> localtime(substract timezoneinfo) */
GetLocalTime(&infoPtr->todaysDate);
+ infoPtr->firstDayHighWord = FALSE;
MONTHCAL_SetFirstDayOfWeek(infoPtr, (LPARAM)-1);
infoPtr->currentMonth = infoPtr->todaysDate.wMonth;
infoPtr->currentYear = infoPtr->todaysDate.wYear;
#define REPEAT_DELAY 50
static void
-PAGER_GetButtonRects(PAGER_INFO* infoPtr, RECT* prcTopLeft, RECT* prcBottomRight, BOOL bClientCoords)
+PAGER_GetButtonRects(const PAGER_INFO* infoPtr, RECT* prcTopLeft, RECT* prcBottomRight, BOOL bClientCoords)
{
RECT rcWindow;
GetWindowRect (infoPtr->hwndSelf, &rcWindow);
}
static inline LRESULT
-PAGER_GetButtonState (PAGER_INFO* infoPtr, INT btn)
+PAGER_GetButtonState (const PAGER_INFO* infoPtr, INT btn)
{
LRESULT btnState = PGF_INVISIBLE;
TRACE("[%p]\n", infoPtr->hwndSelf);
static inline INT
-PAGER_GetPos(PAGER_INFO *infoPtr)
+PAGER_GetPos(const PAGER_INFO *infoPtr)
{
TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nPos);
return infoPtr->nPos;
}
static inline INT
-PAGER_GetButtonSize(PAGER_INFO *infoPtr)
+PAGER_GetButtonSize(const PAGER_INFO *infoPtr)
{
TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nButtonSize);
return infoPtr->nButtonSize;
}
static inline INT
-PAGER_GetBorder(PAGER_INFO *infoPtr)
+PAGER_GetBorder(const PAGER_INFO *infoPtr)
{
TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nBorder);
return infoPtr->nBorder;
}
static inline COLORREF
-PAGER_GetBkColor(PAGER_INFO *infoPtr)
+PAGER_GetBkColor(const PAGER_INFO *infoPtr)
{
TRACE("[%p] returns %06x\n", infoPtr->hwndSelf, infoPtr->clrBk);
return infoPtr->clrBk;
}
static void
-PAGER_CalcSize (PAGER_INFO *infoPtr, INT* size, BOOL getWidth)
+PAGER_CalcSize (const PAGER_INFO *infoPtr, INT* size, BOOL getWidth)
{
NMPGCALCSIZE nmpgcs;
ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
}
static LRESULT
-PAGER_FmtLines(PAGER_INFO *infoPtr)
+PAGER_FmtLines(const PAGER_INFO *infoPtr)
{
/* initiate NCCalcSize to resize client wnd and get size */
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
}
static LRESULT
-PAGER_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
+PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
PAGER_INFO *infoPtr;
}
static LRESULT
-PAGER_NCPaint (PAGER_INFO* infoPtr, HRGN hRgn)
+PAGER_NCPaint (const PAGER_INFO* infoPtr, HRGN hRgn)
{
RECT rcBottomRight, rcTopLeft;
HDC hdc;
}
static INT
-PAGER_HitTest (PAGER_INFO* infoPtr, const POINT * pt)
+PAGER_HitTest (const PAGER_INFO* infoPtr, const POINT * pt)
{
RECT clientRect, rcTopLeft, rcBottomRight;
POINT ptWindow;
}
static LRESULT
-PAGER_NCHitTest (PAGER_INFO* infoPtr, INT x, INT y)
+PAGER_NCHitTest (const PAGER_INFO* infoPtr, INT x, INT y)
{
POINT pt;
INT nHit;
}
static LRESULT
-PAGER_EraseBackground (PAGER_INFO* infoPtr, HDC hdc)
+PAGER_EraseBackground (const PAGER_INFO* infoPtr, HDC hdc)
{
POINT pt, ptorig;
HWND parent;
static LRESULT
-PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT lpss)
+PAGER_StyleChanged(PAGER_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{
DWORD oldStyle = infoPtr->dwStyle;
#define ID_MARQUEE_TIMER 1
/* Helper to obtain size of a progress bar chunk ("led"). */
-static inline int get_led_size ( PROGRESS_INFO *infoPtr, LONG style,
+static inline int get_led_size ( const PROGRESS_INFO *infoPtr, LONG style,
const RECT* rect )
{
HTHEME theme = GetWindowTheme (infoPtr->Self);
}
/* Helper to obtain gap between progress bar chunks */
-static inline int get_led_gap ( PROGRESS_INFO *infoPtr )
+static inline int get_led_gap ( const PROGRESS_INFO *infoPtr )
{
HTHEME theme = GetWindowTheme (infoPtr->Self);
if (theme)
}
/* Compute the pixel position of a progress value */
-static inline int get_bar_position( PROGRESS_INFO *infoPtr, LONG style,
+static inline int get_bar_position( const PROGRESS_INFO *infoPtr, LONG style,
const RECT* rect, INT value )
{
return MulDiv (value - infoPtr->MinVal, get_bar_size (style, rect),
* Don't be too clever about invalidating the progress bar.
* InstallShield depends on this simple behaviour.
*/
-static void PROGRESS_Invalidate( PROGRESS_INFO *infoPtr, INT old, INT new )
+static void PROGRESS_Invalidate( const PROGRESS_INFO *infoPtr, INT old, INT new )
{
InvalidateRect( infoPtr->Self, NULL, old > new );
}
int index,
int skipdir,
HPROPSHEETPAGE hpage);
-static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, PropSheetInfo* psInfo);
+static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo);
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo* psInfo);
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID);
*
* Find page index corresponding to page resource id.
*/
-static INT PROPSHEET_FindPageByResId(PropSheetInfo * psInfo, LRESULT resId)
+static INT PROPSHEET_FindPageByResId(const PropSheetInfo * psInfo, LRESULT resId)
{
INT i;
* Verify that the tab control and the "largest" property sheet page dlg. template
* match in size.
*/
-static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, PropSheetInfo* psInfo)
+static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, const PropSheetInfo* psInfo)
{
HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
RECT rcOrigTab, rcPage;
*
* Resizes the property sheet to fit the largest page.
*/
-static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo)
+static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, const PropSheetInfo* psInfo)
{
HWND hwndLine = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
RECT rc, lineRect, dialogRect;
*
* Adjusts the buttons' positions.
*/
-static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo)
+static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, const PropSheetInfo* psInfo)
{
HWND hwndButton = GetDlgItem(hwndParent, IDOK);
RECT rcSheet;
* Adjusts the buttons' positions.
*/
static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
- PropSheetInfo* psInfo)
+ const PropSheetInfo* psInfo)
{
HWND hwndButton = GetDlgItem(hwndParent, IDCANCEL);
HWND hwndLine = GetDlgItem(hwndParent, IDC_SUNKEN_LINE);
* Insert the tabs in the tab control.
*/
static BOOL PROPSHEET_CreateTabControl(HWND hwndParent,
- PropSheetInfo * psInfo)
+ const PropSheetInfo * psInfo)
{
HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
TCITEMW item;
return FALSE;
}
+ /* unset active page while doing this transition. */
+ if (psInfo->active_page != -1)
+ ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
+ psInfo->active_page = -1;
+
while (1) {
int result;
PSHNOTIFY psn;
* Given a HPROPSHEETPAGE, returns the index of the corresponding page from
* the array of PropPageInfo.
*/
-static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, PropSheetInfo* psInfo)
+static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo)
{
BOOL found = FALSE;
int index = 0;
GlobalFree((HGLOBAL)psInfo);
}
-static INT do_loop(PropSheetInfo *psInfo)
+static INT do_loop(const PropSheetInfo *psInfo)
{
MSG msg;
INT ret = -1;
WCHAR szBuffer[256];
int nLength;
+ if (psInfo->active_page < 0) return 1;
hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps);
if (!hdc) return 1;
static VOID
-REBAR_DumpBandInfo(LPREBARBANDINFOW pB)
+REBAR_DumpBandInfo(const REBARBANDINFOW *pB)
{
if( !TRACE_ON(rebar) ) return;
TRACE("band info: ");
}
static VOID
-REBAR_DumpBand (REBAR_INFO *iP)
+REBAR_DumpBand (const REBAR_INFO *iP)
{
REBAR_BAND *pB;
UINT i;
}
/* dest can be equal to src */
-static void translate_rect(REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
+static void translate_rect(const REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
{
if (infoPtr->dwStyle & CCS_VERT) {
int tmp;
}
}
-static int get_rect_cx(REBAR_INFO *infoPtr, RECT *lpRect)
+static int get_rect_cx(const REBAR_INFO *infoPtr, const RECT *lpRect)
{
if (infoPtr->dwStyle & CCS_VERT)
return lpRect->bottom - lpRect->top;
return lpRect->right - lpRect->left;
}
-static int get_rect_cy(REBAR_INFO *infoPtr, RECT *lpRect)
+static int get_rect_cy(const REBAR_INFO *infoPtr, const RECT *lpRect)
{
if (infoPtr->dwStyle & CCS_VERT)
return lpRect->right - lpRect->left;
}
static HWND
-REBAR_GetNotifyParent (REBAR_INFO *infoPtr)
+REBAR_GetNotifyParent (const REBAR_INFO *infoPtr)
{
HWND parent, owner;
static INT
-REBAR_Notify (NMHDR *nmhdr, REBAR_INFO *infoPtr, UINT code)
+REBAR_Notify (NMHDR *nmhdr, const REBAR_INFO *infoPtr, UINT code)
{
HWND parent;
}
static INT
-REBAR_Notify_NMREBAR (REBAR_INFO *infoPtr, UINT uBand, UINT code)
+REBAR_Notify_NMREBAR (const REBAR_INFO *infoPtr, UINT uBand, UINT code)
{
NMREBAR notify_rebar;
REBAR_BAND *lpBand;
}
static VOID
-REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
+REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
{
HFONT hOldFont = 0;
INT oldBkMode = 0;
static VOID
-REBAR_Refresh (REBAR_INFO *infoPtr, HDC hdc)
+REBAR_Refresh (const REBAR_INFO *infoPtr, HDC hdc)
{
REBAR_BAND *lpBand;
UINT i;
static void
-REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend)
+REBAR_CalcHorzBand (const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
/* Function: this routine initializes all the rectangles in */
/* each band in a row to fit in the adjusted rcBand rect. */
/* *** Supports only Horizontal bars. *** */
static VOID
-REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend)
+REBAR_CalcVertBand (const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
/* Function: this routine initializes all the rectangles in */
/* each band in a row to fit in the adjusted rcBand rect. */
/* *** Supports only Vertical bars. *** */
static VOID
-REBAR_MoveChildWindows (REBAR_INFO *infoPtr, UINT start, UINT endplus)
+REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
{
static const WCHAR strComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
REBAR_BAND *lpBand;
}
-static int next_band(REBAR_INFO *infoPtr, int i)
+static int next_band(const REBAR_INFO *infoPtr, int i)
{
int n;
for (n = i + 1; n < infoPtr->uNumBands; n++)
return n;
}
-static int prev_band(REBAR_INFO *infoPtr, int i)
+static int prev_band(const REBAR_INFO *infoPtr, int i)
{
int n;
for (n = i - 1; n >= 0; n--)
return n;
}
-static int get_row_begin_for_band(REBAR_INFO *infoPtr, INT iBand)
+static int get_row_begin_for_band(const REBAR_INFO *infoPtr, INT iBand)
{
int iLastBand = iBand;
int iRow = infoPtr->bands[iBand].iRow;
return iLastBand;
}
-static int get_row_end_for_band(REBAR_INFO *infoPtr, INT iBand)
+static int get_row_end_for_band(const REBAR_INFO *infoPtr, INT iBand)
{
int iRow = infoPtr->bands[iBand].iRow;
while ((iBand = next_band(infoPtr, iBand)) < infoPtr->uNumBands)
return iBand;
}
-static void REBAR_SetRowRectsX(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
+static void REBAR_SetRowRectsX(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
{
int xPos = 0, i;
for (i = iBeginBand; i < iEndBand; i = next_band(infoPtr, i))
* For some reason "big enough" is defined as bigger than the minimum size of the
* first band in the row
*/
-static REBAR_BAND *REBAR_FindBandToGrow(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
+static REBAR_BAND *REBAR_FindBandToGrow(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
{
INT iLcx = 0, i;
return &infoPtr->bands[i];
}
-static int REBAR_ShrinkBandsRTL(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
+static int REBAR_ShrinkBandsRTL(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
{
REBAR_BAND *lpBand;
INT width, i;
}
-static int REBAR_ShrinkBandsLTR(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
+static int REBAR_ShrinkBandsLTR(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
{
REBAR_BAND *lpBand;
INT width, i;
return cxShrink;
}
-static int REBAR_SetBandsHeight(REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
+static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
{
REBAR_BAND *lpBand;
int yMaxHeight = 0;
return yPos + yMaxHeight;
}
-static void REBAR_LayoutRow(REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int cx, int *piRow, int *pyPos)
+static void REBAR_LayoutRow(const REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int cx, int *piRow, int *pyPos)
{
REBAR_BAND *lpBand;
int i, extra;
}
static VOID
-REBAR_Layout(REBAR_INFO *infoPtr, LPRECT lpRect)
+REBAR_Layout(REBAR_INFO *infoPtr, const RECT *lpRect)
{
REBAR_BAND *lpBand;
RECT rcAdj;
static VOID
-REBAR_ValidateBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
+REBAR_ValidateBand (const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
/* Function: This routine evaluates the band specs supplied */
/* by the user and updates the following 5 fields in */
/* the internal band structure: cxHeader, lcx, lcy, hcx, hcy*/
}
static BOOL
-REBAR_CommonSetupBand(HWND hwnd, LPREBARBANDINFOW lprbbi, REBAR_BAND *lpBand)
+REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
/* Function: This routine copies the supplied values from */
/* user input (lprbbi) to the internal band structure. */
/* It returns true if something changed and false if not. */
}
static LRESULT
-REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, RECT *clip)
+REBAR_InternalEraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, const RECT *clip)
/* Function: This erases the background rectangle by drawing */
/* each band with its background color (or the default) and */
/* draws each bands right separator if necessary. The row */
}
static void
-REBAR_InternalHitTest (REBAR_INFO *infoPtr, const POINT *lpPt, UINT *pFlags, INT *pBand)
+REBAR_InternalHitTest (const REBAR_INFO *infoPtr, const POINT *lpPt, UINT *pFlags, INT *pBand)
{
REBAR_BAND *lpBand;
RECT rect;
static LRESULT
-REBAR_GetBandBorders (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetBandBorders (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPRECT lpRect = (LPRECT)lParam;
REBAR_BAND *lpBand;
}
-inline static LRESULT
-REBAR_GetBandCount (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetBandCount (const REBAR_INFO *infoPtr)
{
TRACE("band count %u!\n", infoPtr->uNumBands);
static LRESULT
-REBAR_GetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
+REBAR_GetBandInfoT(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
{
LPREBARBANDINFOW lprbbi = (LPREBARBANDINFOW)lParam;
REBAR_BAND *lpBand;
static LRESULT
-REBAR_GetBarHeight (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetBarHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
INT nHeight;
static LRESULT
-REBAR_GetBarInfo (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetBarInfo (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPREBARINFO lpInfo = (LPREBARINFO)lParam;
}
-inline static LRESULT
-REBAR_GetBkColor (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetBkColor (const REBAR_INFO *infoPtr)
{
COLORREF clr = infoPtr->clrBk;
static LRESULT
-REBAR_GetPalette (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetPalette (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
FIXME("empty stub!\n");
static LRESULT
-REBAR_GetRect (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetRect (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
INT iBand = (INT)wParam;
LPRECT lprc = (LPRECT)lParam;
}
-inline static LRESULT
-REBAR_GetRowCount (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetRowCount (const REBAR_INFO *infoPtr)
{
TRACE("%u\n", infoPtr->uNumRows);
static LRESULT
-REBAR_GetRowHeight (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetRowHeight (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
INT iRow = (INT)wParam;
int j = 0, ret = 0;
}
-inline static LRESULT
-REBAR_GetTextColor (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetTextColor (const REBAR_INFO *infoPtr)
{
TRACE("text color 0x%06x!\n", infoPtr->clrText);
}
-inline static LRESULT
-REBAR_GetToolTips (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetToolTips (const REBAR_INFO *infoPtr)
{
return (LRESULT)infoPtr->hwndToolTip;
}
-inline static LRESULT
-REBAR_GetUnicodeFormat (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetUnicodeFormat (const REBAR_INFO *infoPtr)
{
TRACE("%s hwnd=%p\n",
infoPtr->bUnicode ? "TRUE" : "FALSE", infoPtr->hwndSelf);
}
-inline static LRESULT
-REBAR_GetVersion (REBAR_INFO *infoPtr)
+static inline LRESULT
+REBAR_GetVersion (const REBAR_INFO *infoPtr)
{
TRACE("version %d\n", infoPtr->iVersion);
return infoPtr->iVersion;
static LRESULT
-REBAR_HitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_HitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam;
static LRESULT
-REBAR_IdToIndex (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_IdToIndex (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
UINT i;
static LRESULT
-REBAR_MaximizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_MaximizeBand (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
REBAR_BAND *lpBand;
UINT uBand = (UINT) wParam;
static LRESULT
-REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_MinimizeBand (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
REBAR_BAND *lpBand;
UINT uBand = (UINT) wParam;
/* << REBAR_SetTooltips >> */
-inline static LRESULT
+static inline LRESULT
REBAR_SetUnicodeFormat (REBAR_INFO *infoPtr, WPARAM wParam)
{
BOOL bTemp = infoPtr->bUnicode;
static LRESULT
-REBAR_EraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
RECT cliprect;
static LRESULT
-REBAR_GetFont (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_GetFont (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
return (LRESULT)infoPtr->hFont;
}
static LRESULT
-REBAR_PushChevron(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_PushChevron(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
if (wParam >= 0 && (UINT)wParam < infoPtr->uNumBands)
{
}
-inline static LRESULT
-REBAR_NCCalcSize (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+static inline LRESULT
+REBAR_NCCalcSize (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HTHEME theme;
RECT *rect = (RECT *)lParam;
static LRESULT
-REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_NCHitTest (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
NMMOUSE nmmouse;
POINT clpt;
static LRESULT
-REBAR_NCPaint (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_NCPaint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
RECT rcWindow;
HDC hdc;
static LRESULT
-REBAR_Paint (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_Paint (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
static LRESULT
-REBAR_SetCursor (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_SetCursor (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
POINT pt;
UINT flags;
}
-inline static LRESULT
+static inline LRESULT
REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
/*****************************************************
*
}
static LRESULT
-REBAR_WindowPosChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+REBAR_WindowPosChanged (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LRESULT ret;
RECT rc;
* Currently only scrolls ONCE. The comctl32 implementation uses GetTickCount
* and what else to do smooth scrolling.
*/
-BOOL WINAPI SmoothScrollWindow( SMOOTHSCROLLSTRUCT *smooth ) {
+BOOL WINAPI SmoothScrollWindow( const SMOOTHSCROLLSTRUCT *smooth ) {
LPRECT lpupdaterect = smooth->lpupdaterect;
HRGN hrgnupdate = smooth->hrgnupdate;
RECT tmprect;
static void
-STATUSBAR_DrawPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int itemID)
+STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
{
RECT r = part->bound;
UINT border = BDR_SUNKENOUTER;
static void
-STATUSBAR_RefreshPart (STATUS_INFO *infoPtr, HDC hdc, STATUSWINDOWPART *part, int itemID)
+STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART *part, int itemID)
{
HBRUSH hbrBk;
HFONT hOldFont;
static LRESULT
-STATUSBAR_Relay2Tip (STATUS_INFO *infoPtr, UINT uMsg,
+STATUSBAR_Relay2Tip (const STATUS_INFO *infoPtr, UINT uMsg,
WPARAM wParam, LPARAM lParam)
{
MSG msg;
static BOOL
-STATUSBAR_GetBorders (STATUS_INFO *infoPtr, INT out[])
+STATUSBAR_GetBorders (const STATUS_INFO *infoPtr, INT out[])
{
TRACE("\n");
out[0] = infoPtr->horizontalBorder;
static BOOL
-STATUSBAR_SetBorders (STATUS_INFO *infoPtr, INT in[])
+STATUSBAR_SetBorders (STATUS_INFO *infoPtr, const INT in[])
{
TRACE("\n");
infoPtr->horizontalBorder = in[0];
static HICON
-STATUSBAR_GetIcon (STATUS_INFO *infoPtr, INT nPart)
+STATUSBAR_GetIcon (const STATUS_INFO *infoPtr, INT nPart)
{
TRACE("%d\n", nPart);
/* MSDN says: "simple parts are indexed with -1" */
static INT
-STATUSBAR_GetParts (STATUS_INFO *infoPtr, INT num_parts, INT parts[])
+STATUSBAR_GetParts (const STATUS_INFO *infoPtr, INT num_parts, INT parts[])
{
INT i;
static BOOL
-STATUSBAR_GetRect (STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
+STATUSBAR_GetRect (const STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
{
TRACE("part %d\n", nPart);
if(nPart >= infoPtr->numParts || nPart < 0)
}
static LRESULT
-STATUSBAR_GetTipTextA (STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
+STATUSBAR_GetTipTextA (const STATUS_INFO *infoPtr, INT id, LPSTR tip, INT size)
{
TRACE("\n");
if (tip) {
static LRESULT
-STATUSBAR_GetTipTextW (STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
+STATUSBAR_GetTipTextW (const STATUS_INFO *infoPtr, INT id, LPWSTR tip, INT size)
{
TRACE("\n");
if (tip) {
static LRESULT
-STATUSBAR_SetTipTextA (STATUS_INFO *infoPtr, INT id, LPSTR text)
+STATUSBAR_SetTipTextA (const STATUS_INFO *infoPtr, INT id, LPSTR text)
{
TRACE("part %d: \"%s\"\n", id, text);
if (infoPtr->hwndToolTip) {
static LRESULT
-STATUSBAR_SetTipTextW (STATUS_INFO *infoPtr, INT id, LPWSTR text)
+STATUSBAR_SetTipTextW (const STATUS_INFO *infoPtr, INT id, LPWSTR text)
{
TRACE("part %d: \"%s\"\n", id, debugstr_w(text));
if (infoPtr->hwndToolTip) {
}
-inline static LRESULT
+static inline LRESULT
STATUSBAR_SetUnicodeFormat (STATUS_INFO *infoPtr, BOOL bUnicode)
{
BOOL bOld = infoPtr->bUnicode;
static LRESULT
-STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate)
+STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
{
STATUS_INFO *infoPtr;
NONCLIENTMETRICSW nclm;
/* in contrast to SB_GETTEXT*, WM_GETTEXT handles the text
* of the first part only (usual behaviour) */
static INT
-STATUSBAR_WMGetText (STATUS_INFO *infoPtr, INT size, LPWSTR buf)
+STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
{
INT len;
static BOOL
-STATUSBAR_WMNCHitTest (STATUS_INFO *infoPtr, INT x, INT y)
+STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y)
{
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
RECT rect;
static BOOL
-STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
+STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
{
STATUSWINDOWPART *part;
int len;
/* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (STATUS_INFO* infoPtr)
+static LRESULT theme_changed (const STATUS_INFO* infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->Self);
CloseThemeData (theme);
static LRESULT
-STATUSBAR_SendNotify (STATUS_INFO *infoPtr, UINT code)
+STATUSBAR_SendNotify (const STATUS_INFO *infoPtr, UINT code)
{
NMHDR nmhdr;
* The signed integer value represented by the string, or 0 if no integer is
* present.
*/
-INT WINAPI StrToIntA (LPSTR lpszStr)
+INT WINAPI StrToIntA (LPCSTR lpszStr)
{
return atoi(lpszStr);
}
*
* See StrToIntA.
*/
-INT WINAPI StrToIntW (LPWSTR lpString)
+INT WINAPI StrToIntW (LPCWSTR lpString)
{
return atoiW(lpString);
}
* SYSLINK_RepaintLink
* Repaints a link.
*/
-static VOID SYSLINK_RepaintLink (SYSLINK_INFO *infoPtr, PDOC_ITEM DocItem)
+static VOID SYSLINK_RepaintLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *DocItem)
{
PDOC_TEXTBLOCK bl;
int n;
* SYSLINK_GetLinkItemByIndex
* Retrieves a document link by its index
*/
-static PDOC_ITEM SYSLINK_GetLinkItemByIndex (SYSLINK_INFO *infoPtr, int iLink)
+static PDOC_ITEM SYSLINK_GetLinkItemByIndex (const SYSLINK_INFO *infoPtr, int iLink)
{
PDOC_ITEM Current = infoPtr->Items;
* SYSLINK_GetFocusLink
* Retrieves the link that has the LIS_FOCUSED bit
*/
-static PDOC_ITEM SYSLINK_GetFocusLink (SYSLINK_INFO *infoPtr, int *LinkId)
+static PDOC_ITEM SYSLINK_GetFocusLink (const SYSLINK_INFO *infoPtr, int *LinkId)
{
PDOC_ITEM Current = infoPtr->Items;
int id = 0;
* SYSLINK_GetNextLink
* Gets the next link
*/
-static PDOC_ITEM SYSLINK_GetNextLink (SYSLINK_INFO *infoPtr, PDOC_ITEM Current)
+static PDOC_ITEM SYSLINK_GetNextLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Current)
{
for(Current = (Current != NULL ? Current->Next : infoPtr->Items);
Current != NULL;
* SYSLINK_GetPrevLink
* Gets the previous link
*/
-static PDOC_ITEM SYSLINK_GetPrevLink (SYSLINK_INFO *infoPtr, PDOC_ITEM Current)
+static PDOC_ITEM SYSLINK_GetPrevLink (const SYSLINK_INFO *infoPtr, PDOC_ITEM Current)
{
if(Current == NULL)
{
* SYSLINK_Render
* Renders the document in memory
*/
-static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
+static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
{
RECT rc;
PDOC_ITEM Current;
* SYSLINK_Draw
* Draws the SysLink control.
*/
-static LRESULT SYSLINK_Draw (SYSLINK_INFO *infoPtr, HDC hdc)
+static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
{
RECT rc;
PDOC_ITEM Current;
* SYSLINK_Paint
* Handles the WM_PAINT message.
*/
-static LRESULT SYSLINK_Paint (SYSLINK_INFO *infoPtr, HDC hdcParam)
+static LRESULT SYSLINK_Paint (const SYSLINK_INFO *infoPtr, HDC hdcParam)
{
HDC hdc;
PAINTSTRUCT ps;
* If no document item is specified, the focus bit will be removed from all links.
* Returns the previous focused item.
*/
-static PDOC_ITEM SYSLINK_SetFocusLink (SYSLINK_INFO *infoPtr, PDOC_ITEM DocItem)
+static PDOC_ITEM SYSLINK_SetFocusLink (const SYSLINK_INFO *infoPtr, const DOC_ITEM *DocItem)
{
PDOC_ITEM Current, PrevFocus = NULL;
* SYSLINK_SetItem
* Sets the states and attributes of a link item.
*/
-static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
+static LRESULT SYSLINK_SetItem (const SYSLINK_INFO *infoPtr, const LITEM *Item)
{
PDOC_ITEM di;
int nc;
* SYSLINK_GetItem
* Retrieves the states and attributes of a link item.
*/
-static LRESULT SYSLINK_GetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
+static LRESULT SYSLINK_GetItem (const SYSLINK_INFO *infoPtr, PLITEM Item)
{
PDOC_ITEM di;
* SYSLINK_PtInDocItem
* Determines if a point is in the region of a document item
*/
-static BOOL SYSLINK_PtInDocItem (PDOC_ITEM DocItem, POINT pt)
+static BOOL SYSLINK_PtInDocItem (const DOC_ITEM *DocItem, POINT pt)
{
PDOC_TEXTBLOCK bl;
int n;
* SYSLINK_HitTest
* Determines the link the user clicked on.
*/
-static LRESULT SYSLINK_HitTest (SYSLINK_INFO *infoPtr, PLHITTESTINFO HitTest)
+static LRESULT SYSLINK_HitTest (const SYSLINK_INFO *infoPtr, PLHITTESTINFO HitTest)
{
PDOC_ITEM Current;
int id = 0;
* SYSLINK_GetIdealHeight
* Returns the preferred height of a link at the current control's width.
*/
-static LRESULT SYSLINK_GetIdealHeight (SYSLINK_INFO *infoPtr)
+static LRESULT SYSLINK_GetIdealHeight (const SYSLINK_INFO *infoPtr)
{
HDC hdc = GetDC(infoPtr->Self);
if(hdc != NULL)
* SYSLINK_SendParentNotify
* Sends a WM_NOTIFY message to the parent window.
*/
-static LRESULT SYSLINK_SendParentNotify (SYSLINK_INFO *infoPtr, UINT code, PDOC_ITEM Link, int iLink)
+static LRESULT SYSLINK_SendParentNotify (const SYSLINK_INFO *infoPtr, UINT code, const DOC_ITEM *Link, int iLink)
{
NMLINK nml;
* SYSLINK_LinkAtPt
* Returns a link at the specified position
*/
-static PDOC_ITEM SYSLINK_LinkAtPt (SYSLINK_INFO *infoPtr, POINT *pt, int *LinkId, BOOL MustBeEnabled)
+static PDOC_ITEM SYSLINK_LinkAtPt (const SYSLINK_INFO *infoPtr, const POINT *pt, int *LinkId, BOOL MustBeEnabled)
{
PDOC_ITEM Current;
int id = 0;
* SYSLINK_LButtonDown
* Handles mouse clicks
*/
-static LRESULT SYSLINK_LButtonDown (SYSLINK_INFO *infoPtr, DWORD Buttons, POINT *pt)
+static LRESULT SYSLINK_LButtonDown (SYSLINK_INFO *infoPtr, DWORD Buttons, const POINT *pt)
{
PDOC_ITEM Current, Old;
int id;
* SYSLINK_LButtonUp
* Handles mouse clicks
*/
-static LRESULT SYSLINK_LButtonUp (SYSLINK_INFO *infoPtr, DWORD Buttons, POINT *pt)
+static LRESULT SYSLINK_LButtonUp (SYSLINK_INFO *infoPtr, DWORD Buttons, const POINT *pt)
{
if(infoPtr->MouseDownID > -1)
{
* SYSLINK_OnEnter
* Handles ENTER key events
*/
-static BOOL SYSLINK_OnEnter (SYSLINK_INFO *infoPtr)
+static BOOL SYSLINK_OnEnter (const SYSLINK_INFO *infoPtr)
{
if(infoPtr->HasFocus)
{
* SYSKEY_SelectNextPrevLink
* Changes the currently focused link
*/
-static BOOL SYSKEY_SelectNextPrevLink (SYSLINK_INFO *infoPtr, BOOL Prev)
+static BOOL SYSKEY_SelectNextPrevLink (const SYSLINK_INFO *infoPtr, BOOL Prev)
{
if(infoPtr->HasFocus)
{
* Determines if there's a next or previous link to decide whether the control
* should capture the tab key message
*/
-static BOOL SYSLINK_NoNextLink (SYSLINK_INFO *infoPtr, BOOL Prev)
+static BOOL SYSLINK_NoNextLink (const SYSLINK_INFO *infoPtr, BOOL Prev)
{
PDOC_ITEM Focus, NewFocus;
* SYSLINK_GetIdealSize
* Calculates the ideal size of a link control at a given maximum width.
*/
-static VOID SYSLINK_GetIdealSize (SYSLINK_INFO *infoPtr, int cxMaxWidth, LPSIZE lpSize)
+static VOID SYSLINK_GetIdealSize (const SYSLINK_INFO *infoPtr, int cxMaxWidth, LPSIZE lpSize)
{
RECT rc;
HDC hdc;
/******************************************************************************
* Prototypes
*/
-static void TAB_InvalidateTabArea(TAB_INFO *);
+static void TAB_InvalidateTabArea(const TAB_INFO *);
static void TAB_EnsureSelectionVisible(TAB_INFO *);
-static void TAB_DrawItemInterior(TAB_INFO *, HDC, INT, RECT*);
+static void TAB_DrawItemInterior(const TAB_INFO *, HDC, INT, RECT*);
static BOOL
TAB_SendSimpleNotify (const TAB_INFO *infoPtr, UINT code)
}
static void
-TAB_DumpItemExternalT(TCITEMW *pti, UINT iItem, BOOL isW)
+TAB_DumpItemExternalT(const TCITEMW *pti, UINT iItem, BOOL isW)
{
if (TRACE_ON(tab)) {
TRACE("external tab %d, mask=0x%08x, dwState=0x%08x, dwStateMask=0x%08x, cchTextMax=0x%08x\n",
}
static void
-TAB_DumpItemInternal(TAB_INFO *infoPtr, UINT iItem)
+TAB_DumpItemInternal(const TAB_INFO *infoPtr, UINT iItem)
{
if (TRACE_ON(tab)) {
TAB_ITEM *ti;
}
/* RETURNS
- * the index of the tab item that has the focus
- * NOTE
- * we have not to return negative value
- * TODO
- * test for windows */
+ * the index of the tab item that has the focus. */
static inline LRESULT
TAB_GetCurFocus (const TAB_INFO *infoPtr)
{
- if (infoPtr->uFocus<0)
- {
- FIXME("we have not to return negative value\n");
- return 0;
- }
return infoPtr->uFocus;
}
static inline LRESULT TAB_SetCurSel (TAB_INFO *infoPtr, INT iItem)
{
- INT prevItem = -1;
+ INT prevItem = infoPtr->iSelected;
- if (iItem >= 0 && iItem < infoPtr->uNumItem) {
- prevItem=infoPtr->iSelected;
+ if (iItem < 0)
+ infoPtr->iSelected=-1;
+ else if (iItem >= infoPtr->uNumItem)
+ return -1;
+ else {
if (infoPtr->iSelected != iItem) {
infoPtr->iSelected=iItem;
TAB_EnsureSelectionVisible(infoPtr);
static LRESULT TAB_SetCurFocus (TAB_INFO *infoPtr, INT iItem)
{
- if (iItem < 0 || iItem >= infoPtr->uNumItem) return 0;
-
- if (GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & TCS_BUTTONS) {
- FIXME("Should set input focus\n");
- } else {
- int oldFocus = infoPtr->uFocus;
- if (infoPtr->iSelected != iItem || oldFocus == -1 ) {
- infoPtr->uFocus = iItem;
- if (oldFocus != -1) {
- if (!TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGING)) {
- infoPtr->iSelected = iItem;
- TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGE);
+ if (iItem < 0)
+ infoPtr->uFocus = -1;
+ else if (iItem < infoPtr->uNumItem) {
+ if (GetWindowLongW(infoPtr->hwnd, GWL_STYLE) & TCS_BUTTONS) {
+ FIXME("Should set input focus\n");
+ } else {
+ int oldFocus = infoPtr->uFocus;
+ if (infoPtr->iSelected != iItem || oldFocus == -1 ) {
+ infoPtr->uFocus = iItem;
+ if (oldFocus != -1) {
+ if (!TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGING)) {
+ infoPtr->iSelected = iItem;
+ TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGE);
+ }
+ else
+ infoPtr->iSelected = iItem;
+ TAB_EnsureSelectionVisible(infoPtr);
+ TAB_InvalidateTabArea(infoPtr);
}
- else
- infoPtr->iSelected = iItem;
- TAB_EnsureSelectionVisible(infoPtr);
- TAB_InvalidateTabArea(infoPtr);
}
}
}
}
static inline BOOL
-TAB_GetItemRect(TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+TAB_GetItemRect(const TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
return TAB_InternalGetItemRect(infoPtr, (INT)wParam, (LPRECT)lParam, (LPRECT)NULL);
}
}
}
-static INT TAB_InternalHitTest (
- TAB_INFO* infoPtr,
- POINT pt,
- UINT* flags)
-
+static INT TAB_InternalHitTest (const TAB_INFO *infoPtr, POINT pt, UINT *flags)
{
RECT rect;
INT iCount;
}
static inline LRESULT
-TAB_HitTest (TAB_INFO *infoPtr, LPTCHITTESTINFO lptest)
+TAB_HitTest (const TAB_INFO *infoPtr, LPTCHITTESTINFO lptest)
{
return TAB_InternalHitTest (infoPtr, lptest->pt, &lptest->flags);
}
* doesn't do it that way. Maybe depends on tab control styles ?
*/
static inline LRESULT
-TAB_NCHitTest (TAB_INFO *infoPtr, LPARAM lParam)
+TAB_NCHitTest (const TAB_INFO *infoPtr, LPARAM lParam)
{
POINT pt;
UINT dummyflag;
* only calls TAB_DrawItemInterior for the single specified item.
*/
static void
-TAB_DrawLoneItemInterior(TAB_INFO* infoPtr, int iItem)
+TAB_DrawLoneItemInterior(const TAB_INFO* infoPtr, int iItem)
{
HDC hdc = GetDC(infoPtr->hwnd);
RECT r, rC;
/* update a tab after hottracking - invalidate it or just redraw the interior,
* based on whether theming is used or not */
-static inline void hottrack_refresh (TAB_INFO* infoPtr, int tabIndex)
+static inline void hottrack_refresh(const TAB_INFO *infoPtr, int tabIndex)
{
if (tabIndex == -1) return;
* Calculates the tab control's display area given the window rectangle or
* the window rectangle given the requested display rectangle.
*/
-static LRESULT TAB_AdjustRect(
- TAB_INFO *infoPtr,
- WPARAM fLarger,
- LPRECT prc)
+static LRESULT TAB_AdjustRect(const TAB_INFO *infoPtr, WPARAM fLarger, LPRECT prc)
{
DWORD lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
LONG *iRightBottom, *iLeftTop;
* This method will handle the notification from the scroll control and
* perform the scrolling operation on the tab control.
*/
-static LRESULT TAB_OnHScroll(
- TAB_INFO *infoPtr,
- int nScrollCode,
- int nPos,
- HWND hwndScroll)
+static LRESULT TAB_OnHScroll(TAB_INFO *infoPtr, int nScrollCode, int nPos, HWND hwndScroll)
{
if(nScrollCode == SB_THUMBPOSITION && nPos != infoPtr->leftmostVisible)
{
static void
-TAB_EraseTabInterior
- (
- TAB_INFO* infoPtr,
- HDC hdc,
- INT iItem,
- RECT* drawRect
- )
+TAB_EraseTabInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect)
{
LONG lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
HBRUSH hbr = CreateSolidBrush (comctl32_color.clrBtnFace);
* into the tab control.
*/
static void
-TAB_DrawItemInterior
- (
- TAB_INFO* infoPtr,
- HDC hdc,
- INT iItem,
- RECT* drawRect
- )
+TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect)
{
LONG lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
*
* This method is used to draw a single tab into the tab control.
*/
-static void TAB_DrawItem(
- TAB_INFO *infoPtr,
- HDC hdc,
- INT iItem)
+static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem)
{
LONG lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
RECT itemRect;
* This method is used to draw the raised border around the tab control
* "content" area.
*/
-static void TAB_DrawBorder (TAB_INFO *infoPtr, HDC hdc)
+static void TAB_DrawBorder(const TAB_INFO *infoPtr, HDC hdc)
{
RECT rect;
DWORD lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
* tabs. It is called when the state of the control changes and needs
* to be redisplayed
*/
-static void TAB_InvalidateTabArea(TAB_INFO* infoPtr)
+static void TAB_InvalidateTabArea(const TAB_INFO *infoPtr)
{
RECT clientRect, rInvalidate, rAdjClient;
DWORD lStyle = GetWindowLongW(infoPtr->hwnd, GWL_STYLE);
}
/* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (TAB_INFO* infoPtr)
+static LRESULT theme_changed(const TAB_INFO *infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
CloseThemeData (theme);
#define EDIT_CONTROL_PADDING 1
/* paint text of combobox, needed for read-only drop downs. */
-static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, COMBOBOXINFO* cbi)
+static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *cbi)
{
INT id, size = 0;
LPWSTR pText = NULL;
INT nButtonHeight;
INT nButtonWidth;
INT nBitmapHeight;
- INT nVBitmapHeight; /* see TOOLBAR_Create for an explanation */
INT nBitmapWidth;
INT nIndent;
INT nRows; /* number of button rows */
static const WCHAR themeClass[] = { 'T','o','o','l','b','a','r',0 };
-static BOOL TOOLBAR_GetButtonInfo(TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb);
-static BOOL TOOLBAR_IsButtonRemovable(TOOLBAR_INFO *infoPtr, int iItem, PCUSTOMBUTTON btnInfo);
-static HIMAGELIST TOOLBAR_GetImageList(PIMLENTRY *pies, INT cies, INT id);
-static PIMLENTRY TOOLBAR_GetImageListEntry(PIMLENTRY *pies, INT cies, INT id);
+static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb);
+static BOOL TOOLBAR_IsButtonRemovable(const TOOLBAR_INFO *infoPtr, int iItem, PCUSTOMBUTTON btnInfo);
+static HIMAGELIST TOOLBAR_GetImageList(const PIMLENTRY *pies, INT cies, INT id);
+static PIMLENTRY TOOLBAR_GetImageListEntry(const PIMLENTRY *pies, INT cies, INT id);
static VOID TOOLBAR_DeleteImageList(PIMLENTRY **pies, INT *cies);
static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIST himl, INT id);
static LRESULT TOOLBAR_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam);
static void TOOLBAR_LayoutToolbar(HWND hwnd);
static LRESULT TOOLBAR_AutoSize(HWND hwnd);
static void TOOLBAR_CheckImageListIconSize(TOOLBAR_INFO *infoPtr);
-static void TOOLBAR_TooltipSetRect(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *button);
+static void TOOLBAR_TooltipSetRect(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *button);
static LRESULT
-TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam);
+TOOLBAR_NotifyFormat(const TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam);
-inline static int default_top_margin(TOOLBAR_INFO *infoPtr)
+static inline int default_top_margin(const TOOLBAR_INFO *infoPtr)
{
return (infoPtr->dwStyle & TBSTYLE_FLAT ? 0 : TOP_BORDER);
}
static LPWSTR
-TOOLBAR_GetText(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
+TOOLBAR_GetText(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr)
{
LPWSTR lpText = NULL;
}
static void
-TOOLBAR_DumpButton(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *bP, INT btn_num, BOOL internal)
+TOOLBAR_DumpButton(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *bP, INT btn_num, BOOL internal)
{
if (TRACE_ON(toolbar)){
TRACE("button %d id %d, bitmap=%d, state=%02x, style=%02x, data=%08lx, stringid=0x%08x\n",
static void
-TOOLBAR_DumpToolbar(TOOLBAR_INFO *iP, INT line)
+TOOLBAR_DumpToolbar(const TOOLBAR_INFO *iP, INT line)
{
if (TRACE_ON(toolbar)) {
INT i;
static INT
-TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code)
+TOOLBAR_SendNotify (NMHDR *nmhdr, const TOOLBAR_INFO *infoPtr, UINT code)
{
if(!IsWindow(infoPtr->hwndSelf))
return 0; /* we have just been destroyed */
* is issued to retrieve the index.
*/
static INT
-TOOLBAR_GetBitmapIndex(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
+TOOLBAR_GetBitmapIndex(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr)
{
INT ret = btnPtr->iBitmap;
static BOOL
-TOOLBAR_IsValidBitmapIndex(TOOLBAR_INFO *infoPtr, INT index)
+TOOLBAR_IsValidBitmapIndex(const TOOLBAR_INFO *infoPtr, INT index)
{
HIMAGELIST himl;
INT id = GETHIMLID(infoPtr, index);
static inline BOOL
-TOOLBAR_IsValidImageList(TOOLBAR_INFO *infoPtr, INT index)
+TOOLBAR_IsValidImageList(const TOOLBAR_INFO *infoPtr, INT index)
{
HIMAGELIST himl = GETDEFIMAGELIST(infoPtr, GETHIMLID(infoPtr, index));
return (himl != NULL) && (ImageList_GetImageCount(himl) > 0);
* functionality) and returns the corresponding image list.
*/
static HIMAGELIST
-TOOLBAR_GetImageListForDrawing (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, IMAGE_LIST_TYPE imagelist, INT * index)
+TOOLBAR_GetImageListForDrawing (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
+ IMAGE_LIST_TYPE imagelist, INT * index)
{
HIMAGELIST himl;
static void
-TOOLBAR_DrawFlatSeparator (LPRECT lpRect, HDC hdc, TOOLBAR_INFO *infoPtr)
+TOOLBAR_DrawFlatSeparator (const RECT *lpRect, HDC hdc, const TOOLBAR_INFO *infoPtr)
{
RECT myrect;
COLORREF oldcolor, newcolor;
* FIXME: It is possible that the height of each line is really SM_CYBORDER.
*/
static void
-TOOLBAR_DrawDDFlatSeparator (LPRECT lpRect, HDC hdc, TBUTTON_INFO *btnPtr, TOOLBAR_INFO *infoPtr)
+TOOLBAR_DrawDDFlatSeparator (const RECT *lpRect, HDC hdc, const TBUTTON_INFO *btnPtr,
+ const TOOLBAR_INFO *infoPtr)
{
RECT myrect;
COLORREF oldcolor, newcolor;
* an image list
*/
static void
-TOOLBAR_DrawString (TOOLBAR_INFO *infoPtr, RECT *rcText, LPWSTR lpText,
- NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag)
+TOOLBAR_DrawString (const TOOLBAR_INFO *infoPtr, RECT *rcText, LPCWSTR lpText,
+ const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag)
{
HDC hdc = tbcd->nmcd.hdc;
HFONT hOldFont = 0;
static void
-TOOLBAR_DrawPattern (LPRECT lpRect, NMTBCUSTOMDRAW *tbcd)
+TOOLBAR_DrawPattern (const RECT *lpRect, const NMTBCUSTOMDRAW *tbcd)
{
HDC hdc = tbcd->nmcd.hdc;
HBRUSH hbr = SelectObject (hdc, tbcd->hbrMonoDither);
static UINT
-TOOLBAR_TranslateState(TBUTTON_INFO *btnPtr)
+TOOLBAR_TranslateState(const TBUTTON_INFO *btnPtr)
{
UINT retstate = 0;
/* draws the image on a toolbar button */
static void
-TOOLBAR_DrawImage(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, INT top,
- const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag)
+TOOLBAR_DrawImage(const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, INT left, INT top,
+ const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag)
{
HIMAGELIST himl = NULL;
BOOL draw_masked = FALSE;
static void
-TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
+TOOLBAR_Refresh (HWND hwnd, HDC hdc, const PAINTSTRUCT *ps)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
* only DrawText does. Note that the BTNS_NOPREFIX is handled here.
*/
static void
-TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
+TOOLBAR_MeasureString(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr,
HDC hdc, LPSIZE lpSize)
{
RECT myrect;
* Without text:
* As for with bitmaps, but with szText.cx zero.
*/
-static inline SIZE TOOLBAR_MeasureButton(TOOLBAR_INFO *infoPtr, SIZE sizeString, BOOL bHasBitmap, BOOL bValidImageList)
+static inline SIZE TOOLBAR_MeasureButton(const TOOLBAR_INFO *infoPtr, SIZE sizeString,
+ BOOL bHasBitmap, BOOL bValidImageList)
{
SIZE sizeButton;
if (infoPtr->dwStyle & TBSTYLE_LIST)
{
/* set button height from bitmap / text height... */
- sizeButton.cy = max((bHasBitmap ? infoPtr->nVBitmapHeight : 0),
+ sizeButton.cy = max((bHasBitmap ? infoPtr->nBitmapHeight : 0),
sizeString.cy);
/* ... add on the necessary padding */
{
if (bHasBitmap)
{
- sizeButton.cy = infoPtr->nVBitmapHeight + DEFPAD_CY;
+ sizeButton.cy = infoPtr->nBitmapHeight + DEFPAD_CY;
if (sizeString.cy > 0)
sizeButton.cy += 1 + sizeString.cy;
sizeButton.cx = infoPtr->szPadding.cx +
static INT
-TOOLBAR_InternalHitTest (HWND hwnd, LPPOINT lpPt)
+TOOLBAR_InternalHitTest (HWND hwnd, const POINT *lpPt)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
static INT
-TOOLBAR_GetButtonIndex (TOOLBAR_INFO *infoPtr, INT idCommand, BOOL CommandIsIndex)
+TOOLBAR_GetButtonIndex (const TOOLBAR_INFO *infoPtr, INT idCommand, BOOL CommandIsIndex)
{
TBUTTON_INFO *btnPtr;
INT i;
static INT
-TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
+TOOLBAR_GetCheckedGroupButtonIndex (const TOOLBAR_INFO *infoPtr, INT nIndex)
{
TBUTTON_INFO *btnPtr;
INT nRunIndex;
}
static void
-TOOLBAR_TooltipAddTool(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *button)
+TOOLBAR_TooltipAddTool(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *button)
{
if (infoPtr->hwndToolTip && !(button->fsStyle & BTNS_SEP)) {
TTTOOLINFOW ti;
}
static void
-TOOLBAR_TooltipDelTool(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *button)
+TOOLBAR_TooltipDelTool(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *button)
{
if ((infoPtr->hwndToolTip) && !(button->fsStyle & BTNS_SEP)) {
TTTOOLINFOW ti;
}
}
-static void TOOLBAR_TooltipSetRect(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *button)
+static void TOOLBAR_TooltipSetRect(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *button)
{
/* Set the toolTip only for non-hidden, non-separator button */
if (infoPtr->hwndToolTip && !(button->fsStyle & BTNS_SEP))
SendMessageW(hwndAvail, LB_SETITEMDATA, i, (LPARAM)btnInfoNew);
}
-static void TOOLBAR_Cust_MoveButton(PCUSTDLG_INFO custInfo, HWND hwnd, INT nIndexFrom, INT nIndexTo)
+static void TOOLBAR_Cust_MoveButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT nIndexFrom, INT nIndexTo)
{
NMTOOLBARW nmtb;
}
}
-static void TOOLBAR_Cust_AddButton(PCUSTDLG_INFO custInfo, HWND hwnd, INT nIndexAvail, INT nIndexTo)
+static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT nIndexAvail, INT nIndexTo)
{
NMTOOLBARW nmtb;
}
}
-static void TOOLBAR_Cust_RemoveButton(PCUSTDLG_INFO custInfo, HWND hwnd, INT index)
+static void TOOLBAR_Cust_RemoveButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT index)
{
PCUSTOMBUTTON btnInfo;
HWND hwndList = GetDlgItem(hwnd, IDC_TOOLBARBTN_LBOX);
}
/* drag list notification function for toolbar buttons list box */
-static LRESULT TOOLBAR_Cust_ToolbarDragListNotification(PCUSTDLG_INFO custInfo, HWND hwnd, DRAGLISTINFO *pDLI)
+static LRESULT TOOLBAR_Cust_ToolbarDragListNotification(const CUSTDLG_INFO *custInfo, HWND hwnd,
+ const DRAGLISTINFO *pDLI)
{
HWND hwndList = GetDlgItem(hwnd, IDC_TOOLBARBTN_LBOX);
switch (pDLI->uNotification)
}
/* drag list notification function for available buttons list box */
-static LRESULT TOOLBAR_Cust_AvailDragListNotification(PCUSTDLG_INFO custInfo, HWND hwnd, DRAGLISTINFO *pDLI)
+static LRESULT TOOLBAR_Cust_AvailDragListNotification(const CUSTDLG_INFO *custInfo, HWND hwnd,
+ const DRAGLISTINFO *pDLI)
{
HWND hwndList = GetDlgItem(hwnd, IDC_TOOLBARBTN_LBOX);
switch (pDLI->uNotification)
/* enlarge the bitmap if needed */
ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon);
- COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
+ if (bitmap->hInst != COMCTL32_hModule)
+ COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace);
DeleteObject(hbmLoad);
/* Windows resize all the buttons to the size of a newly added standard image */
if (lpAddBmp->nID & 1)
{
- /* large icons */
- /* FIXME: on windows the size of the images is 25x24 but the size of the bitmap
- * in rsrc is only 24x24. Fix the bitmap (how?) and then fix this
- */
- SendMessageW (hwnd, TB_SETBITMAPSIZE, 0,
- MAKELPARAM((WORD)24, (WORD)24));
- SendMessageW (hwnd, TB_SETBUTTONSIZE, 0,
- MAKELPARAM((WORD)31, (WORD)30));
+ /* large icons: 24x24. Will make the button 31x30 */
+ SendMessageW (hwnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(24, 24));
}
else
{
- /* small icons */
- SendMessageW (hwnd, TB_SETBITMAPSIZE, 0,
- MAKELPARAM((WORD)16, (WORD)16));
- SendMessageW (hwnd, TB_SETBUTTONSIZE, 0,
- MAKELPARAM((WORD)22, (WORD)22));
+ /* small icons: 16x16. Will make the buttons 23x22 */
+ SendMessageW (hwnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(16, 16));
}
TOOLBAR_CalcToolbar (hwnd);
static LRESULT
-TOOLBAR_GetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam)
+TOOLBAR_GetButtonInfoT(HWND hwnd, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
- LPTBBUTTONINFOA lpTbInfo = (LPTBBUTTONINFOA)lParam;
+ /* TBBUTTONINFOW and TBBUTTONINFOA have the same layout*/
+ LPTBBUTTONINFOW lpTbInfo = (LPTBBUTTONINFOW)lParam;
TBUTTON_INFO *btnPtr;
INT nIndex;
if (lpTbInfo == NULL)
return -1;
- if (lpTbInfo->cbSize < sizeof(TBBUTTONINFOA))
- return -1;
- nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam,
- lpTbInfo->dwMask & 0x80000000);
- if (nIndex == -1)
+ /* MSDN documents a iImageLabel field added in Vista but it is not present in
+ * the headers and tests shows that even with comctl 6 Vista accepts only the
+ * original TBBUTTONINFO size
+ */
+ if (lpTbInfo->cbSize != sizeof(TBBUTTONINFOW))
+ {
+ WARN("Invalid button size\n");
return -1;
-
- if (!(btnPtr = &infoPtr->buttons[nIndex])) return -1;
-
- if (lpTbInfo->dwMask & TBIF_COMMAND)
- lpTbInfo->idCommand = btnPtr->idCommand;
- if (lpTbInfo->dwMask & TBIF_IMAGE)
- lpTbInfo->iImage = btnPtr->iBitmap;
- if (lpTbInfo->dwMask & TBIF_LPARAM)
- lpTbInfo->lParam = btnPtr->dwData;
- if (lpTbInfo->dwMask & TBIF_SIZE)
- lpTbInfo->cx = (WORD)(btnPtr->rect.right - btnPtr->rect.left);
- if (lpTbInfo->dwMask & TBIF_STATE)
- lpTbInfo->fsState = btnPtr->fsState;
- if (lpTbInfo->dwMask & TBIF_STYLE)
- lpTbInfo->fsStyle = btnPtr->fsStyle;
- if (lpTbInfo->dwMask & TBIF_TEXT) {
- /* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
- can't use TOOLBAR_GetText here */
- LPWSTR lpText;
- if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
- lpText = (LPWSTR)btnPtr->iString;
- Str_GetPtrWtoA (lpText, lpTbInfo->pszText,lpTbInfo->cchText);
- } else
- lpTbInfo->pszText[0] = '\0';
}
- return nIndex;
-}
-
-
-static LRESULT
-TOOLBAR_GetButtonInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
-{
- TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
- LPTBBUTTONINFOW lpTbInfo = (LPTBBUTTONINFOW)lParam;
- TBUTTON_INFO *btnPtr;
- INT nIndex;
-
- if (lpTbInfo == NULL)
- return -1;
- if (lpTbInfo->cbSize < sizeof(TBBUTTONINFOW))
- return -1;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam,
lpTbInfo->dwMask & 0x80000000);
if (nIndex == -1)
return -1;
- btnPtr = &infoPtr->buttons[nIndex];
-
- if(!btnPtr)
- return -1;
+ if (!(btnPtr = &infoPtr->buttons[nIndex])) return -1;
if (lpTbInfo->dwMask & TBIF_COMMAND)
lpTbInfo->idCommand = btnPtr->idCommand;
if (lpTbInfo->dwMask & TBIF_TEXT) {
/* TB_GETBUTTONINFO doesn't retrieve text from the string list, so we
can't use TOOLBAR_GetText here */
- LPWSTR lpText;
if (HIWORD(btnPtr->iString) && (btnPtr->iString != -1)) {
- lpText = (LPWSTR)btnPtr->iString;
- Str_GetPtrW (lpText,lpTbInfo->pszText,lpTbInfo->cchText);
+ LPWSTR lpText = (LPWSTR)btnPtr->iString;
+ if (bUnicode)
+ Str_GetPtrW(lpText, lpTbInfo->pszText, lpTbInfo->cchText);
+ else
+ Str_GetPtrWtoA(lpText, (LPSTR)lpTbInfo->pszText, lpTbInfo->cchText);
} else
lpTbInfo->pszText[0] = '\0';
}
-
return nIndex;
}
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_GetExtendedStyle (HWND hwnd)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_GetVersion (HWND hwnd)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
else
btnPtr->fsState |= TBSTATE_HIDDEN;
- TOOLBAR_CalcToolbar (hwnd);
+ TOOLBAR_LayoutToolbar (hwnd);
InvalidateRect (hwnd, NULL, TRUE);
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
return TOOLBAR_InternalHitTest (hwnd, (LPPOINT)lParam);
/* fixes up an index of a button affected by a move */
-inline static void TOOLBAR_MoveFixupIndex(INT* pIndex, INT nIndex, INT nMoveIndex, BOOL bMoveUp)
+static inline void TOOLBAR_MoveFixupIndex(INT* pIndex, INT nIndex, INT nMoveIndex, BOOL bMoveUp)
{
if (bMoveUp)
{
TOOLBAR_MoveFixupIndex(&infoPtr->nHotItem, nIndex, nMoveIndex, FALSE);
}
- TOOLBAR_CalcToolbar(hwnd);
+ TOOLBAR_LayoutToolbar(hwnd);
TOOLBAR_AutoSize(hwnd);
InvalidateRect(hwnd, NULL, TRUE);
/* helper for TOOLBAR_SaveRestoreW */
static BOOL
-TOOLBAR_Save(TOOLBAR_INFO *infoPtr, LPTBSAVEPARAMSW lpSave)
+TOOLBAR_Save(const TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
{
FIXME("save to %s %s\n", debugstr_w(lpSave->pszSubKey),
debugstr_w(lpSave->pszValueName));
/* helper for TOOLBAR_SaveRestoreW */
static BOOL
-TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, LPTBSAVEPARAMSW lpSave)
+TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
{
LONG res;
HKEY hkey = NULL;
static LRESULT
-TOOLBAR_SaveRestoreW (HWND hwnd, WPARAM wParam, LPTBSAVEPARAMSW lpSave)
+TOOLBAR_SaveRestoreW (HWND hwnd, WPARAM wParam, const TBSAVEPARAMSW *lpSave)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
static LRESULT
-TOOLBAR_SaveRestoreA (HWND hwnd, WPARAM wParam, LPTBSAVEPARAMSA lpSave)
+TOOLBAR_SaveRestoreA (HWND hwnd, WPARAM wParam, const TBSAVEPARAMSA *lpSave)
{
LPWSTR pszValueName = 0, pszSubKey = 0;
TBSAVEPARAMSW SaveW;
LOWORD(lParam), HIWORD(lParam));
infoPtr->nBitmapWidth = (INT)LOWORD(lParam);
- infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight = (INT)HIWORD(lParam);
+ infoPtr->nBitmapHeight = (INT)HIWORD(lParam);
if ((himlDef == infoPtr->himlInt) &&
(ImageList_GetImageCount(infoPtr->himlInt) == 0))
if (cy == 0) cx = 22;
cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
- cy = max(cy, infoPtr->szPadding.cy + infoPtr->nVBitmapHeight);
+ cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight);
infoPtr->nButtonWidth = cx;
infoPtr->nButtonHeight = cy;
infoPtr->nBitmapWidth = 1;
infoPtr->nBitmapHeight = 1;
}
- infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight;
TOOLBAR_CalcToolbar(hwnd);
TRACE("hwnd %p, new himl=%p, id = %d, count=%d, bitmap w=%d, h=%d\n",
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_SetToolTips (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
static LRESULT
-TOOLBAR_SetColorScheme (HWND hwnd, LPCOLORSCHEME lParam)
+TOOLBAR_SetColorScheme (HWND hwnd, const COLORSCHEME *lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
/* initialize info structure */
infoPtr->nButtonWidth = 23;
infoPtr->nButtonHeight = 22;
- infoPtr->nBitmapHeight = 15;
+ infoPtr->nBitmapHeight = 16;
infoPtr->nBitmapWidth = 16;
- /* By default Windows creates an image list with 16x15 icons but computes the button size as
- * if the icons were 16x16. That's why we keep infoPtr->nVBitmapHeight. After a call to
- * TB_SETBITMAPSIZE or TB_SETIMAGELIST the nVBitmapHeight = nBitmapHeight.
- */
- infoPtr->nVBitmapHeight = 16;
infoPtr->nMaxTextRows = 1;
infoPtr->cxMin = -1;
{
SendMessageW (infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(infoPtr->buttons[nHit].idCommand, BN_CLICKED), (LPARAM)hwnd);
+
+ /* In case we have just been destroyed... */
+ if(!IsWindow(hwnd))
+ return 0;
}
}
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_NCActivate (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
/* if (wndPtr->dwStyle & CCS_NODIVIDER) */
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_NCCalcSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
if (!(GetWindowLongW(hwnd, GWL_STYLE) & CCS_NODIVIDER))
}
-inline static LRESULT
+static inline LRESULT
TOOLBAR_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
static LRESULT
-TOOLBAR_NotifyFormat(TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+TOOLBAR_NotifyFormat(const TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LRESULT format;
static LRESULT
-TOOLBAR_StyleChanged (HWND hwnd, INT nType, LPSTYLESTRUCT lpStyle)
+TOOLBAR_StyleChanged (HWND hwnd, INT nType, const STYLESTRUCT *lpStyle)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
return TOOLBAR_GetButton (hwnd, wParam, lParam);
case TB_GETBUTTONINFOA:
- return TOOLBAR_GetButtonInfoA (hwnd, wParam, lParam);
+ return TOOLBAR_GetButtonInfoT(hwnd, wParam, lParam, FALSE);
case TB_GETBUTTONINFOW:
- return TOOLBAR_GetButtonInfoW (hwnd, wParam, lParam);
+ return TOOLBAR_GetButtonInfoT(hwnd, wParam, lParam, TRUE);
case TB_GETBUTTONSIZE:
return TOOLBAR_GetButtonSize (hwnd);
}
-static PIMLENTRY TOOLBAR_GetImageListEntry(PIMLENTRY *pies, INT cies, INT id)
+static PIMLENTRY TOOLBAR_GetImageListEntry(const PIMLENTRY *pies, INT cies, INT id)
{
PIMLENTRY c = NULL;
}
-static HIMAGELIST TOOLBAR_GetImageList(PIMLENTRY *pies, INT cies, INT id)
+static HIMAGELIST TOOLBAR_GetImageList(const PIMLENTRY *pies, INT cies, INT id)
{
HIMAGELIST himlDef = 0;
PIMLENTRY pie = TOOLBAR_GetImageListEntry(pies, cies, id);
}
-static BOOL TOOLBAR_GetButtonInfo(TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb)
+static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb)
{
if (infoPtr->bUnicode)
return TOOLBAR_SendNotify(&nmtb->hdr, infoPtr, TBN_GETBUTTONINFOW);
}
-static BOOL TOOLBAR_IsButtonRemovable(TOOLBAR_INFO *infoPtr,
- int iItem, PCUSTOMBUTTON btnInfo)
+static BOOL TOOLBAR_IsButtonRemovable(const TOOLBAR_INFO *infoPtr, int iItem, PCUSTOMBUTTON btnInfo)
{
NMTOOLBARW nmtb;
TOOLTIPS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uId, DWORD_PTR dwRef);
-inline static UINT_PTR
+static inline UINT_PTR
TOOLTIPS_GetTitleIconIndex(HICON hIcon)
{
UINT i;
static void
-TOOLTIPS_CalcTipSize (HWND hwnd, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
+TOOLTIPS_CalcTipSize (HWND hwnd, const TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
{
HDC hdc;
HFONT hOldFont;
static void
-TOOLTIPS_TrackHide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
+TOOLTIPS_TrackHide (HWND hwnd, const TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
NMHDR hdr;
static INT
-TOOLTIPS_GetToolFromInfoA (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOA lpToolInfo)
+TOOLTIPS_GetToolFromInfoA (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOA *lpToolInfo)
{
TTTOOL_INFO *toolPtr;
INT nTool;
static INT
-TOOLTIPS_GetToolFromInfoW (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOW lpToolInfo)
+TOOLTIPS_GetToolFromInfoW (const TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *lpToolInfo)
{
TTTOOL_INFO *toolPtr;
INT nTool;
static INT
-TOOLTIPS_GetToolFromPoint (TOOLTIPS_INFO *infoPtr, HWND hwnd, LPPOINT lpPt)
+TOOLTIPS_GetToolFromPoint (const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT *lpPt)
{
TTTOOL_INFO *toolPtr;
INT nTool;
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_GetMaxTipWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_GetTipBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_GetTipTextColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_GetToolCount (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_Pop (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_SetMaxTipWidth (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_SetTipBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
}
-inline static LRESULT
+static inline LRESULT
TOOLTIPS_SetTipTextColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
static const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 };
static inline int
-notify_customdraw(TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
+notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
{
pnmcd->dwDrawStage = stage;
return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
pnmcd->hdr.idFrom, (LPARAM)pnmcd);
}
-static LRESULT notify_hdr(TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
+static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
{
LRESULT result;
return result;
}
-static inline int notify(TRACKBAR_INFO *infoPtr, INT code)
+static inline int notify (const TRACKBAR_INFO *infoPtr, INT code)
{
NMHDR nmh;
return notify_hdr(infoPtr, code, &nmh);
}
static BOOL
-notify_with_scroll (TRACKBAR_INFO *infoPtr, UINT code)
+notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
{
BOOL bVert = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_VERT;
(in range of trackbar) */
static inline LONG
-TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
- int vertical)
+TRACKBAR_ConvertPlaceToPosition (const TRACKBAR_INFO *infoPtr, int place, int vertical)
{
double range, width, pos, offsetthumb;
/* return: 0> prev, 0 none, >0 next */
static LONG
-TRACKBAR_GetAutoPageDirection (TRACKBAR_INFO *infoPtr, POINT clickPoint)
+TRACKBAR_GetAutoPageDirection (const TRACKBAR_INFO *infoPtr, POINT clickPoint)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
RECT pageRect;
return 0;
}
-inline static void
+static inline void
TRACKBAR_PageDown (TRACKBAR_INFO *infoPtr)
{
if (infoPtr->lPos == infoPtr->lRangeMax) return;
}
-inline static void
+static inline void
TRACKBAR_PageUp (TRACKBAR_INFO *infoPtr)
{
if (infoPtr->lPos == infoPtr->lRangeMin) return;
notify_with_scroll (infoPtr, TB_PAGEUP);
}
-inline static void TRACKBAR_LineUp(TRACKBAR_INFO *infoPtr)
+static inline void TRACKBAR_LineUp(TRACKBAR_INFO *infoPtr)
{
if (infoPtr->lPos == infoPtr->lRangeMin) return;
infoPtr->lPos -= infoPtr->lLineSize;
notify_with_scroll (infoPtr, TB_LINEUP);
}
-inline static void TRACKBAR_LineDown(TRACKBAR_INFO *infoPtr)
+static inline void TRACKBAR_LineDown(TRACKBAR_INFO *infoPtr)
{
if (infoPtr->lPos == infoPtr->lRangeMax) return;
infoPtr->lPos += infoPtr->lLineSize;
}
static void
-TRACKBAR_CalcThumb (TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
+TRACKBAR_CalcThumb (const TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
{
int range, width, height, thumbwidth;
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
}
}
-inline static void
+static inline void
TRACKBAR_UpdateThumb (TRACKBAR_INFO *infoPtr)
{
TRACKBAR_CalcThumb(infoPtr, infoPtr->lPos, &infoPtr->rcThumb);
}
static inline void
-TRACKBAR_InvalidateAll(TRACKBAR_INFO * infoPtr)
+TRACKBAR_InvalidateAll (const TRACKBAR_INFO *infoPtr)
{
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
}
static void
-TRACKBAR_InvalidateThumb (TRACKBAR_INFO *infoPtr, LONG thumbPos)
+TRACKBAR_InvalidateThumb (const TRACKBAR_INFO *infoPtr, LONG thumbPos)
{
RECT rcThumb;
}
static inline void
-TRACKBAR_InvalidateThumbMove (TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
+TRACKBAR_InvalidateThumbMove (const TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
{
TRACKBAR_InvalidateThumb (infoPtr, oldPos);
if (newPos != oldPos)
TRACKBAR_InvalidateThumb (infoPtr, newPos);
}
-inline static BOOL
-TRACKBAR_HasSelection (TRACKBAR_INFO *infoPtr)
+static inline BOOL
+TRACKBAR_HasSelection (const TRACKBAR_INFO *infoPtr)
{
return infoPtr->lSelMin != infoPtr->lSelMax;
}
/* Trackbar drawing code. I like my spaghetti done milanese. */
static void
-TRACKBAR_DrawChannel (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
+TRACKBAR_DrawChannel (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
RECT rcChannel = infoPtr->rcChannel;
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
}
static void
-TRACKBAR_DrawOneTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
+TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
{
int x, y, ox, oy, range, side, indent = 0, len = 3;
int offsetthumb;
static inline void
-TRACKBAR_DrawTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
+TRACKBAR_DrawTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
{
if ((flags & (TBS_LEFT | TBS_TOP)) || (flags & TBS_BOTH))
TRACKBAR_DrawOneTic (infoPtr, hdc, ticPos, flags | TBS_LEFT);
}
static void
-TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
+TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
unsigned int i;
int ticFlags = dwStyle & 0x0f;
}
static void
-TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
+TRACKBAR_DrawThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
{
HBRUSH oldbr;
HPEN oldpen;
}
-inline static void
-TRACKBAR_ActivateToolTip (TRACKBAR_INFO *infoPtr, BOOL fShow)
+static inline void
+TRACKBAR_ActivateToolTip (const TRACKBAR_INFO *infoPtr, BOOL fShow)
{
TTTOOLINFOW ti;
static void
-TRACKBAR_UpdateToolTip (TRACKBAR_INFO *infoPtr)
+TRACKBAR_UpdateToolTip (const TRACKBAR_INFO *infoPtr)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
WCHAR buf[80];
static void
-TRACKBAR_AlignBuddies (TRACKBAR_INFO *infoPtr)
+TRACKBAR_AlignBuddies (const TRACKBAR_INFO *infoPtr)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
HWND hwndParent = GetParent (infoPtr->hwndSelf);
}
-inline static LRESULT
-TRACKBAR_GetChannelRect (TRACKBAR_INFO *infoPtr, LPRECT lprc)
+static inline LRESULT
+TRACKBAR_GetChannelRect (const TRACKBAR_INFO *infoPtr, LPRECT lprc)
{
if (lprc == NULL) return 0;
}
-inline static LONG
-TRACKBAR_GetNumTics (TRACKBAR_INFO *infoPtr)
+static inline LONG
+TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
{
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_NOTICKS)
return 0;
- return infoPtr->uNumTics + 2;
+ if(infoPtr->uNumTics == 0)
+ return 2;
+ else
+ return infoPtr->uNumTics + 1;
}
-static int comp_tics(const void *ap, const void *bp)
+static int comp_tics (const void *ap, const void *bp)
{
const DWORD a = *(const DWORD *)ap;
const DWORD b = *(const DWORD *)bp;
}
-inline static LONG
-TRACKBAR_GetTic (TRACKBAR_INFO *infoPtr, INT iTic)
+static inline LONG
+TRACKBAR_GetTic (const TRACKBAR_INFO *infoPtr, INT iTic)
{
if ((iTic < 0) || (iTic >= infoPtr->uNumTics) || !infoPtr->tics)
return -1;
}
-inline static LONG
-TRACKBAR_GetTicPos (TRACKBAR_INFO *infoPtr, INT iTic)
+static inline LONG
+TRACKBAR_GetTicPos (const TRACKBAR_INFO *infoPtr, INT iTic)
{
LONG range, width, pos, tic;
int offsetthumb;
}
-inline static LONG
+static inline LONG
TRACKBAR_SetLineSize (TRACKBAR_INFO *infoPtr, LONG lLineSize)
{
LONG lTemp = infoPtr->lLineSize;
}
-inline static LONG
+static inline LONG
TRACKBAR_SetPageSize (TRACKBAR_INFO *infoPtr, LONG lPageSize)
{
LONG lTemp = infoPtr->lPageSize;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
{
LONG oldPos = infoPtr->lPos;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lRange)
{
infoPtr->lRangeMin = (SHORT)LOWORD(lRange);
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetRangeMax (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lMax)
{
infoPtr->lRangeMax = lMax;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetRangeMin (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lMin)
{
infoPtr->lRangeMin = lMin;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetSel (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lSel)
{
- if (!GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_ENABLESELRANGE)
+ if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_ENABLESELRANGE)){
+ infoPtr->lSelMin = 0;
+ infoPtr->lSelMax = 0;
return 0;
+ }
infoPtr->lSelMin = (SHORT)LOWORD(lSel);
infoPtr->lSelMax = (SHORT)HIWORD(lSel);
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetSelEnd (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lEnd)
{
- if (!GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_ENABLESELRANGE)
+ if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_ENABLESELRANGE)){
+ infoPtr->lSelMax = 0;
return 0;
+ }
infoPtr->lSelMax = lEnd;
infoPtr->flags |= TB_SELECTIONCHANGED;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetSelStart (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lStart)
{
- if (!GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_ENABLESELRANGE)
+ if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_ENABLESELRANGE)){
+ infoPtr->lSelMin = 0;
return 0;
+ }
infoPtr->lSelMin = lStart;
infoPtr->flags |=TB_SELECTIONCHANGED;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetThumbLength (TRACKBAR_INFO *infoPtr, UINT iLength)
{
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_FIXEDLENGTH) {
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos)
{
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_AUTOTICKS)
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetTicFreq (TRACKBAR_INFO *infoPtr, WORD wFreq)
{
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_AUTOTICKS) {
}
-inline static INT
+static inline INT
TRACKBAR_SetTipSide (TRACKBAR_INFO *infoPtr, INT fLocation)
{
INT fTemp = infoPtr->fLocation;
}
-inline static LRESULT
+static inline LRESULT
TRACKBAR_SetToolTips (TRACKBAR_INFO *infoPtr, HWND hwndTT)
{
infoPtr->hwndToolTip = hwndTT;
}
-inline static BOOL
+static inline BOOL
TRACKBAR_SetUnicodeFormat (TRACKBAR_INFO *infoPtr, BOOL fUnicode)
{
BOOL bTemp = infoPtr->bUnicode;
static LRESULT
-TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
+TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
TRACKBAR_INFO *infoPtr;
DWORD dwStyle;
static LRESULT
-TRACKBAR_CaptureChanged (TRACKBAR_INFO *infoPtr)
+TRACKBAR_CaptureChanged (const TRACKBAR_INFO *infoPtr)
{
notify_with_scroll (infoPtr, TB_ENDTRACK);
return 0;
static LRESULT
-TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, TIMERPROC *tmrpc)
+TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, const TIMERPROC *tmrpc)
{
if (infoPtr->flags & TB_AUTO_PAGE) {
POINT pt;
/* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (TRACKBAR_INFO* infoPtr)
+static LRESULT theme_changed (const TRACKBAR_INFO* infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
CloseThemeData (theme);
}
-inline static BOOL
-TRACKBAR_KeyUp (TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
+static inline BOOL
+TRACKBAR_KeyUp (const TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
{
switch (nVirtKey) {
case VK_LEFT:
typedef VOID (*TREEVIEW_ItemEnumFunc)(TREEVIEW_INFO *, TREEVIEW_ITEM *,LPVOID);
-static VOID TREEVIEW_Invalidate(TREEVIEW_INFO *, TREEVIEW_ITEM *);
+static VOID TREEVIEW_Invalidate(const TREEVIEW_INFO *, const TREEVIEW_ITEM *);
static LRESULT TREEVIEW_DoSelectItem(TREEVIEW_INFO *, INT, HTREEITEM, INT);
static VOID TREEVIEW_SetFirstVisible(TREEVIEW_INFO *, TREEVIEW_ITEM *, BOOL);
static LRESULT TREEVIEW_EnsureVisible(TREEVIEW_INFO *, HTREEITEM, BOOL);
-static LRESULT TREEVIEW_RButtonUp(TREEVIEW_INFO *, LPPOINT);
+static LRESULT TREEVIEW_RButtonUp(const TREEVIEW_INFO *, const POINT *);
static LRESULT TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel);
static VOID TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr);
static LRESULT TREEVIEW_HScroll(TREEVIEW_INFO *, WPARAM);
/* Don't call this. Nothing wants an item index. */
static inline int
-TREEVIEW_GetItemIndex(TREEVIEW_INFO *infoPtr, HTREEITEM handle)
+TREEVIEW_GetItemIndex(const TREEVIEW_INFO *infoPtr, HTREEITEM handle)
{
assert(infoPtr != NULL);
}
/* Checks if item has changed and needs to be redrawn */
-static inline BOOL item_changed (TREEVIEW_ITEM *tiOld, TREEVIEW_ITEM *tiNew, LPTVITEMEXW tvChange)
+static inline BOOL item_changed (const TREEVIEW_ITEM *tiOld, const TREEVIEW_ITEM *tiNew,
+ const TVITEMEXW *tvChange)
{
/* Number of children has changed */
if ((tvChange->mask & TVIF_CHILDREN) && (tiOld->cChildren != tiNew->cChildren))
* This method checks that handle is an item for this tree.
*/
static BOOL
-TREEVIEW_ValidItem(TREEVIEW_INFO *infoPtr, HTREEITEM handle)
+TREEVIEW_ValidItem(const TREEVIEW_INFO *infoPtr, HTREEITEM handle)
{
if (TREEVIEW_GetItemIndex(infoPtr, handle) == -1)
{
}
static inline HFONT
-TREEVIEW_FontForItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_FontForItem(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
{
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (item == infoPtr->hotItem))
return infoPtr->hUnderlineFont;
/* for trace/debugging purposes only */
static const char *
-TREEVIEW_ItemName(TREEVIEW_ITEM *item)
+TREEVIEW_ItemName(const TREEVIEW_ITEM *item)
{
if (item == NULL) return "<null item>";
if (item->pszText == LPSTR_TEXTCALLBACKW) return "<callback>";
/* An item is not a child of itself. */
static BOOL
-TREEVIEW_IsChildOf(TREEVIEW_ITEM *parent, TREEVIEW_ITEM *child)
+TREEVIEW_IsChildOf(const TREEVIEW_ITEM *parent, const TREEVIEW_ITEM *child)
{
do
{
* of a tree node
*/
static TREEVIEW_ITEM *
-TREEVIEW_GetLastListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
+TREEVIEW_GetLastListItem(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
{
if (!wineItem)
return NULL;
* considering the tree hierarchy.
*/
static TREEVIEW_ITEM *
-TREEVIEW_GetPrevListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem)
+TREEVIEW_GetPrevListItem(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *tvItem)
{
if (tvItem->prevSibling)
{
* considering the tree hierarchy.
*/
static TREEVIEW_ITEM *
-TREEVIEW_GetNextListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem)
+TREEVIEW_GetNextListItem(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *tvItem)
{
assert(tvItem != NULL);
* forward if count is >0.
*/
static TREEVIEW_ITEM *
-TREEVIEW_GetListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
+TREEVIEW_GetListItem(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
LONG count)
{
- TREEVIEW_ITEM *(*next_item)(TREEVIEW_INFO *, TREEVIEW_ITEM *);
+ TREEVIEW_ITEM *(*next_item)(const TREEVIEW_INFO *, const TREEVIEW_ITEM *);
TREEVIEW_ITEM *previousItem;
assert(wineItem != NULL);
/* Notifications ************************************************************/
-static INT get_notifycode(TREEVIEW_INFO *infoPtr, INT code)
+static INT get_notifycode(const TREEVIEW_INFO *infoPtr, INT code)
{
if (!infoPtr->bNtfUnicode) {
switch (code) {
}
static LRESULT
-TREEVIEW_SendRealNotify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+TREEVIEW_SendRealNotify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
TRACE("wParam=%d, lParam=%ld\n", wParam, lParam);
return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, wParam, lParam);
}
static BOOL
-TREEVIEW_SendSimpleNotify(TREEVIEW_INFO *infoPtr, UINT code)
+TREEVIEW_SendSimpleNotify(const TREEVIEW_INFO *infoPtr, UINT code)
{
NMHDR nmhdr;
HWND hwnd = infoPtr->hwnd;
}
static VOID
-TREEVIEW_TVItemFromItem(TREEVIEW_INFO *infoPtr, UINT mask, TVITEMW *tvItem, TREEVIEW_ITEM *item)
+TREEVIEW_TVItemFromItem(const TREEVIEW_INFO *infoPtr, UINT mask, TVITEMW *tvItem, TREEVIEW_ITEM *item)
{
tvItem->mask = mask;
tvItem->hItem = item;
}
static BOOL
-TREEVIEW_SendTreeviewNotify(TREEVIEW_INFO *infoPtr, UINT code, UINT action,
+TREEVIEW_SendTreeviewNotify(const TREEVIEW_INFO *infoPtr, UINT code, UINT action,
UINT mask, HTREEITEM oldItem, HTREEITEM newItem)
{
HWND hwnd = infoPtr->hwnd;
}
static BOOL
-TREEVIEW_SendTreeviewDnDNotify(TREEVIEW_INFO *infoPtr, UINT code,
+TREEVIEW_SendTreeviewDnDNotify(const TREEVIEW_INFO *infoPtr, UINT code,
HTREEITEM dragItem, POINT pt)
{
HWND hwnd = infoPtr->hwnd;
static BOOL
-TREEVIEW_SendCustomDrawNotify(TREEVIEW_INFO *infoPtr, DWORD dwDrawStage,
+TREEVIEW_SendCustomDrawNotify(const TREEVIEW_INFO *infoPtr, DWORD dwDrawStage,
HDC hdc, RECT rc)
{
HWND hwnd = infoPtr->hwnd;
/* FIXME: need to find out when the flags in uItemState need to be set */
static BOOL
-TREEVIEW_SendCustomDrawItemNotify(TREEVIEW_INFO *infoPtr, HDC hdc,
+TREEVIEW_SendCustomDrawItemNotify(const TREEVIEW_INFO *infoPtr, HDC hdc,
TREEVIEW_ITEM *wineItem, UINT uItemDrawState,
NMTVCUSTOMDRAW *nmcdhdr)
{
}
static BOOL
-TREEVIEW_BeginLabelEditNotify(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editItem)
+TREEVIEW_BeginLabelEditNotify(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editItem)
{
HWND hwnd = infoPtr->hwnd;
NMTVDISPINFOW tvdi;
}
static void
-TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
+TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
UINT mask)
{
NMTVDISPINFOW callback;
* Just use wineItem->firstChild to check for physical children.
*/
static BOOL
-TREEVIEW_HasChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
+TREEVIEW_HasChildren(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
{
TREEVIEW_UpdateDispInfo(infoPtr, wineItem, TVIF_CHILDREN);
/* Compute linesOffset, stateOffset, imageOffset, textOffset of an item. */
static VOID
-TREEVIEW_ComputeItemInternalMetrics(TREEVIEW_INFO *infoPtr,
- TREEVIEW_ITEM *item)
+TREEVIEW_ComputeItemInternalMetrics(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
{
/* Same effect, different optimisation. */
#if 0
}
static VOID
-TREEVIEW_ComputeTextWidth(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, HDC hDC)
+TREEVIEW_ComputeTextWidth(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, HDC hDC)
{
HDC hdc;
HFONT hOldFont=0;
}
static VOID
-TREEVIEW_ComputeItemRect(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_ComputeItemRect(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
{
item->rect.top = infoPtr->uItemHeight *
(item->visibleOrder - infoPtr->firstVisible->visibleOrder);
* root must be expanded
*/
static VOID
-TREEVIEW_UpdateSubTree(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *root)
+TREEVIEW_UpdateSubTree(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *root)
{
TREEVIEW_ITEM *sibling;
HDC hdc;
/* Item Allocation **********************************************************/
static TREEVIEW_ITEM *
-TREEVIEW_AllocateItem(TREEVIEW_INFO *infoPtr)
+TREEVIEW_AllocateItem(const TREEVIEW_INFO *infoPtr)
{
TREEVIEW_ITEM *newItem = Alloc(sizeof(TREEVIEW_ITEM));
}
static BOOL
-TREEVIEW_DoSetItemT(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
+TREEVIEW_DoSetItemT(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
const TVITEMEXW *tvItem, BOOL isW)
{
UINT callbackClear = 0;
TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem);
static void
-TREEVIEW_RemoveAllChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *parentItem)
+TREEVIEW_RemoveAllChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *parentItem)
{
TREEVIEW_ITEM *kill = parentItem->firstChild;
}
static void
-TREEVIEW_UnlinkItem(TREEVIEW_ITEM *item)
+TREEVIEW_UnlinkItem(const TREEVIEW_ITEM *item)
{
TREEVIEW_ITEM *parentItem = item->parent;
}
static LRESULT
-TREEVIEW_GetIndent(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetIndent(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return infoPtr->uIndent;
static LRESULT
-TREEVIEW_GetToolTips(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetToolTips(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return (LRESULT)infoPtr->hwndToolTip;
}
static LRESULT
-TREEVIEW_GetUnicodeFormat(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetUnicodeFormat(const TREEVIEW_INFO *infoPtr)
{
return infoPtr->bNtfUnicode;
}
static LRESULT
-TREEVIEW_GetScrollTime(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetScrollTime(const TREEVIEW_INFO *infoPtr)
{
return infoPtr->uScrollTime;
}
static LRESULT
-TREEVIEW_GetImageList(TREEVIEW_INFO *infoPtr, WPARAM wParam)
+TREEVIEW_GetImageList(const TREEVIEW_INFO *infoPtr, WPARAM wParam)
{
TRACE("\n");
/* Compute the natural height for items. */
static UINT
-TREEVIEW_NaturalHeight(TREEVIEW_INFO *infoPtr)
+TREEVIEW_NaturalHeight(const TREEVIEW_INFO *infoPtr)
{
TEXTMETRICW tm;
HDC hdc = GetDC(0);
}
static LRESULT
-TREEVIEW_GetItemHeight(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetItemHeight(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return infoPtr->uItemHeight;
static LRESULT
-TREEVIEW_GetFont(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetFont(const TREEVIEW_INFO *infoPtr)
{
TRACE("%p\n", infoPtr->hFont);
return (LRESULT)infoPtr->hFont;
static LRESULT
-TREEVIEW_GetLineColor(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetLineColor(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return (LRESULT)infoPtr->clrLine;
static LRESULT
-TREEVIEW_GetTextColor(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetTextColor(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return (LRESULT)infoPtr->clrText;
static LRESULT
-TREEVIEW_GetBkColor(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetBkColor(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return (LRESULT)infoPtr->clrBk;
static LRESULT
-TREEVIEW_GetInsertMarkColor(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetInsertMarkColor(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
return (LRESULT)infoPtr->clrInsertMark;
* input HTREEITEM and the output RECT.
*/
static LRESULT
-TREEVIEW_GetItemRect(TREEVIEW_INFO *infoPtr, BOOL fTextRect, LPRECT lpRect)
+TREEVIEW_GetItemRect(const TREEVIEW_INFO *infoPtr, BOOL fTextRect, LPRECT lpRect)
{
TREEVIEW_ITEM *wineItem;
const HTREEITEM *pItem = (HTREEITEM *)lpRect;
}
static inline LRESULT
-TREEVIEW_GetVisibleCount(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetVisibleCount(const TREEVIEW_INFO *infoPtr)
{
/* Suprise! This does not take integral height into account. */
return infoPtr->clientHeight / infoPtr->uItemHeight;
static LRESULT
-TREEVIEW_GetItemT(TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW)
+TREEVIEW_GetItemT(const TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW)
{
TREEVIEW_ITEM *wineItem;
/* Beware MSDN Library Visual Studio 6.0. It says -1 on failure, 0 on success,
* which is wrong. */
static LRESULT
-TREEVIEW_SetItemT(TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW)
+TREEVIEW_SetItemT(TREEVIEW_INFO *infoPtr, const TVITEMEXW *tvItem, BOOL isW)
{
TREEVIEW_ITEM *wineItem;
TREEVIEW_ITEM originalItem;
}
static LRESULT
-TREEVIEW_GetItemState(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem, UINT mask)
+TREEVIEW_GetItemState(const TREEVIEW_INFO *infoPtr, HTREEITEM wineItem, UINT mask)
{
TRACE("\n");
}
static LRESULT
-TREEVIEW_GetNextItem(TREEVIEW_INFO *infoPtr, UINT which, HTREEITEM wineItem)
+TREEVIEW_GetNextItem(const TREEVIEW_INFO *infoPtr, UINT which, HTREEITEM wineItem)
{
TREEVIEW_ITEM *retval;
static LRESULT
-TREEVIEW_GetCount(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetCount(const TREEVIEW_INFO *infoPtr)
{
TRACE(" %d\n", infoPtr->uNumItems);
return (LRESULT)infoPtr->uNumItems;
}
static VOID
-TREEVIEW_ToggleItemState(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_ToggleItemState(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
{
if (infoPtr->dwStyle & TVS_CHECKBOXES)
{
/* Draw the lines and expand button for an item. Also draws one section
* of the line from item's parent to item's parent's next sibling. */
static void
-TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
+TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITEM *item)
{
LONG centerx, centery;
BOOL lar = ((infoPtr->dwStyle
}
static void
-TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
+TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
{
INT cditem;
HFONT hOldFont;
/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */
static LRESULT
-TREEVIEW_EraseBackground(TREEVIEW_INFO *infoPtr, HDC hDC)
+TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC)
{
HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk);
RECT rect;
}
static void
-TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, RECT *rc)
+TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc)
{
HWND hwnd = infoPtr->hwnd;
RECT rect = *rc;
}
static void
-TREEVIEW_Invalidate(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_Invalidate(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
{
if (item != NULL)
InvalidateRect(infoPtr->hwnd, &item->rect, TRUE);
* Forward the DPA local callback to the treeview owner callback
*/
static INT WINAPI
-TREEVIEW_CallBackCompare(TREEVIEW_ITEM *first, TREEVIEW_ITEM *second, LPTVSORTCB pCallBackSort)
+TREEVIEW_CallBackCompare(const TREEVIEW_ITEM *first, const TREEVIEW_ITEM *second,
+ const TVSORTCB *pCallBackSort)
{
/* Forward the call to the client-defined callback */
return pCallBackSort->lpfnCompare(first->lParam,
*/
static INT WINAPI
TREEVIEW_SortOnName(TREEVIEW_ITEM *first, TREEVIEW_ITEM *second,
- TREEVIEW_INFO *infoPtr)
+ const TREEVIEW_INFO *infoPtr)
{
TREEVIEW_UpdateDispInfo(infoPtr, first, TVIF_TEXT);
TREEVIEW_UpdateDispInfo(infoPtr, second, TVIF_TEXT);
/* Returns the number of physical children belonging to item. */
static INT
-TREEVIEW_CountChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_CountChildren(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
{
INT cChildren = 0;
HTREEITEM hti;
/* Returns a DPA containing a pointer to each physical child of item in
* sibling order. If item has no children, an empty DPA is returned. */
static HDPA
-TREEVIEW_BuildChildDPA(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
+TREEVIEW_BuildChildDPA(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
{
HTREEITEM child = item->firstChild;
/* Expansion/Collapse ***************************************************/
static BOOL
-TREEVIEW_SendExpanding(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
+TREEVIEW_SendExpanding(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
UINT action)
{
return !TREEVIEW_SendTreeviewNotify(infoPtr, TVN_ITEMEXPANDINGW, action,
}
static VOID
-TREEVIEW_SendExpanded(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
+TREEVIEW_SendExpanded(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
UINT action)
{
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_ITEMEXPANDEDW, action,
/* Hit-Testing **********************************************************/
static TREEVIEW_ITEM *
-TREEVIEW_HitTestPoint(TREEVIEW_INFO *infoPtr, POINT pt)
+TREEVIEW_HitTestPoint(const TREEVIEW_INFO *infoPtr, POINT pt)
{
TREEVIEW_ITEM *wineItem;
LONG row;
}
static LRESULT
-TREEVIEW_HitTest(TREEVIEW_INFO *infoPtr, LPTVHITTESTINFO lpht)
+TREEVIEW_HitTest(const TREEVIEW_INFO *infoPtr, LPTVHITTESTINFO lpht)
{
TREEVIEW_ITEM *wineItem;
RECT rect;
/* Item Label Editing ***************************************************/
static LRESULT
-TREEVIEW_GetEditControl(TREEVIEW_INFO *infoPtr)
+TREEVIEW_GetEditControl(const TREEVIEW_INFO *infoPtr)
{
return (LRESULT)infoPtr->hwndEdit;
}
if (strcmpW(newText, editedItem->pszText) != 0)
{
- if (NULL == ReAlloc(editedItem->pszText, iLength + 1))
+ WCHAR *ptr = ReAlloc(editedItem->pszText, sizeof(WCHAR)*(iLength + 1));
+ if (ptr == NULL)
{
ERR("OutOfMemory, cannot allocate space for label\n");
DestroyWindow(infoPtr->hwndEdit);
}
else
{
+ editedItem->pszText = ptr;
editedItem->cchTextMax = iLength + 1;
strcpyW(editedItem->pszText, newText);
+ TREEVIEW_ComputeTextWidth(infoPtr, editedItem, 0);
}
}
if(newText != tmpText) Free(newText);
* Windows.
*/
static LRESULT
-TREEVIEW_TrackMouse(TREEVIEW_INFO *infoPtr, POINT pt)
+TREEVIEW_TrackMouse(const TREEVIEW_INFO *infoPtr, POINT pt)
{
INT cxDrag = GetSystemMetrics(SM_CXDRAG);
INT cyDrag = GetSystemMetrics(SM_CYDRAG);
}
static LRESULT
-TREEVIEW_RButtonUp(TREEVIEW_INFO *infoPtr, LPPOINT pPt)
+TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt)
{
return 0;
}
/* Create/Destroy *******************************************************/
+static void
+initialize_checkboxes(TREEVIEW_INFO *infoPtr)
+{
+ RECT rc;
+ HBITMAP hbm, hbmOld;
+ HDC hdc, hdcScreen;
+ int nIndex;
+
+ infoPtr->himlState = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 3, 0);
+
+ hdcScreen = GetDC(0);
+
+ hdc = CreateCompatibleDC(hdcScreen);
+ hbm = CreateCompatibleBitmap(hdcScreen, 48, 16);
+ hbmOld = SelectObject(hdc, hbm);
+
+ SetRect(&rc, 0, 0, 48, 16);
+ FillRect(hdc, &rc, (HBRUSH)(COLOR_WINDOW+1));
+
+ SetRect(&rc, 18, 2, 30, 14);
+ DrawFrameControl(hdc, &rc, DFC_BUTTON,
+ DFCS_BUTTONCHECK|DFCS_FLAT);
+
+ SetRect(&rc, 34, 2, 46, 14);
+ DrawFrameControl(hdc, &rc, DFC_BUTTON,
+ DFCS_BUTTONCHECK|DFCS_FLAT|DFCS_CHECKED);
+
+ SelectObject(hdc, hbmOld);
+ nIndex = ImageList_AddMasked(infoPtr->himlState, hbm,
+ GetSysColor(COLOR_WINDOW));
+ TRACE("checkbox index %d\n", nIndex);
+
+ DeleteObject(hbm);
+ DeleteDC(hdc);
+ ReleaseDC(0, hdcScreen);
+
+ infoPtr->stateImageWidth = 16;
+ infoPtr->stateImageHeight = 16;
+}
+
static LRESULT
TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
{
infoPtr->hwndToolTip = COMCTL32_CreateToolTip(hwnd);
if (infoPtr->dwStyle & TVS_CHECKBOXES)
- {
- RECT rc;
- HBITMAP hbm, hbmOld;
- HDC hdc,hdcScreen;
- int nIndex;
-
- infoPtr->himlState =
- ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 3, 0);
-
- hdcScreen = GetDC(0);
-
- /* Create a coloured bitmap compatible with the screen depth
- because checkboxes are not black&white */
- hdc = CreateCompatibleDC(hdcScreen);
- hbm = CreateCompatibleBitmap(hdcScreen, 48, 16);
- hbmOld = SelectObject(hdc, hbm);
-
- rc.left = 0; rc.top = 0;
- rc.right = 48; rc.bottom = 16;
- FillRect(hdc, &rc, (HBRUSH)(COLOR_WINDOW+1));
-
- rc.left = 18; rc.top = 2;
- rc.right = 30; rc.bottom = 14;
- DrawFrameControl(hdc, &rc, DFC_BUTTON,
- DFCS_BUTTONCHECK|DFCS_FLAT);
-
- rc.left = 34; rc.right = 46;
- DrawFrameControl(hdc, &rc, DFC_BUTTON,
- DFCS_BUTTONCHECK|DFCS_FLAT|DFCS_CHECKED);
-
- SelectObject(hdc, hbmOld);
- nIndex = ImageList_AddMasked(infoPtr->himlState, hbm,
- GetSysColor(COLOR_WINDOW));
- TRACE("checkbox index %d\n", nIndex);
-
- DeleteObject(hbm);
- DeleteDC(hdc);
- ReleaseDC(0, hdcScreen);
-
- infoPtr->stateImageWidth = 16;
- infoPtr->stateImageHeight = 16;
- }
+ initialize_checkboxes(infoPtr);
/* Make sure actual scrollbar state is consistent with uInternalStatus */
ShowScrollBar(hwnd, SB_VERT, FALSE);
}
/* Draw themed border */
-static BOOL nc_paint (TREEVIEW_INFO *infoPtr, HRGN region)
+static BOOL nc_paint (const TREEVIEW_INFO *infoPtr, HRGN region)
{
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
HDC dc;
}
static LRESULT
-TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+TREEVIEW_Notify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
LPNMHDR lpnmh = (LPNMHDR)lParam;
if (wParam == GWL_STYLE)
{
- DWORD dwNewStyle = ((LPSTYLESTRUCT)lParam)->styleNew;
+ DWORD dwNewStyle = ((LPSTYLESTRUCT)lParam)->styleNew;
- /* we have to take special care about tooltips */
- if ((infoPtr->dwStyle ^ dwNewStyle) & TVS_NOTOOLTIPS)
- {
- if (infoPtr->dwStyle & TVS_NOTOOLTIPS)
- {
- infoPtr->hwndToolTip = COMCTL32_CreateToolTip(infoPtr->hwnd);
- TRACE("\n");
- }
- else
- {
- DestroyWindow(infoPtr->hwndToolTip);
- infoPtr->hwndToolTip = 0;
- }
- }
+ if ((infoPtr->dwStyle ^ dwNewStyle) & TVS_CHECKBOXES)
+ {
+ if (dwNewStyle & TVS_CHECKBOXES)
+ {
+ initialize_checkboxes(infoPtr);
+ TRACE("checkboxes enabled\n");
+ }
+ else
+ {
+ FIXME("tried to disable checkboxes\n");
+ }
+ }
+
+ if ((infoPtr->dwStyle ^ dwNewStyle) & TVS_NOTOOLTIPS)
+ {
+ if (infoPtr->dwStyle & TVS_NOTOOLTIPS)
+ {
+ infoPtr->hwndToolTip = COMCTL32_CreateToolTip(infoPtr->hwnd);
+ TRACE("tooltips enabled\n");
+ }
+ else
+ {
+ DestroyWindow(infoPtr->hwndToolTip);
+ infoPtr->hwndToolTip = 0;
+ TRACE("tooltips disabled\n");
+ }
+ }
- infoPtr->dwStyle = dwNewStyle;
+ infoPtr->dwStyle = dwNewStyle;
}
TREEVIEW_UpdateSubTree(infoPtr, infoPtr->root);
}
static LRESULT
-TREEVIEW_SetCursor(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
+TREEVIEW_SetCursor(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
POINT pt;
TREEVIEW_ITEM * item;
}
static LRESULT
-TREEVIEW_KillFocus(TREEVIEW_INFO *infoPtr)
+TREEVIEW_KillFocus(const TREEVIEW_INFO *infoPtr)
{
TRACE("\n");
}
/* update theme after a WM_THEMECHANGED message */
-static LRESULT theme_changed (TREEVIEW_INFO* infoPtr)
+static LRESULT theme_changed(const TREEVIEW_INFO *infoPtr)
{
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
CloseThemeData (theme);
* UPDOWN_IsBuddyEdit
* Tests if our buddy is an edit control.
*/
-static inline BOOL UPDOWN_IsBuddyEdit(UPDOWN_INFO *infoPtr)
+static inline BOOL UPDOWN_IsBuddyEdit(const UPDOWN_INFO *infoPtr)
{
return infoPtr->BuddyType == BUDDY_TYPE_EDIT;
}
* UPDOWN_IsBuddyListbox
* Tests if our buddy is a listbox control.
*/
-static inline BOOL UPDOWN_IsBuddyListbox(UPDOWN_INFO *infoPtr)
+static inline BOOL UPDOWN_IsBuddyListbox(const UPDOWN_INFO *infoPtr)
{
return infoPtr->BuddyType == BUDDY_TYPE_LISTBOX;
}
* UPDOWN_InBounds
* Tests if a given value 'val' is between the Min&Max limits
*/
-static BOOL UPDOWN_InBounds(UPDOWN_INFO *infoPtr, int val)
+static BOOL UPDOWN_InBounds(const UPDOWN_INFO *infoPtr, int val)
{
if(infoPtr->MaxVal > infoPtr->MinVal)
return (infoPtr->MinVal <= val) && (val <= infoPtr->MaxVal);
* When we have a buddy set and that we are aligned on our buddy, we
* want to draw a sunken edge to make like we are part of that control.
*/
-static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr)
+static BOOL UPDOWN_HasBuddyBorder(const UPDOWN_INFO *infoPtr)
{
return ( ((infoPtr->dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) &&
UPDOWN_IsBuddyEdit(infoPtr) );
* FLAG_DECR to get the "decrement" rect (down or left)
* If both flags are pressent, the envelope is returned.
*/
-static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
+static void UPDOWN_GetArrowRect (const UPDOWN_INFO* infoPtr, RECT *rect, int arrow)
{
HTHEME theme = GetWindowTheme (infoPtr->Self);
const int border = theme ? DEFAULT_BUDDYBORDER_THEMED : DEFAULT_BUDDYBORDER;
* If it returns the up rect, it returns FLAG_INCR.
* If it returns the down rect, it returns FLAG_DECR.
*/
-static INT UPDOWN_GetArrowFromPoint (UPDOWN_INFO* infoPtr, RECT *rect, POINT pt)
+static INT UPDOWN_GetArrowFromPoint (const UPDOWN_INFO *infoPtr, RECT *rect, POINT pt)
{
UPDOWN_GetArrowRect (infoPtr, rect, FLAG_INCR);
if(PtInRect(rect, pt)) return FLAG_INCR;
* TRUE - if it set the caption of the buddy successfully
* FALSE - if an error occurred
*/
-static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr)
+static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
{
WCHAR fmt[3] = { '%', 'd', '\0' };
WCHAR txt[20];
*
* Draw buddy background for visual integration.
*/
-static BOOL UPDOWN_DrawBuddyBackground (UPDOWN_INFO *infoPtr, HDC hdc)
+static BOOL UPDOWN_DrawBuddyBackground (const UPDOWN_INFO *infoPtr, HDC hdc)
{
RECT br;
HTHEME buddyTheme = GetWindowTheme (infoPtr->Buddy);
*
* Draw the arrows. The background need not be erased.
*/
-static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc)
+static LRESULT UPDOWN_Draw (const UPDOWN_INFO *infoPtr, HDC hdc)
{
BOOL uPressed, uHot, dPressed, dHot;
RECT rect;
* Asynchronous drawing (must ONLY be used in WM_PAINT).
* Calls UPDOWN_Draw.
*/
-static LRESULT UPDOWN_Paint (UPDOWN_INFO *infoPtr, HDC hdc)
+static LRESULT UPDOWN_Paint (const UPDOWN_INFO *infoPtr, HDC hdc)
{
PAINTSTRUCT ps;
if (hdc) return UPDOWN_Draw (infoPtr, hdc);
* Returns TRUE if it is enabled as well as its buddy (if any)
* FALSE otherwise
*/
-static BOOL UPDOWN_IsEnabled (UPDOWN_INFO *infoPtr)
+static BOOL UPDOWN_IsEnabled (const UPDOWN_INFO *infoPtr)
{
if (!IsWindowEnabled(infoPtr->Self))
return FALSE;