From 79c8048f83c6bbc15651086edbaff7bd7dbb776d Mon Sep 17 00:00:00 2001 From: VincentWei Date: Fri, 2 Feb 2018 15:30:26 +0800 Subject: [PATCH] use gal_pixel instead of int for GetWindowBkColor/SetWindowBkColor --- include/window.h | 13 +++++++++---- src/gui/window.c | 6 +++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/window.h b/include/window.h index 774c14f1..e143c69f 100644 --- a/include/window.h +++ b/include/window.h @@ -5369,7 +5369,7 @@ MG_EXPORT BOOL GUIAPI IsWindowEnabled (HWND hWnd); MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc); /** - * \fn int GUIAPI GetWindowBkColor (HWND hWnd) + * \fn gal_pixel GUIAPI GetWindowBkColor (HWND hWnd) * \brief Returns the current background color of a window. * * This function returns the pixel value of the current background color of @@ -5379,12 +5379,14 @@ MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc); * * \return The pixel value of the background color. * + * \note The type of return value changed from int to gal_pixel since v3.2. + * * \sa SetWindowBkColor */ -MG_EXPORT int GUIAPI GetWindowBkColor (HWND hWnd); +MG_EXPORT gal_pixel GUIAPI GetWindowBkColor (HWND hWnd); /** - * \fn int GUIAPI SetWindowBkColor (HWND hWnd, int new_bkcolor) + * \fn gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor) * \brief Sets the background color of a window. * * This function sets the background color of the specified window \a hWnd @@ -5396,9 +5398,12 @@ MG_EXPORT int GUIAPI GetWindowBkColor (HWND hWnd); * \param new_bkcolor The pixel value of the new background color. * \return The pixel value of the old background color. * + * \note The type of return value and \a new_bkcolor changed from int to + * gal_pixel since v3.2. + * * \sa GetWindowBkColor */ -MG_EXPORT int GUIAPI SetWindowBkColor (HWND hWnd, int new_bkcolor); +MG_EXPORT gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor); /** * \fn PLOGFONT GUIAPI GetWindowFont (HWND hWnd) diff --git a/src/gui/window.c b/src/gui/window.c index 3ab45114..b1045ea9 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -4196,7 +4196,7 @@ BOOL GUIAPI GetClientRect (HWND hWnd, PRECT prc) } /******************** main window and control styles support *****************/ -int GUIAPI GetWindowBkColor (HWND hWnd) +gal_pixel GUIAPI GetWindowBkColor (HWND hWnd) { PMAINWIN pWin = (PMAINWIN)hWnd; @@ -4205,9 +4205,9 @@ int GUIAPI GetWindowBkColor (HWND hWnd) return pWin->iBkColor; } -int GUIAPI SetWindowBkColor (HWND hWnd, int new_bkcolor) +gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor) { - int old_bkcolor; + gal_pixel old_bkcolor; PMAINWIN pWin; MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), PIXEL_invalid);