Commit abf4d3b8 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

comctl32: Constify some variables.

parent 9a76763c
...@@ -740,8 +740,8 @@ HEADER_DrawTrackLine (HWND hwnd, HDC hdc, INT x) ...@@ -740,8 +740,8 @@ HEADER_DrawTrackLine (HWND hwnd, HDC hdc, INT x)
* *
* NOTE: We depend on HDITEMA and HDITEMW having the same structure * NOTE: We depend on HDITEMA and HDITEMW having the same structure
*/ */
static void HEADER_CopyHDItemForNotify(HEADER_INFO *infoPtr, HDITEMW *dest, static void HEADER_CopyHDItemForNotify(const HEADER_INFO *infoPtr, HDITEMW *dest,
HDITEMW *src, BOOL fSourceUnicode, LPVOID *ppvScratch) const HDITEMW *src, BOOL fSourceUnicode, LPVOID *ppvScratch)
{ {
*ppvScratch = NULL; *ppvScratch = NULL;
*dest = *src; *dest = *src;
...@@ -1394,7 +1394,7 @@ HEADER_SetBitmapMargin(HWND hwnd, WPARAM wParam) ...@@ -1394,7 +1394,7 @@ HEADER_SetBitmapMargin(HWND hwnd, WPARAM wParam)
} }
static LRESULT 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_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem; HEADER_ITEM *lpItem;
......
...@@ -93,7 +93,7 @@ typedef struct ...@@ -93,7 +93,7 @@ typedef struct
#define REPEAT_DELAY 50 #define REPEAT_DELAY 50
static void 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; RECT rcWindow;
GetWindowRect (infoPtr->hwndSelf, &rcWindow); GetWindowRect (infoPtr->hwndSelf, &rcWindow);
...@@ -299,7 +299,7 @@ PAGER_ForwardMouse (PAGER_INFO* infoPtr, BOOL bFwd) ...@@ -299,7 +299,7 @@ PAGER_ForwardMouse (PAGER_INFO* infoPtr, BOOL bFwd)
} }
static inline LRESULT static inline LRESULT
PAGER_GetButtonState (PAGER_INFO* infoPtr, INT btn) PAGER_GetButtonState (const PAGER_INFO* infoPtr, INT btn)
{ {
LRESULT btnState = PGF_INVISIBLE; LRESULT btnState = PGF_INVISIBLE;
TRACE("[%p]\n", infoPtr->hwndSelf); TRACE("[%p]\n", infoPtr->hwndSelf);
...@@ -314,35 +314,35 @@ PAGER_GetButtonState (PAGER_INFO* infoPtr, INT btn) ...@@ -314,35 +314,35 @@ PAGER_GetButtonState (PAGER_INFO* infoPtr, INT btn)
static inline INT static inline INT
PAGER_GetPos(PAGER_INFO *infoPtr) PAGER_GetPos(const PAGER_INFO *infoPtr)
{ {
TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nPos); TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nPos);
return infoPtr->nPos; return infoPtr->nPos;
} }
static inline INT static inline INT
PAGER_GetButtonSize(PAGER_INFO *infoPtr) PAGER_GetButtonSize(const PAGER_INFO *infoPtr)
{ {
TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nButtonSize); TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nButtonSize);
return infoPtr->nButtonSize; return infoPtr->nButtonSize;
} }
static inline INT static inline INT
PAGER_GetBorder(PAGER_INFO *infoPtr) PAGER_GetBorder(const PAGER_INFO *infoPtr)
{ {
TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nBorder); TRACE("[%p] returns %d\n", infoPtr->hwndSelf, infoPtr->nBorder);
return infoPtr->nBorder; return infoPtr->nBorder;
} }
static inline COLORREF static inline COLORREF
PAGER_GetBkColor(PAGER_INFO *infoPtr) PAGER_GetBkColor(const PAGER_INFO *infoPtr)
{ {
TRACE("[%p] returns %06x\n", infoPtr->hwndSelf, infoPtr->clrBk); TRACE("[%p] returns %06x\n", infoPtr->hwndSelf, infoPtr->clrBk);
return infoPtr->clrBk; return infoPtr->clrBk;
} }
static void static void
PAGER_CalcSize (PAGER_INFO *infoPtr, INT* size, BOOL getWidth) PAGER_CalcSize (const PAGER_INFO *infoPtr, INT* size, BOOL getWidth)
{ {
NMPGCALCSIZE nmpgcs; NMPGCALCSIZE nmpgcs;
ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE)); ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
...@@ -783,7 +783,7 @@ PAGER_Scroll(PAGER_INFO* infoPtr, INT dir) ...@@ -783,7 +783,7 @@ PAGER_Scroll(PAGER_INFO* infoPtr, INT dir)
} }
static LRESULT static LRESULT
PAGER_FmtLines(PAGER_INFO *infoPtr) PAGER_FmtLines(const PAGER_INFO *infoPtr)
{ {
/* initiate NCCalcSize to resize client wnd and get size */ /* initiate NCCalcSize to resize client wnd and get size */
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0, SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
...@@ -798,7 +798,7 @@ PAGER_FmtLines(PAGER_INFO *infoPtr) ...@@ -798,7 +798,7 @@ PAGER_FmtLines(PAGER_INFO *infoPtr)
} }
static LRESULT static LRESULT
PAGER_Create (HWND hwnd, LPCREATESTRUCTW lpcs) PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
PAGER_INFO *infoPtr; PAGER_INFO *infoPtr;
...@@ -898,7 +898,7 @@ PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect) ...@@ -898,7 +898,7 @@ PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect)
} }
static LRESULT static LRESULT
PAGER_NCPaint (PAGER_INFO* infoPtr, HRGN hRgn) PAGER_NCPaint (const PAGER_INFO* infoPtr, HRGN hRgn)
{ {
RECT rcBottomRight, rcTopLeft; RECT rcBottomRight, rcTopLeft;
HDC hdc; HDC hdc;
...@@ -923,7 +923,7 @@ PAGER_NCPaint (PAGER_INFO* infoPtr, HRGN hRgn) ...@@ -923,7 +923,7 @@ PAGER_NCPaint (PAGER_INFO* infoPtr, HRGN hRgn)
} }
static INT static INT
PAGER_HitTest (PAGER_INFO* infoPtr, const POINT * pt) PAGER_HitTest (const PAGER_INFO* infoPtr, const POINT * pt)
{ {
RECT clientRect, rcTopLeft, rcBottomRight; RECT clientRect, rcTopLeft, rcBottomRight;
POINT ptWindow; POINT ptWindow;
...@@ -955,7 +955,7 @@ PAGER_HitTest (PAGER_INFO* infoPtr, const POINT * pt) ...@@ -955,7 +955,7 @@ PAGER_HitTest (PAGER_INFO* infoPtr, const POINT * pt)
} }
static LRESULT static LRESULT
PAGER_NCHitTest (PAGER_INFO* infoPtr, INT x, INT y) PAGER_NCHitTest (const PAGER_INFO* infoPtr, INT x, INT y)
{ {
POINT pt; POINT pt;
INT nHit; INT nHit;
...@@ -1203,7 +1203,7 @@ PAGER_Timer (PAGER_INFO* infoPtr, INT nTimerId) ...@@ -1203,7 +1203,7 @@ PAGER_Timer (PAGER_INFO* infoPtr, INT nTimerId)
} }
static LRESULT static LRESULT
PAGER_EraseBackground (PAGER_INFO* infoPtr, HDC hdc) PAGER_EraseBackground (const PAGER_INFO* infoPtr, HDC hdc)
{ {
POINT pt, ptorig; POINT pt, ptorig;
HWND parent; HWND parent;
...@@ -1237,7 +1237,7 @@ PAGER_Size (PAGER_INFO* infoPtr, INT type, INT x, INT y) ...@@ -1237,7 +1237,7 @@ PAGER_Size (PAGER_INFO* infoPtr, INT type, INT x, INT y)
static LRESULT 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; DWORD oldStyle = infoPtr->dwStyle;
......
...@@ -65,7 +65,7 @@ typedef struct ...@@ -65,7 +65,7 @@ typedef struct
#define ID_MARQUEE_TIMER 1 #define ID_MARQUEE_TIMER 1
/* Helper to obtain size of a progress bar chunk ("led"). */ /* 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 ) const RECT* rect )
{ {
HTHEME theme = GetWindowTheme (infoPtr->Self); HTHEME theme = GetWindowTheme (infoPtr->Self);
...@@ -83,7 +83,7 @@ static inline int get_led_size ( PROGRESS_INFO *infoPtr, LONG style, ...@@ -83,7 +83,7 @@ static inline int get_led_size ( PROGRESS_INFO *infoPtr, LONG style,
} }
/* Helper to obtain gap between progress bar chunks */ /* 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); HTHEME theme = GetWindowTheme (infoPtr->Self);
if (theme) if (theme)
...@@ -121,7 +121,7 @@ static inline int get_bar_size( LONG style, const RECT* rect ) ...@@ -121,7 +121,7 @@ static inline int get_bar_size( LONG style, const RECT* rect )
} }
/* Compute the pixel position of a progress value */ /* 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 ) const RECT* rect, INT value )
{ {
return MulDiv (value - infoPtr->MinVal, get_bar_size (style, rect), return MulDiv (value - infoPtr->MinVal, get_bar_size (style, rect),
...@@ -134,7 +134,7 @@ static inline int get_bar_position( PROGRESS_INFO *infoPtr, LONG style, ...@@ -134,7 +134,7 @@ static inline int get_bar_position( PROGRESS_INFO *infoPtr, LONG style,
* Don't be too clever about invalidating the progress bar. * Don't be too clever about invalidating the progress bar.
* InstallShield depends on this simple behaviour. * 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 ); InvalidateRect( infoPtr->Self, NULL, old > new );
} }
......
...@@ -167,7 +167,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, ...@@ -167,7 +167,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
int index, int index,
int skipdir, int skipdir,
HPROPSHEETPAGE hpage); 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 PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo* psInfo);
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID); static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID);
...@@ -252,7 +252,7 @@ static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg, ...@@ -252,7 +252,7 @@ static void PROPSHEET_GetPageRect(const PropSheetInfo * psInfo, HWND hwndDlg,
* *
* Find page index corresponding to page resource id. * 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; INT i;
...@@ -700,7 +700,7 @@ static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo) ...@@ -700,7 +700,7 @@ static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
* Verify that the tab control and the "largest" property sheet page dlg. template * Verify that the tab control and the "largest" property sheet page dlg. template
* match in size. * 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); HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
RECT rcOrigTab, rcPage; RECT rcOrigTab, rcPage;
...@@ -819,7 +819,7 @@ static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo) ...@@ -819,7 +819,7 @@ static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo)
* *
* Resizes the property sheet to fit the largest page. * 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); HWND hwndLine = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
RECT rc, lineRect, dialogRect; RECT rc, lineRect, dialogRect;
...@@ -856,7 +856,7 @@ static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo) ...@@ -856,7 +856,7 @@ static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo)
* *
* Adjusts the buttons' positions. * 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); HWND hwndButton = GetDlgItem(hwndParent, IDOK);
RECT rcSheet; RECT rcSheet;
...@@ -955,7 +955,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo) ...@@ -955,7 +955,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo)
* Adjusts the buttons' positions. * Adjusts the buttons' positions.
*/ */
static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent, static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
PropSheetInfo* psInfo) const PropSheetInfo* psInfo)
{ {
HWND hwndButton = GetDlgItem(hwndParent, IDCANCEL); HWND hwndButton = GetDlgItem(hwndParent, IDCANCEL);
HWND hwndLine = GetDlgItem(hwndParent, IDC_SUNKEN_LINE); HWND hwndLine = GetDlgItem(hwndParent, IDC_SUNKEN_LINE);
...@@ -1173,7 +1173,7 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheet ...@@ -1173,7 +1173,7 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheet
* Insert the tabs in the tab control. * Insert the tabs in the tab control.
*/ */
static BOOL PROPSHEET_CreateTabControl(HWND hwndParent, static BOOL PROPSHEET_CreateTabControl(HWND hwndParent,
PropSheetInfo * psInfo) const PropSheetInfo * psInfo)
{ {
HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL); HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
TCITEMW item; TCITEMW item;
...@@ -2667,7 +2667,7 @@ static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg) ...@@ -2667,7 +2667,7 @@ static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
* Given a HPROPSHEETPAGE, returns the index of the corresponding page from * Given a HPROPSHEETPAGE, returns the index of the corresponding page from
* the array of PropPageInfo. * the array of PropPageInfo.
*/ */
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, PropSheetInfo* psInfo) static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo)
{ {
BOOL found = FALSE; BOOL found = FALSE;
int index = 0; int index = 0;
...@@ -2743,7 +2743,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg) ...@@ -2743,7 +2743,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
GlobalFree((HGLOBAL)psInfo); GlobalFree((HGLOBAL)psInfo);
} }
static INT do_loop(PropSheetInfo *psInfo) static INT do_loop(const PropSheetInfo *psInfo)
{ {
MSG msg; MSG msg;
INT ret = -1; INT ret = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment