- Complete support for rgb{Fg,Bk} in DrawIndirect.
- Rename VOID to void.
- Documentation cleanup.
- Fix ILD_TRANSPARENT handling.
diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index b1acd6f..4b5fa39 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -21,22 +21,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* TODO:
- * - Fix ImageList_DrawIndirect (rgbFg, rgbBk, dwRop).
- * - Fix ImageList_SetFilter (undocumented).
- * BTW does anybody know anything about this function???
- * - It removes 12 Bytes from the stack (3 Parameters).
- * - First parameter SHOULD be a HIMAGELIST.
- * - Second parameter COULD be an index?????
- * - Third parameter.... ?????????????????????
+ * - Fix ImageList_DrawIndirect (dwRop).
* - Add support for ILD_PRESERVEALPHA, ILD_SCALE, ILD_DPISCALE
* - Add support for ILS_GLOW, ILS_SHADOW, ILS_SATURATE, ILS_ALPHA
*
* Comments:
- * - ImageList_Draw, ImageList_DrawEx and ImageList_GetIcon use
- * ImageList_DrawIndirect. Since ImageList_DrawIndirect is still
- * partially implemented, the functions mentioned above will be
- * limited in functionality too.
- *
* - Hotspot handling still not correct. The Hotspot passed to BeginDrag
* is the offset of the image position relative to the actual mouse pointer
* position. However the Hotspot passed to SetDragCursorImage is the
@@ -95,7 +84,7 @@
* NOTES
* This function can NOT be used to reduce the number of images.
*/
-static VOID
+static void
IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT cy)
{
HDC hdcImageList, hdcBitmap;
@@ -168,7 +157,7 @@
*
* Blending and Overlays styles are accomplished by another function
*/
-static VOID
+static void
IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
{
HDC hImageDC;
@@ -206,12 +195,13 @@
*
* Blending and Overlays styles are accomplished by another function.
*/
-static VOID
+static void
IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
{
HBITMAP hOldBitmapImage, hOldBitmapMask;
HIMAGELIST himlLocal = pimldp->himl;
UINT fStyle = pimldp->fStyle & (~ILD_OVERLAYMASK);
+ COLORREF clrBk = (pimldp->rgbBk == CLR_DEFAULT) ? himlLocal->clrBk : pimldp->rgbBk;
/*
* We need a dc and bitmap to draw on that is
@@ -220,7 +210,8 @@
HDC hOffScreenDC = CreateCompatibleDC( pimldp->hdcDst );
HBITMAP hOffScreenBmp = CreateCompatibleBitmap( pimldp->hdcDst, cx, cy );
- BOOL bUseCustomBackground = (himlLocal->clrBk != CLR_NONE);
+ BOOL bUseCustomBackground = (clrBk != CLR_NONE) &&
+ !((fStyle & ILD_TRANSPARENT) && himlLocal->hbmMask);
BOOL bBlendFlag = (fStyle & ILD_BLEND50 ) || (fStyle & ILD_BLEND25);
HDC hImageDC = CreateCompatibleDC(0);
@@ -249,7 +240,7 @@
|| bBlendFlag) )
{
- HBRUSH hBrush = CreateSolidBrush (himlLocal->clrBk);
+ HBRUSH hBrush = CreateSolidBrush (clrBk);
HBRUSH hOldBrush = SelectObject (pimldp->hdcDst, hBrush);
PatBlt( hOffScreenDC, pimldp->x, pimldp->y, cx, cy, PATCOPY );
@@ -319,8 +310,6 @@
DeleteDC( hOffScreenDC );
DeleteObject( hOffScreenBmp );
-
- return;
}
/*************************************************************************
@@ -341,7 +330,7 @@
* required to add the blend to the current image.
*
*/
-static VOID
+static void
IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
{
@@ -351,11 +340,10 @@
COLORREF clrBlend, oldFgColor, oldBkColor;
HIMAGELIST himlLocal = pimldp->himl;
- clrBlend = GetSysColor (COLOR_HIGHLIGHT);
- if (!(pimldp->rgbFg == CLR_DEFAULT))
- {
- clrBlend = pimldp->rgbFg;
- }
+ clrBlend = pimldp->rgbFg;
+ if (clrBlend == CLR_DEFAULT) clrBlend = GetSysColor (COLOR_HIGHLIGHT);
+ else if (clrBlend == CLR_NONE) clrBlend = GetTextColor (pimldp->hdcDst);
+
/* Create the blend Mask
*/
hBlendMaskDC = CreateCompatibleDC(0);
@@ -430,7 +418,7 @@
*
*
*/
-static VOID
+static void
IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
{
INT nOvlIdx;
@@ -2661,10 +2649,11 @@
* ImageList_SetFilter [COMCTL32.@]
*
* Sets a filter (or does something completely different)!!???
+ * It removes 12 Bytes from the stack (3 Parameters).
*
* PARAMS
- * himl [I] handle to image list
- * i [I] ???
+ * himl [I] SHOULD be a handle to image list
+ * i [I] COULD be an index?
* dwFilter [I] ???
*
* RETURNS
@@ -2679,8 +2668,7 @@
BOOL WINAPI
ImageList_SetFilter (HIMAGELIST himl, INT i, DWORD dwFilter)
{
- FIXME("(%p 0x%x 0x%lx):empty stub!\n",
- himl, i, dwFilter);
+ FIXME("(%p 0x%x 0x%lx):empty stub!\n", himl, i, dwFilter);
return FALSE;
}