comctl32: Constify some variables.

This commit is contained in:
Andrew Talbot 2007-04-02 17:50:24 +01:00 committed by Alexandre Julliard
parent 51ee497174
commit 58ec988800
1 changed files with 29 additions and 30 deletions

View File

@ -103,14 +103,14 @@ typedef struct
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;
@ -127,14 +127,14 @@ static LRESULT notify_hdr(TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
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;
@ -179,8 +179,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
(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;
@ -207,7 +206,7 @@ TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
/* 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;
@ -334,7 +333,7 @@ TRACKBAR_CalcChannel (TRACKBAR_INFO *infoPtr)
}
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);
@ -381,13 +380,13 @@ TRACKBAR_UpdateThumb (TRACKBAR_INFO *infoPtr)
}
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;
@ -397,7 +396,7 @@ TRACKBAR_InvalidateThumb (TRACKBAR_INFO *infoPtr, LONG thumbPos)
}
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)
@ -405,7 +404,7 @@ TRACKBAR_InvalidateThumbMove (TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
}
static inline BOOL
TRACKBAR_HasSelection (TRACKBAR_INFO *infoPtr)
TRACKBAR_HasSelection (const TRACKBAR_INFO *infoPtr)
{
return infoPtr->lSelMin != infoPtr->lSelMax;
}
@ -468,7 +467,7 @@ TRACKBAR_AutoPage (TRACKBAR_INFO *infoPtr, POINT clickPoint)
/* 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);
@ -491,7 +490,7 @@ TRACKBAR_DrawChannel (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
}
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;
@ -566,7 +565,7 @@ TRACKBAR_DrawOneTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
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);
@ -576,7 +575,7 @@ TRACKBAR_DrawTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
}
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;
@ -615,7 +614,7 @@ TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
}
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;
@ -758,7 +757,7 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle)
static inline void
TRACKBAR_ActivateToolTip (TRACKBAR_INFO *infoPtr, BOOL fShow)
TRACKBAR_ActivateToolTip (const TRACKBAR_INFO *infoPtr, BOOL fShow)
{
TTTOOLINFOW ti;
@ -773,7 +772,7 @@ TRACKBAR_ActivateToolTip (TRACKBAR_INFO *infoPtr, BOOL fShow)
static void
TRACKBAR_UpdateToolTip (TRACKBAR_INFO *infoPtr)
TRACKBAR_UpdateToolTip (const TRACKBAR_INFO *infoPtr)
{
DWORD dwStyle = GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE);
WCHAR buf[80];
@ -942,7 +941,7 @@ cleanup:
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);
@ -1023,7 +1022,7 @@ TRACKBAR_ClearTics (TRACKBAR_INFO *infoPtr, BOOL fRedraw)
static inline LRESULT
TRACKBAR_GetChannelRect (TRACKBAR_INFO *infoPtr, LPRECT lprc)
TRACKBAR_GetChannelRect (const TRACKBAR_INFO *infoPtr, LPRECT lprc)
{
if (lprc == NULL) return 0;
@ -1037,7 +1036,7 @@ TRACKBAR_GetChannelRect (TRACKBAR_INFO *infoPtr, LPRECT lprc)
static inline LONG
TRACKBAR_GetNumTics (TRACKBAR_INFO *infoPtr)
TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
{
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_NOTICKS)
return 0;
@ -1049,7 +1048,7 @@ TRACKBAR_GetNumTics (TRACKBAR_INFO *infoPtr)
}
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;
@ -1062,7 +1061,7 @@ static int comp_tics(const void *ap, const void *bp)
static inline LONG
TRACKBAR_GetTic (TRACKBAR_INFO *infoPtr, INT iTic)
TRACKBAR_GetTic (const TRACKBAR_INFO *infoPtr, INT iTic)
{
if ((iTic < 0) || (iTic >= infoPtr->uNumTics) || !infoPtr->tics)
return -1;
@ -1073,7 +1072,7 @@ TRACKBAR_GetTic (TRACKBAR_INFO *infoPtr, INT iTic)
static inline LONG
TRACKBAR_GetTicPos (TRACKBAR_INFO *infoPtr, INT iTic)
TRACKBAR_GetTicPos (const TRACKBAR_INFO *infoPtr, INT iTic)
{
LONG range, width, pos, tic;
int offsetthumb;
@ -1393,7 +1392,7 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr)
static LRESULT
TRACKBAR_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
TRACKBAR_INFO *infoPtr;
DWORD dwStyle;
@ -1525,7 +1524,7 @@ TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr, DWORD fwKeys, INT x, INT y)
static LRESULT
TRACKBAR_CaptureChanged (TRACKBAR_INFO *infoPtr)
TRACKBAR_CaptureChanged (const TRACKBAR_INFO *infoPtr)
{
notify_with_scroll (infoPtr, TB_ENDTRACK);
return 0;
@ -1570,7 +1569,7 @@ TRACKBAR_Size (TRACKBAR_INFO *infoPtr, DWORD fwSizeType, INT nWidth, INT nHeight
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;
@ -1583,7 +1582,7 @@ TRACKBAR_Timer (TRACKBAR_INFO *infoPtr, INT wTimerID, TIMERPROC *tmrpc)
/* 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);
@ -1713,7 +1712,7 @@ TRACKBAR_KeyDown (TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
static inline BOOL
TRACKBAR_KeyUp (TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
TRACKBAR_KeyUp (const TRACKBAR_INFO *infoPtr, INT nVirtKey, DWORD lKeyData)
{
switch (nVirtKey) {
case VK_LEFT: