Ignore:
Timestamp:
Sep 15, 2001, 11:26:26 AM (24 years ago)
Author:
sandervl
Message:

restored old version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/imagelist.c

    r6705 r6709  
    2020 *    - ImageList_Draw, ImageList_DrawEx and ImageList_GetIcon use
    2121 *      ImageList_DrawIndirect. Since ImageList_DrawIndirect is still
    22  *      partially implemented, the functions mentioned above will be
     22 *      partially implemented, the functions mentioned above will be 
    2323 *      limited in functionality too.
    2424 */
     
    6969
    7070/*************************************************************************
    71  * IMAGELIST_InternalExpandBitmaps [Internal]
     71 * IMAGELIST_InternalExpandBitmaps [Internal] 
    7272 *
    7373 * Expands the bitmaps of an image list by the given number of images.
     
    9292    if ((himl->cCurImage + nImageCount < himl->cMaxImage)
    9393        && (himl->cy >= cy))
    94     return;
     94        return;
    9595
    9696    if (cy == 0) cy = himl->cy;
     
    116116
    117117    if (himl->hbmMask) {
    118         hbmNewBitmap =
     118        hbmNewBitmap = 
    119119            CreateBitmap (nNewWidth, cy, 1, 1, NULL);
    120120
     
    138138
    139139/*************************************************************************
    140  * IMAGELIST_InternalDraw [Internal]
     140 * IMAGELIST_InternalDraw [Internal] 
    141141 *
    142142 * Draws the image in the ImageList (without the mask)
     
    151151 *
    152152 * NOTES
    153  *     This function is used by ImageList_DrawIndirect, when it is
     153 *     This function is used by ImageList_DrawIndirect, when it is 
    154154 *     required to draw only the Image (without the mask) to the screen.
    155155 *
     
    164164    hImageDC = CreateCompatibleDC(0);
    165165    hOldBitmap = SelectObject(hImageDC, pimldp->himl->hbmImage);
    166     BitBlt(pimldp->hdcDst,
     166    BitBlt(pimldp->hdcDst, 
    167167        pimldp->x, pimldp->y, cx, cy,
    168         hImageDC,
    169         pimldp->himl->cx * pimldp->i, 0,
     168        hImageDC, 
     169        pimldp->himl->cx * pimldp->i, 0, 
    170170        SRCCOPY);
    171171
     
    176176
    177177/*************************************************************************
    178  * IMAGELIST_InternalDrawMask [Internal]
     178 * IMAGELIST_InternalDrawMask [Internal] 
    179179 *
    180180 * Draws the image in the ImageList with the mask
     
    189189 *
    190190 * NOTES
    191  *     This function is used by ImageList_DrawIndirect, when it is
     191 *     This function is used by ImageList_DrawIndirect, when it is 
    192192 *     required to draw the Image with the mask to the screen.
    193193 *
     
    205205    UINT fStyle = pimldp->fStyle & (~ILD_OVERLAYMASK);
    206206
    207     /*
    208      * We need a dc and bitmap to draw on that is
     207    /* 
     208     * We need a dc and bitmap to draw on that is 
    209209     * not on the screen.
    210210     */
     
    221221    hOffScreenDC = CreateCompatibleDC( pimldp->hdcDst );
    222222
    223     if ( hOffScreenDC )
     223    if ( hOffScreenDC ) 
    224224    {
    225225        hOffScreenBmp = CreateCompatibleBitmap( pimldp->hdcDst, cx, cy );
    226226
    227         if ( hOffScreenBmp )
     227        if ( hOffScreenBmp ) 
    228228            SelectObject( hOffScreenDC, hOffScreenBmp  );
    229229        else
     
    235235    hOldBitmapImage = SelectObject(hImageDC, himlLocal->hbmImage);
    236236    hOldBitmapMask = SelectObject(hMaskDC, himlLocal->hbmMask);
    237 
    238     /*
    239      * Get a copy of the image for the masking operations.
     237   
     238    /* 
     239     * Get a copy of the image for the masking operations. 
    240240     * We will use the copy, and this dc for all the various
    241241     * blitting, and then do one final blit to the screen dc.
    242242     * This should clean up most of the flickering.
    243243     */
    244     BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x,
     244    BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x, 
    245245            pimldp->y, SRCCOPY);
    246246
    247     /*
     247    /* 
    248248     * Draw the Background for the appropriate Styles
    249249     */
    250     if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE
     250    if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE 
    251251         || bBlendFlag) )
    252252    {
    253 
     253       
    254254        hBrush = CreateSolidBrush (himlLocal->clrBk);
    255255        hOldBrush = SelectObject (pimldp->hdcDst, hBrush);
    256 
     256       
    257257        PatBlt( hOffScreenDC, pimldp->x, pimldp->y, cx, cy, PATCOPY );
    258258
     
    260260    }
    261261
    262     /*
     262    /* 
    263263     * Draw Image Transparently over the current background
    264264     */
    265     if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) ||
    266        ((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag)
    267     {   /*
     265    if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) || 
     266       ((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag) 
     267    {   /* 
    268268         * To obtain a transparent look, background color should be set
    269          * to white and foreground color to black when blting the
    270          * monochrome mask.
     269         * to white and foreground color to black when blting the 
     270         * monochrome mask. 
    271271         */
    272 
    273         oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) );
     272       
     273        oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) ); 
    274274        oldFgColor = SetTextColor( hOffScreenDC, RGB( 0, 0, 0 ) );
    275275
     
    279279        BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,himlLocal->cx * pimldp->i,
    280280                0, SRCPAINT );
    281 
    282     }
    283 
     281   
     282    }
     283   
    284284    /*
    285285     * Draw the image when no Background is specified
     
    287287    else if((fStyle & ILD_IMAGE) && !bUseCustomBackground)
    288288    {
    289         BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,
     289        BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC, 
    290290                himlLocal->cx * pimldp->i, 0, SRCCOPY);
    291291    }
    292     /*
     292    /* 
    293293     * Draw the mask with or without a background
    294294     */
     
    298298                0, bUseCustomBackground ? SRCCOPY : SRCAND);
    299299    }
    300 
     300   
    301301    /*
    302302     * Blit the bitmap to the screen now.
     
    305305            hOffScreenDC, 0, 0, SRCCOPY);
    306306
    307 
     307   
    308308    SelectObject(hImageDC, hOldBitmapImage);
    309309    SelectObject(hMaskDC, hOldBitmapMask);
    310 
     310   
    311311cleanup:
    312 
     312   
    313313    DeleteDC(hImageDC);
    314314    DeleteDC(hMaskDC);
    315 
     315   
    316316    DeleteDC( hOffScreenDC );
    317317    DeleteObject( hOffScreenBmp );
    318 
     318   
    319319    return;
    320320}
    321321
    322322/*************************************************************************
    323  * IMAGELIST_InternalDrawBlend [Internal]
    324  *
    325  * Draws the Blend over the current image
     323 * IMAGELIST_InternalDrawBlend [Internal] 
     324 *
     325 * Draws the Blend over the current image 
    326326 *
    327327 * PARAMS
     
    334334 *
    335335 * NOTES
    336  *     This functions is used by ImageList_DrawIndirect, when it is
    337  *     required to add the blend to the current image.
    338  *
     336 *     This functions is used by ImageList_DrawIndirect, when it is 
     337 *     required to add the blend to the current image. 
     338 *     
    339339 */
    340340static VOID
     
    375375
    376376        BitBlt(hBlendMaskDC,
    377             0,0, cx, cy,
     377            0,0, cx, cy, 
    378378            hMaskDC,
    379379            himlLocal->cx * pimldp->i,0,
     
    381381
    382382        BitBlt(hBlendMaskDC,
    383             0,0, cx, cy,
     383            0,0, cx, cy, 
    384384            hBlendMaskDC,
    385             0,0,
     385            0,0, 
    386386            NOTSRCCOPY);
    387387
     
    397397    hOldBrush = (HBRUSH) SelectObject (pimldp->hdcDst, hBlendColorBrush);
    398398
    399     BitBlt (pimldp->hdcDst,
    400         pimldp->x, pimldp->y, cx, cy,
    401         hBlendMaskDC,
    402         0, 0,
     399    BitBlt (pimldp->hdcDst, 
     400        pimldp->x, pimldp->y, cx, cy, 
     401        hBlendMaskDC, 
     402        0, 0, 
    403403        0xB8074A); /* PSDPxax */
    404404
     
    413413
    414414/*************************************************************************
    415  * IMAGELIST_InternalDrawOverlay [Internal]
    416  *
    417  * Draws the overlay image
     415 * IMAGELIST_InternalDrawOverlay [Internal] 
     416 *
     417 * Draws the overlay image 
    418418 *
    419419 * PARAMS
     
    426426 *
    427427 * NOTES
    428  *     This functions is used by ImageList_DrawIndirect, when it is
     428 *     This functions is used by ImageList_DrawIndirect, when it is 
    429429 *     required to draw the overlay
    430430 *
    431  *
    432  */
    433 static VOID
     431 *     
     432 */
     433static VOID 
    434434IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy)
    435435{
     
    447447            if (pimldp->himl->hbmMask)
    448448            {
    449                 hOldBitmap = (HBITMAP) SelectObject (hImageDC,
     449                hOldBitmap = (HBITMAP) SelectObject (hImageDC, 
    450450                    pimldp->himl->hbmMask);
    451451
    452                 BitBlt (pimldp->hdcDst,
     452                BitBlt (pimldp->hdcDst, 
    453453                    pimldp->x, pimldp->y, cx, cy,
    454454                    hImageDC, pimldp->himl->cx * nOvlIdx, 0,
     
    457457                SelectObject(hImageDC, hOldBitmap);
    458458            }
    459             hOldBitmap = (HBITMAP) SelectObject (hImageDC,
     459            hOldBitmap = (HBITMAP) SelectObject (hImageDC, 
    460460                pimldp->himl->hbmImage);
    461461
    462             BitBlt (pimldp->hdcDst,
    463                 pimldp->x, pimldp->y, cx, cy,
     462            BitBlt (pimldp->hdcDst, 
     463                pimldp->x, pimldp->y, cx, cy, 
    464464                hImageDC,
    465465                pimldp->himl->cx * nOvlIdx, 0,
     
    492492
    493493INT WINAPI
    494 ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
     494ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
    495495{
    496496    HDC     hdcImage, hdcBitmap;
     
    531531        hOldBitmapTemp = (HBITMAP) SelectObject(hdcTemp, hbmMask);
    532532
    533         BitBlt (hdcMask,
     533        BitBlt (hdcMask, 
    534534            nStartX, 0, bmp.bmWidth, bmp.bmHeight,
    535             hdcTemp,
    536             0, 0,
     535            hdcTemp, 
     536            0, 0, 
    537537            SRCCOPY);
    538538
     
    542542        /* Remove the background from the image
    543543        */
    544         BitBlt (hdcImage,
     544        BitBlt (hdcImage, 
    545545            nStartX, 0, bmp.bmWidth, bmp.bmHeight,
    546             hdcMask,
    547             nStartX, 0,
     546            hdcMask, 
     547            nStartX, 0, 
    548548            0x220326); /* NOTSRCAND */
    549549
     
    586586
    587587/*************************************************************************
    588  * ImageList_AddMasked [COMCTL32.42]
     588 * ImageList_AddMasked [COMCTL32.42] 
    589589 *
    590590 * Adds an image or images to an image list and creates a mask from the
     
    651651        GetPixel (hdcBitmap, 0, 0);
    652652    SetBkColor (hdcBitmap, bkColor);
    653     BitBlt (hdcMask,
     653    BitBlt (hdcMask, 
    654654        nMaskXOffset, 0, bmp.bmWidth, bmp.bmHeight,
    655         hdcBitmap, 0, 0,
     655        hdcBitmap, 0, 0, 
    656656        SRCCOPY);
    657657
     
    668668        This is here in case some apps rely on this bug
    669669    */
    670     BitBlt(hdcBitmap,
     670    BitBlt(hdcBitmap, 
    671671        0, 0, bmp.bmWidth, bmp.bmHeight,
    672         hdcMask,
    673         nMaskXOffset, 0,
     672        hdcMask, 
     673        nMaskXOffset, 0, 
    674674        0x220326); /* NOTSRCAND */
    675675    /* Copy result to the imagelist
    676676    */
    677     BitBlt (hdcImage,
     677    BitBlt (hdcImage, 
    678678        nIndex * himl->cx, 0, bmp.bmWidth, bmp.bmHeight,
    679         hdcBitmap,
    680         0, 0,
     679        hdcBitmap, 
     680        0, 0, 
    681681        SRCCOPY);
    682682    /* Clean up
     
    698698
    699699/*************************************************************************
    700  * ImageList_BeginDrag [COMCTL32.43]
     700 * ImageList_BeginDrag [COMCTL32.43] 
    701701 *
    702702 * Creates a temporary image list that contains one image. It will be used
     
    716716BOOL WINAPI
    717717ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack,
    718                  INT dxHotspot, INT dyHotspot)
     718                     INT dxHotspot, INT dyHotspot)
    719719{
    720720    HDC hdcSrc, hdcDst;
     
    723723
    724724    if (himlTrack == NULL)
    725     return FALSE;
     725        return FALSE;
    726726
    727727    if (himlInternalDrag)
     
    729729
    730730    himlInternalDrag =
    731     ImageList_Create (himlTrack->cx, himlTrack->cy,
    732               himlTrack->flags, 1, 1);
     731        ImageList_Create (himlTrack->cx, himlTrack->cy,
     732                          himlTrack->flags, 1, 1);
    733733    if (himlInternalDrag == NULL) {
    734734        ERR("Error creating drag image list!\n");
     
    764764
    765765/*************************************************************************
    766  * ImageList_Copy [COMCTL32.44]
    767  *
    768  *  Copies an image of the source image list to an image of the
     766 * ImageList_Copy [COMCTL32.44] 
     767 *
     768 *  Copies an image of the source image list to an image of the 
    769769 *  destination image list. Images can be copied or swapped.
    770770 *
     
    787787
    788788BOOL WINAPI
    789 ImageList_Copy (HIMAGELIST himlDst, INT iDst,   HIMAGELIST himlSrc,
    790         INT iSrc, INT uFlags)
    791 {
    792     HDC hdcSrc, hdcDst;
     789ImageList_Copy (HIMAGELIST himlDst, INT iDst,   HIMAGELIST himlSrc,
     790                INT iSrc, INT uFlags)
     791{
     792    HDC hdcSrc, hdcDst;   
    793793
    794794    TRACE("iDst=%d  iSrc=%d\n", iDst, iSrc);
    795795
    796796    if ((himlSrc == NULL) || (himlDst == NULL))
    797     return FALSE;
     797        return FALSE;
    798798    if ((iDst < 0) || (iDst >= himlDst->cCurImage))
    799     return FALSE;
     799        return FALSE;
    800800    if ((iSrc < 0) || (iSrc >= himlSrc->cCurImage))
    801     return FALSE;
     801        return FALSE;
    802802
    803803    hdcSrc = CreateCompatibleDC (0);
     
    815815                                       himlSrc->uBitsPixel, NULL);
    816816        hbmTempMask = CreateBitmap (himlSrc->cx, himlSrc->cy, 1,
    817                       1, NULL);
     817                                      1, NULL);
    818818
    819819        /* copy (and stretch) destination to temporary bitmaps.(save) */
     
    908908HIMAGELIST WINAPI
    909909ImageList_Create (INT cx, INT cy, UINT flags,
    910           INT cInitial, INT cGrow)
     910                  INT cInitial, INT cGrow)
    911911{
    912912    HIMAGELIST himl;
     
    914914    INT      nCount;
    915915    HBITMAP  hbmTemp;
    916     static WORD aBitBlend25[] =
     916    static WORD aBitBlend25[] = 
    917917        {0xAA, 0x00, 0x55, 0x00, 0xAA, 0x00, 0x55, 0x00};
    918918
     
    948948    if (himl->cMaxImage > 0) {
    949949        himl->hbmImage =
    950       CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
     950          CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
    951951                        1, himl->uBitsPixel, NULL);
    952     if (himl->hbmImage == 0) {
    953         ERR("Error creating image bitmap!\n");
    954         return NULL;
    955     }
     952        if (himl->hbmImage == 0) {
     953            ERR("Error creating image bitmap!\n");
     954            return NULL;
     955        }
    956956    }
    957957    else
    958958        himl->hbmImage = 0;
    959 
     959   
    960960    if ( (himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
    961961        himl->hbmMask = CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
    962                     1, 1, NULL);
     962                                        1, 1, NULL);
    963963        if (himl->hbmMask == 0) {
    964964            ERR("Error creating mask bitmap!\n");
     
    986986
    987987/*************************************************************************
    988  * ImageList_Destroy [COMCTL32.46]
     988 * ImageList_Destroy [COMCTL32.46] 
    989989 *
    990990 * Destroys an image list.
     
    10001000BOOL WINAPI
    10011001ImageList_Destroy (HIMAGELIST himl)
    1002 {
     1002{ 
    10031003    if (!himl)
    1004     return FALSE;
     1004        return FALSE;
    10051005
    10061006    /* delete image bitmaps */
     
    10151015    if (himl->hbrBlend50)
    10161016        DeleteObject (himl->hbrBlend50);
    1017 
     1017       
    10181018    COMCTL32_Free (himl);
    10191019
     
    10231023
    10241024/*************************************************************************
    1025  * ImageList_DragEnter [COMCTL32.47]
     1025 * ImageList_DragEnter [COMCTL32.47] 
    10261026 *
    10271027 * Locks window update and displays the drag image at the given position.
     
    10451045{
    10461046    if (himlInternalDrag == NULL)
    1047     return FALSE;
     1047        return FALSE;
    10481048
    10491049    if (hwndLock)
    1050     hwndInternalDrag = hwndLock;
     1050        hwndInternalDrag = hwndLock;
    10511051    else
    1052     hwndInternalDrag = GetDesktopWindow ();
     1052        hwndInternalDrag = GetDesktopWindow ();
    10531053
    10541054    xInternalPos = x;
     
    10571057    hdcBackBuffer = CreateCompatibleDC (0);
    10581058    hbmBackBuffer = CreateCompatibleBitmap (hdcBackBuffer,
    1059         himlInternalDrag->cx, himlInternalDrag->cy);
     1059                himlInternalDrag->cx, himlInternalDrag->cy);
    10601060
    10611061    ImageList_DragShowNolock (TRUE);
     
    10661066
    10671067/*************************************************************************
    1068  * ImageList_DragLeave [COMCTL32.48]
     1068 * ImageList_DragLeave [COMCTL32.48] 
    10691069 *
    10701070 * Unlocks window update and hides the drag image.
     
    10821082{
    10831083    if (hwndLock)
    1084     hwndInternalDrag = hwndLock;
     1084        hwndInternalDrag = hwndLock;
    10851085    else
    1086     hwndInternalDrag = GetDesktopWindow ();
     1086        hwndInternalDrag = GetDesktopWindow ();
    10871087
    10881088    ImageList_DragShowNolock (FALSE);
     
    10961096
    10971097/*************************************************************************
    1098  * ImageList_DragMove [COMCTL32.49]
     1098 * ImageList_DragMove [COMCTL32.49] 
    10991099 *
    11001100 * Moves the drag image.
     
    11281128
    11291129/*************************************************************************
    1130  * ImageList_DragShowNolock [COMCTL32.50]
     1130 * ImageList_DragShowNolock [COMCTL32.50] 
    11311131 *
    11321132 * Shows or hides the drag image.
     
    11521152
    11531153    hdcDrag = GetDCEx (hwndInternalDrag, 0,
    1154             DCX_WINDOW | DCX_CACHE | DCX_LOCKWINDOWUPDATE);
     1154                        DCX_WINDOW | DCX_CACHE | DCX_LOCKWINDOWUPDATE);
    11551155
    11561156    if (bShow) {
    1157     /* show drag image */
    1158 
    1159     /* save background */
    1160 
    1161     /* draw drag image */
     1157        /* show drag image */
     1158
     1159        /* save background */
     1160
     1161        /* draw drag image */
    11621162
    11631163    }
    11641164    else {
    1165     /* hide drag image */
    1166 
    1167     /* restore background */
     1165        /* hide drag image */
     1166
     1167        /* restore background */
    11681168
    11691169    }
     
    11991199BOOL WINAPI
    12001200ImageList_Draw (HIMAGELIST himl, INT i, HDC hdc,
    1201         INT x, INT y, UINT fStyle)
     1201                INT x, INT y, UINT fStyle)
    12021202{
    12031203    IMAGELISTDRAWPARAMS imldp;
     
    12521252BOOL WINAPI
    12531253ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y,
    1254           INT dx, INT dy, COLORREF rgbBk, COLORREF rgbFg,
    1255           UINT fStyle)
     1254                  INT dx, INT dy, COLORREF rgbBk, COLORREF rgbFg,
     1255                  UINT fStyle)
    12561256{
    12571257    IMAGELISTDRAWPARAMS imldp;
     
    12771277
    12781278/*************************************************************************
    1279  * ImageList_DrawIndirect [COMCTL32.53]
     1279 * ImageList_DrawIndirect [COMCTL32.53] 
    12801280 *
    12811281 * Draws an image using ...
     
    12921292ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
    12931293{
    1294     INT      cx, cy;
    1295     /*
     1294    INT      cx, cy;   
     1295    /* 
    12961296        Do some Error Checking
    12971297    */
     
    13031303        return FALSE;
    13041304    if ((pimldp->i < 0) || (pimldp->i >= pimldp->himl->cCurImage)) {
    1305     ERR("%d not within range (max %d)\n",pimldp->i,pimldp->himl->cCurImage-1);
     1305        ERR("%d not within range (max %d)\n",pimldp->i,pimldp->himl->cCurImage-1);
    13061306        return FALSE;
    13071307    }
     
    13221322        IMAGELIST_InternalDraw(pimldp, cx, cy);
    13231323    }
    1324     /*
     1324    /* 
    13251325        Apply the blend if needed to the Image
    13261326    */
     
    13871387        DeleteDC (hdcSrc);
    13881388
    1389     himlDst->cCurImage = himlSrc->cCurImage;
    1390     himlDst->cMaxImage = himlSrc->cMaxImage;
     1389        himlDst->cCurImage = himlSrc->cCurImage;
     1390        himlDst->cMaxImage = himlSrc->cMaxImage;
    13911391    }
    13921392    return himlDst;
     
    14471447{
    14481448    if (himl == NULL)
    1449     return CLR_NONE;
     1449        return CLR_NONE;
    14501450
    14511451    return himl->clrBk;
     
    14831483
    14841484/*************************************************************************
    1485  * ImageList_GetIcon [COMCTL32.59]
     1485 * ImageList_GetIcon [COMCTL32.59] 
    14861486 *
    14871487 * Creates an icon from a masked image of an image list.
     
    15061506
    15071507    if ((himl == NULL) || (i < 0) || (i >= himl->cCurImage)) {
    1508     FIXME("(%p,%d,%x), params out of range!\n",himl,i,fStyle);
    1509     return 0;
     1508        FIXME("(%p,%d,%x), params out of range!\n",himl,i,fStyle);
     1509        return 0;
    15101510   }
    15111511
     
    15191519    hOldDstBitmap = (HBITMAP)SelectObject (hdcDst, ii.hbmMask);
    15201520    if (himl->hbmMask) {
    1521     SelectObject (hdcSrc, himl->hbmMask);
    1522     BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
    1523           hdcSrc, i * himl->cx, 0, SRCCOPY);
     1521        SelectObject (hdcSrc, himl->hbmMask);
     1522        BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
     1523                  hdcSrc, i * himl->cx, 0, SRCCOPY);
    15241524    }
    15251525    else
    1526     PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
     1526        PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
    15271527
    15281528    /* draw image*/
     
    15311531    SelectObject (hdcDst, ii.hbmColor);
    15321532    BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
    1533           hdcSrc, i * himl->cx, 0, SRCCOPY);
     1533              hdcSrc, i * himl->cx, 0, SRCCOPY);
    15341534
    15351535    /*
    15361536     * CreateIconIndirect requires us to deselect the bitmaps from
    1537      * the DCs before calling
     1537     * the DCs before calling 
    15381538     */
    15391539    SelectObject(hdcSrc, hOldSrcBitmap);
    15401540    SelectObject(hdcDst, hOldDstBitmap);
    15411541
    1542     hIcon = CreateIconIndirect (&ii);
     1542    hIcon = CreateIconIndirect (&ii);   
    15431543
    15441544    DeleteDC (hdcSrc);
     
    15731573{
    15741574    if (himl == NULL)
    1575     return FALSE;
     1575        return FALSE;
    15761576    if ((himl->cx <= 0) || (himl->cy <= 0))
    1577     return FALSE;
     1577        return FALSE;
    15781578
    15791579    if (cx)
    1580     *cx = himl->cx;
     1580        *cx = himl->cx;
    15811581    if (cy)
    1582     *cy = himl->cy;
     1582        *cy = himl->cy;
    15831583
    15841584    return TRUE;
     
    16031603{
    16041604    if (himl == NULL)
    1605     return 0;
     1605        return 0;
    16061606
    16071607    return himl->cCurImage;
     
    16281628{
    16291629    if ((himl == NULL) || (pImageInfo == NULL))
    1630     return FALSE;
     1630        return FALSE;
    16311631    if ((i < 0) || (i >= himl->cCurImage))
    1632     return FALSE;
     1632        return FALSE;
    16331633
    16341634    pImageInfo->hbmImage = himl->hbmImage;
    16351635    pImageInfo->hbmMask  = himl->hbmMask;
    1636 
     1636   
    16371637    pImageInfo->rcImage.top    = 0;
    16381638    pImageInfo->rcImage.bottom = himl->cy;
    16391639    pImageInfo->rcImage.left   = i * himl->cx;
    16401640    pImageInfo->rcImage.right  = (i+1) * himl->cx;
    1641 
     1641   
    16421642    return TRUE;
    16431643}
     
    16451645
    16461646/*************************************************************************
    1647  * ImageList_GetImageRect [COMCTL32.63]
     1647 * ImageList_GetImageRect [COMCTL32.63] 
    16481648 *
    16491649 * Retrieves the rectangle of the specified image in an image list.
     
    16661666{
    16671667    if ((himl == NULL) || (lpRect == NULL))
    1668     return FALSE;
     1668        return FALSE;
    16691669    if ((i < 0) || (i >= himl->cCurImage))
    1670     return FALSE;
     1670        return FALSE;
    16711671
    16721672    lpRect->left   = i * himl->cx;
     
    17041704HIMAGELIST WINAPI
    17051705ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow,
    1706             COLORREF clrMask, UINT uType, UINT uFlags)
     1706                        COLORREF clrMask, UINT uType, UINT uFlags)
    17071707{
    17081708    HIMAGELIST himl = NULL;
     
    17441744        GetIconInfo (handle, &ii);
    17451745        GetObjectA (ii.hbmColor, sizeof(BITMAP), (LPVOID)&bmp);
    1746         himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight,
     1746        himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 
    17471747                                 ILC_MASK | ILC_COLOR, 1, cGrow);
    17481748        ImageList_Add (himl, ii.hbmColor, ii.hbmMask);
     
    17521752
    17531753    DeleteObject (handle);
    1754 
     1754   
    17551755    return himl;
    17561756}
     
    17811781HIMAGELIST WINAPI
    17821782ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow,
    1783             COLORREF clrMask, UINT uType,   UINT uFlags)
     1783                        COLORREF clrMask, UINT uType,   UINT uFlags)
    17841784{
    17851785    HIMAGELIST himl = NULL;
     
    18081808        GetIconInfo (handle, &ii);
    18091809        GetObjectA (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
    1810         himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight,
     1810        himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, 
    18111811                                 ILC_MASK | ILC_COLOR, 1, cGrow);
    18121812        ImageList_Add (himl, ii.hbmColor, ii.hbmMask);
     
    18161816
    18171817    DeleteObject (handle);
    1818 
     1818   
    18191819    return himl;
    18201820}
     
    18221822
    18231823/*************************************************************************
    1824  * ImageList_Merge [COMCTL32.67]
     1824 * ImageList_Merge [COMCTL32.67] 
    18251825 *
    18261826 * Creates a new image list that contains a merged image from the specified
     
    18421842HIMAGELIST WINAPI
    18431843ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
    1844         INT dx, INT dy)
     1844                INT dx, INT dy)
    18451845{
    18461846    HIMAGELIST himlDst = NULL;
     
    18511851
    18521852    if ((himl1 == NULL) || (himl2 == NULL))
    1853     return NULL;
     1853        return NULL;
    18541854
    18551855    /* check indices */
     
    19031903        nX1 = i1 * himl1->cx;
    19041904        nX2 = i2 * himl2->cx;
    1905 
     1905       
    19061906        /* copy image */
    19071907        SelectObject (hdcSrcImage, himl1->hbmImage);
    19081908        SelectObject (hdcDstImage, himlDst->hbmImage);
    1909         BitBlt (hdcDstImage, 0, 0, cxDst, cyDst,
     1909        BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, 
    19101910                  hdcSrcImage, 0, 0, BLACKNESS);
    1911         BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy,
     1911        BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, 
    19121912                  hdcSrcImage, nX1, 0, SRCCOPY);
    19131913
    19141914        SelectObject (hdcSrcImage, himl2->hbmMask);
    1915         BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
     1915        BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 
    19161916                  hdcSrcImage, nX2, 0, SRCAND);
    19171917
    19181918        SelectObject (hdcSrcImage, himl2->hbmImage);
    1919         BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
     1919        BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 
    19201920                  hdcSrcImage, nX2, 0, SRCPAINT);
    19211921
     
    19231923        SelectObject (hdcSrcImage, himl1->hbmMask);
    19241924        SelectObject (hdcDstImage, himlDst->hbmMask);
    1925         BitBlt (hdcDstImage, 0, 0, cxDst, cyDst,
     1925        BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, 
    19261926                  hdcSrcImage, 0, 0, WHITENESS);
    1927         BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy,
     1927        BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, 
    19281928                  hdcSrcImage, nX1, 0, SRCCOPY);
    19291929
    19301930        SelectObject (hdcSrcImage, himl2->hbmMask);
    1931         BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy,
     1931        BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, 
    19321932                  hdcSrcImage, nX2, 0, SRCAND);
    19331933
     
    19351935        DeleteDC (hdcDstImage);
    19361936    }
    1937 
     1937   
    19381938    return himlDst;
    19391939}
     
    19451945    int bitspixel = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES);
    19461946    if (bitspixel>8)
    1947     return TRUE;
     1947        return TRUE;
    19481948    if (bitspixel<=4)
    1949     return FALSE;
     1949        return FALSE;
    19501950    return GetDeviceCaps(hdc,CAPS1) & C1_DIBENGINE;
    19511951}
     
    19541954/* helper for ImageList_Read, see comments below */
    19551955static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) {
    1956     HDC         xdc = 0;
    1957     BITMAPFILEHEADER    bmfh;
    1958     BITMAPINFOHEADER    bmih;
    1959     int         bitsperpixel,palspace,longsperline,width,height;
    1960     LPBITMAPINFOHEADER  bmihc = NULL;
    1961     int         result = 0;
    1962     HBITMAP     hbitmap = 0;
    1963     LPBYTE      bits = NULL,nbits = NULL;
    1964     int         nbytesperline,bytesperline;
    1965 
    1966     if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)) ||
    1967         (bmfh.bfType != (('M'<<8)|'B'))                 ||
    1968         !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL)) ||
    1969         (bmih.biSize != sizeof(bmih))
     1956    HDC                 xdc = 0;
     1957    BITMAPFILEHEADER    bmfh;
     1958    BITMAPINFOHEADER    bmih;
     1959    int                 bitsperpixel,palspace,longsperline,width,height;
     1960    LPBITMAPINFOHEADER  bmihc = NULL;
     1961    int                 result = 0;
     1962    HBITMAP             hbitmap = 0;
     1963    LPBYTE              bits = NULL,nbits = NULL;
     1964    int                 nbytesperline,bytesperline;
     1965
     1966    if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL))     ||
     1967        (bmfh.bfType != (('M'<<8)|'B'))                                 ||
     1968        !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL))     ||
     1969        (bmih.biSize != sizeof(bmih))
    19701970    )
    1971     return 0;
     1971        return 0;
    19721972
    19731973    bitsperpixel = bmih.biPlanes * bmih.biBitCount;
    19741974    if (bitsperpixel<=8)
    1975         palspace = (1<<bitsperpixel)*sizeof(RGBQUAD);
     1975        palspace = (1<<bitsperpixel)*sizeof(RGBQUAD);
    19761976    else
    1977         palspace = 0;
     1977        palspace = 0;
    19781978    width = bmih.biWidth;
    19791979    height = bmih.biHeight;
    19801980    bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace);
    19811981    memcpy(bmihc,&bmih,sizeof(bmih));
    1982     longsperline    = ((width*bitsperpixel+31)&~0x1f)>>5;
    1983     bmihc->biSizeImage  = (longsperline*height)<<2;
     1982    longsperline        = ((width*bitsperpixel+31)&~0x1f)>>5;
     1983    bmihc->biSizeImage  = (longsperline*height)<<2;
    19841984
    19851985    /* read the palette right after the end of the bitmapinfoheader */
    19861986    if (palspace)
    1987     if (!SUCCEEDED(IStream_Read ( pstm, bmihc+1, palspace, NULL)))
    1988         goto ret1;
     1987        if (!SUCCEEDED(IStream_Read ( pstm, bmihc+1, palspace, NULL)))
     1988            goto ret1;
    19891989
    19901990    xdc = GetDC(0);
    19911991#if 0 /* Magic for NxM -> 1x(N*M) not implemented for DIB Sections */
    19921992    if ((bitsperpixel>1) &&
    1993     ((ilcFlag!=ILC_COLORDDB) && (!ilcFlag || may_use_dibsection(xdc)))
     1993        ((ilcFlag!=ILC_COLORDDB) && (!ilcFlag || may_use_dibsection(xdc)))
    19941994     ) {
    1995     hbitmap = CreateDIBSection(xdc,(BITMAPINFO*)bmihc,0,(LPVOID*)&bits,0,0);
    1996     if (!hbitmap)
    1997         goto ret1;
    1998     if (!SUCCEEDED(IStream_Read( pstm, bits, bmihc->biSizeImage, NULL)))
    1999         goto ret1;
    2000     result = 1;
     1995        hbitmap = CreateDIBSection(xdc,(BITMAPINFO*)bmihc,0,(LPVOID*)&bits,0,0);
     1996        if (!hbitmap)
     1997            goto ret1;
     1998        if (!SUCCEEDED(IStream_Read( pstm, bits, bmihc->biSizeImage, NULL)))
     1999            goto ret1;
     2000        result = 1;
    20012001    } else
    20022002#endif
    20032003    {
    2004     int i,nwidth,nheight;
    2005 
    2006     nwidth  = width*(height/cy);
    2007     nheight = cy;
    2008 
    2009     if (bitsperpixel==1)
    2010         hbitmap = CreateBitmap(nwidth,nheight,1,1,NULL);
    2011     else
    2012         hbitmap = CreateCompatibleBitmap(xdc,nwidth,nheight);
    2013 
    2014     /* Might be a bit excessive memory use here */
    2015     bits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage);
    2016     nbits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage);
    2017     if (!SUCCEEDED(IStream_Read ( pstm, bits, bmihc->biSizeImage, NULL)))
    2018         goto ret1;
    2019 
    2020     /* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */
    2021     /* Do not forget that windows bitmaps are bottom->top */
    2022     bytesperline    = longsperline*4;
    2023     nbytesperline   = (height/cy)*bytesperline;
    2024     for (i=0;i<height;i++) {
    2025         memcpy(
    2026         nbits+((height-1-i)%cy)*nbytesperline+(i/cy)*bytesperline,
    2027         bits+bytesperline*(height-1-i),
    2028         bytesperline
    2029         );
    2030     }
    2031     bmihc->biWidth  = nwidth;
    2032     bmihc->biHeight = nheight;
    2033     if (!SetDIBits(xdc,hbitmap,0,nheight,nbits,(BITMAPINFO*)bmihc,0))
    2034         goto ret1;
    2035     LocalFree((HLOCAL)nbits);
    2036     LocalFree((HLOCAL)bits);
    2037     result = 1;
     2004        int i,nwidth,nheight;
     2005
     2006        nwidth  = width*(height/cy);
     2007        nheight = cy;
     2008
     2009        if (bitsperpixel==1)
     2010            hbitmap = CreateBitmap(nwidth,nheight,1,1,NULL);
     2011        else
     2012            hbitmap = CreateCompatibleBitmap(xdc,nwidth,nheight);
     2013
     2014        /* Might be a bit excessive memory use here */
     2015        bits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage);
     2016        nbits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage);
     2017        if (!SUCCEEDED(IStream_Read ( pstm, bits, bmihc->biSizeImage, NULL)))
     2018                goto ret1;
     2019
     2020        /* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */
     2021        /* Do not forget that windows bitmaps are bottom->top */
     2022        bytesperline    = longsperline*4;
     2023        nbytesperline   = (height/cy)*bytesperline;
     2024        for (i=0;i<height;i++) {
     2025            memcpy(
     2026                nbits+((height-1-i)%cy)*nbytesperline+(i/cy)*bytesperline,
     2027                bits+bytesperline*(height-1-i),
     2028                bytesperline
     2029            );
     2030        }
     2031        bmihc->biWidth  = nwidth;
     2032        bmihc->biHeight = nheight;
     2033        if (!SetDIBits(xdc,hbitmap,0,nheight,nbits,(BITMAPINFO*)bmihc,0))
     2034                goto ret1;
     2035        LocalFree((HLOCAL)nbits);
     2036        LocalFree((HLOCAL)bits);
     2037        result = 1;
    20382038    }
    20392039ret1:
    2040     if (xdc)    ReleaseDC(0,xdc);
    2041     if (bmihc)  LocalFree((HLOCAL)bmihc);
     2040    if (xdc)    ReleaseDC(0,xdc);
     2041    if (bmihc)  LocalFree((HLOCAL)bmihc);
    20422042    if (!result) {
    2043     if (hbitmap) {
    2044         DeleteObject(hbitmap);
    2045         hbitmap = 0;
    2046     }
     2043        if (hbitmap) {
     2044            DeleteObject(hbitmap);
     2045            hbitmap = 0;
     2046        }
    20472047    }
    20482048    return hbitmap;
     
    20622062 *
    20632063 * The format is like this:
    2064  *  ILHEAD          ilheadstruct;
     2064 *      ILHEAD                  ilheadstruct;
    20652065 *
    20662066 * for the color image part:
    2067  *  BITMAPFILEHEADER    bmfh;
    2068  *  BITMAPINFOHEADER    bmih;
     2067 *      BITMAPFILEHEADER        bmfh;
     2068 *      BITMAPINFOHEADER        bmih;
    20692069 * only if it has a palette:
    2070  *  RGBQUAD     rgbs[nr_of_paletted_colors];
    2071  *
    2072  *  BYTE            colorbits[imagesize];
     2070 *      RGBQUAD         rgbs[nr_of_paletted_colors];
     2071 *
     2072 *      BYTE                    colorbits[imagesize];
    20732073 *
    20742074 * the following only if the ILC_MASK bit is set in ILHEAD.ilFlags:
    2075  *  BITMAPFILEHEADER    bmfh_mask;
    2076  *  BITMAPINFOHEADER    bmih_mask;
     2075 *      BITMAPFILEHEADER        bmfh_mask;
     2076 *      BITMAPINFOHEADER        bmih_mask;
    20772077 * only if it has a palette (it usually does not):
    2078  *  RGBQUAD     rgbs[nr_of_paletted_colors];
    2079  *
    2080  *  BYTE            maskbits[imagesize];
     2078 *      RGBQUAD         rgbs[nr_of_paletted_colors];
     2079 *
     2080 *      BYTE                    maskbits[imagesize];
    20812081 *
    20822082 * CAVEAT: Those images are within a NxM bitmap, not the 1xN we expect.
     
    20852085HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
    20862086{
    2087     ILHEAD  ilHead;
    2088     HIMAGELIST  himl;
    2089     HBITMAP hbmColor=0,hbmMask=0;
    2090     int     i;
     2087    ILHEAD      ilHead;
     2088    HIMAGELIST  himl;
     2089    HBITMAP     hbmColor=0,hbmMask=0;
     2090    int         i;
    20912091
    20922092    if (!SUCCEEDED(IStream_Read (pstm, &ilHead, sizeof(ILHEAD), NULL)))
    2093         return NULL;
     2093        return NULL;
    20942094    if (ilHead.usMagic != (('L' << 8) | 'I'))
    2095     return NULL;
     2095        return NULL;
    20962096    if (ilHead.usVersion != 0x101) /* probably version? */
    2097     return NULL;
     2097        return NULL;
    20982098
    20992099#if 0
    2100     FIXME(" ilHead.cCurImage = %d\n",ilHead.cCurImage);
    2101     FIXME(" ilHead.cMaxImage = %d\n",ilHead.cMaxImage);
    2102     FIXME(" ilHead.cGrow = %d\n",ilHead.cGrow);
    2103     FIXME(" ilHead.cx = %d\n",ilHead.cx);
    2104     FIXME(" ilHead.cy = %d\n",ilHead.cy);
    2105     FIXME(" ilHead.flags = %x\n",ilHead.flags);
    2106     FIXME(" ilHead.ovls[0] = %d\n",ilHead.ovls[0]);
    2107     FIXME(" ilHead.ovls[1] = %d\n",ilHead.ovls[1]);
    2108     FIXME(" ilHead.ovls[2] = %d\n",ilHead.ovls[2]);
    2109     FIXME(" ilHead.ovls[3] = %d\n",ilHead.ovls[3]);
     2100    FIXME("     ilHead.cCurImage = %d\n",ilHead.cCurImage);
     2101    FIXME("     ilHead.cMaxImage = %d\n",ilHead.cMaxImage);
     2102    FIXME("     ilHead.cGrow = %d\n",ilHead.cGrow);
     2103    FIXME("     ilHead.cx = %d\n",ilHead.cx);
     2104    FIXME("     ilHead.cy = %d\n",ilHead.cy);
     2105    FIXME("     ilHead.flags = %x\n",ilHead.flags);
     2106    FIXME("     ilHead.ovls[0] = %d\n",ilHead.ovls[0]);
     2107    FIXME("     ilHead.ovls[1] = %d\n",ilHead.ovls[1]);
     2108    FIXME("     ilHead.ovls[2] = %d\n",ilHead.ovls[2]);
     2109    FIXME("     ilHead.ovls[3] = %d\n",ilHead.ovls[3]);
    21102110#endif
    21112111
    21122112    hbmColor = _read_bitmap(pstm,ilHead.flags & ~ILC_MASK,ilHead.cx,ilHead.cy);
    21132113    if (!hbmColor)
    2114     return NULL;
     2114        return NULL;
    21152115    if (ilHead.flags & ILC_MASK) {
    2116     hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy);
    2117     if (!hbmMask) {
    2118         DeleteObject(hbmColor);
    2119         return NULL;
    2120     }
     2116        hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy);
     2117        if (!hbmMask) {
     2118            DeleteObject(hbmColor);
     2119            return NULL;
     2120        }
    21212121    }
    21222122
    21232123    himl = ImageList_Create (
    2124             ilHead.cx,
    2125             ilHead.cy,
    2126             ilHead.flags,
    2127             1,      /* initial */
    2128             ilHead.cGrow
     2124                    ilHead.cx,
     2125                    ilHead.cy,
     2126                    ilHead.flags,
     2127                    1,          /* initial */
     2128                    ilHead.cGrow
    21292129    );
    21302130    if (!himl) {
    2131     DeleteObject(hbmColor);
    2132     DeleteObject(hbmMask);
    2133     return NULL;
     2131        DeleteObject(hbmColor);
     2132        DeleteObject(hbmMask);
     2133        return NULL;
    21342134    }
    21352135    himl->hbmImage = hbmColor;
     
    21402140    ImageList_SetBkColor(himl,ilHead.bkcolor);
    21412141    for (i=0;i<4;i++)
    2142         ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1);
     2142        ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1);
    21432143    return himl;
    21442144}
     
    21682168        return FALSE;
    21692169    }
    2170 
     2170   
    21712171    if ((i < -1) || (i >= himl->cCurImage)) {
    21722172        ERR("index out of range! %d\n", i);
     
    22112211        TRACE(" - Max. number of images: %d / %d (Old/New)\n",
    22122212                 himl->cMaxImage, himl->cCurImage + himl->cGrow - 1);
    2213 
     2213       
    22142214        hbmNewImage =
    22152215            CreateBitmap (cxNew, himl->cy, 1, himl->uBitsPixel, NULL);
     
    22262226        if (i > 0) {
    22272227            TRACE("Pre image copy: Copy %d images\n", i);
    2228 
     2228       
    22292229            SelectObject (hdcSrc, himl->hbmImage);
    22302230            SelectObject (hdcDst, hbmNewImage);
     
    22772277
    22782278/*************************************************************************
    2279  * ImageList_Replace [COMCTL32.70]
     2279 * ImageList_Replace [COMCTL32.70] 
    22802280 *
    22812281 * Replaces an image in an image list with a new image.
     
    22942294BOOL WINAPI
    22952295ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage,
    2296            HBITMAP hbmMask)
     2296                   HBITMAP hbmMask)
    22972297{
    22982298    HDC hdcImageList, hdcImage;
     
    23032303        return FALSE;
    23042304    }
    2305 
     2305   
    23062306    if ((i >= himl->cMaxImage) || (i < 0)) {
    23072307        ERR("Invalid image index!\n");
     
    23332333        */
    23342334        SelectObject (hdcImageList, himl->hbmImage);
    2335         StretchBlt (hdcImageList,
     2335        StretchBlt (hdcImageList, 
    23362336            i*himl->cx, 0, himl->cx, himl->cy,
    2337             hdcImage,
    2338             0, 0, bmp.bmWidth, bmp.bmHeight,
     2337            hdcImage, 
     2338            0, 0, bmp.bmWidth, bmp.bmHeight, 
    23392339            0x220326); /* NOTSRCAND */
    23402340    }
     
    23752375
    23762376    if (himl == NULL)
    2377     return -1;
     2377        return -1;
    23782378    if ((i >= himl->cMaxImage) || (i < -1))
    2379     return -1;
     2379        return -1;
    23802380
    23812381    hBestFitIcon = CopyImage(
    2382         hIcon, IMAGE_ICON,
    2383         himl->cx, himl->cy,
     2382        hIcon, IMAGE_ICON, 
     2383        himl->cx, himl->cy, 
    23842384        LR_COPYFROMRESOURCE);
    23852385
    23862386    GetIconInfo (hBestFitIcon, &ii);
    23872387    if (ii.hbmMask == 0)
    2388     ERR("no mask!\n");
     2388        ERR("no mask!\n");
    23892389    if (ii.hbmColor == 0)
    2390     ERR("no color!\n");
     2390        ERR("no color!\n");
    23912391    GetObjectA (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
    23922392
     
    24042404    TRACE("hdcImageList=0x%x!\n", hdcImageList);
    24052405    if (hdcImageList == 0)
    2406     ERR("invalid hdcImageList!\n");
     2406        ERR("invalid hdcImageList!\n");
    24072407
    24082408    hdcImage = CreateCompatibleDC (0);
    24092409    TRACE("hdcImage=0x%x!\n", hdcImage);
    24102410    if (hdcImage == 0)
    2411     ERR("invalid hdcImage!\n");
     2411        ERR("invalid hdcImage!\n");
    24122412
    24132413    hbmOldDst = SelectObject (hdcImageList, himl->hbmImage);
     
    24292429
    24302430    if(hBestFitIcon)
    2431     DestroyIcon(hBestFitIcon);
     2431        DestroyIcon(hBestFitIcon);
    24322432    if (hdcImageList)
    2433     DeleteDC (hdcImageList);
     2433        DeleteDC (hdcImageList);
    24342434    if (hdcImage)
    2435     DeleteDC (hdcImage);
     2435        DeleteDC (hdcImage);
    24362436    if (ii.hbmColor)
    2437     DeleteObject (ii.hbmColor);
     2437        DeleteObject (ii.hbmColor);
    24382438    if (ii.hbmMask)
    2439     DeleteObject (ii.hbmMask);
     2439        DeleteObject (ii.hbmMask);
    24402440
    24412441    return nIndex;
     
    24442444
    24452445/*************************************************************************
    2446  * ImageList_SetBkColor [COMCTL32.76]
     2446 * ImageList_SetBkColor [COMCTL32.76] 
    24472447 *
    24482448 * Sets the background color of an image list.
     
    24632463
    24642464    if (himl == NULL)
    2465     return CLR_NONE;
     2465        return CLR_NONE;
    24662466
    24672467    clrOldBk = himl->clrBk;
     
    24922492BOOL WINAPI
    24932493ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag,
    2494                   INT dxHotspot, INT dyHotspot)
     2494                              INT dxHotspot, INT dyHotspot)
    24952495{
    24962496    HIMAGELIST himlTemp;
     
    24992499
    25002500    if (himlInternalDrag == NULL)
    2501     return FALSE;
     2501        return FALSE;
    25022502
    25032503    TRACE(" dxH=%d dyH=%d nX=%d nY=%d\n",
    2504        dxHotspot, dyHotspot, nInternalDragHotspotX, nInternalDragHotspotY);
     2504           dxHotspot, dyHotspot, nInternalDragHotspotX, nInternalDragHotspotY);
    25052505
    25062506    himlTemp = ImageList_Merge (himlInternalDrag, 0, himlDrag, iDrag,
    2507                 dxHotspot, dyHotspot);
     2507                                dxHotspot, dyHotspot);
    25082508
    25092509    ImageList_Destroy (himlInternalDrag);
     
    25182518
    25192519/*************************************************************************
    2520  * ImageList_SetFilter [COMCTL32.78]
     2520 * ImageList_SetFilter [COMCTL32.78] 
    25212521 *
    25222522 * Sets a filter (or does something completely different)!!???
     
    25402540{
    25412541    FIXME("(%p 0x%x 0x%lx):empty stub!\n",
    2542        himl, i, dwFilter);
     2542           himl, i, dwFilter);
    25432543
    25442544    return FALSE;
     
    25672567
    25682568    if (!himl)
    2569     return FALSE;
     2569        return FALSE;
    25702570
    25712571    /* remove all images */
     
    26172617
    26182618    if (!himl)
    2619     return FALSE;
     2619        return FALSE;
    26202620    if (himl->cCurImage >= iImageCount)
    2621     return FALSE;
     2621        return FALSE;
    26222622    if (himl->cMaxImage > iImageCount)
    2623     return TRUE;
     2623        return TRUE;
    26242624
    26252625    nNewCount = iImageCount + himl->cGrow;
     
    26362636        SelectObject (hdcBitmap, hbmNewBitmap);
    26372637
    2638     /* copy images */
     2638        /* copy images */
    26392639        BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
    26402640                  hdcImageList, 0, 0, SRCCOPY);
    26412641#if 0
    2642     /* delete 'empty' image space */
    2643     SetBkColor (hdcBitmap, RGB(255, 255, 255));
    2644     SetTextColor (hdcBitmap, RGB(0, 0, 0));
    2645     PatBlt (hdcBitmap,  nCopyCount * himl->cx, 0,
    2646           (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
     2642        /* delete 'empty' image space */
     2643        SetBkColor (hdcBitmap, RGB(255, 255, 255));
     2644        SetTextColor (hdcBitmap, RGB(0, 0, 0));
     2645        PatBlt (hdcBitmap,  nCopyCount * himl->cx, 0,
     2646                  (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
    26472647#endif
    2648     DeleteObject (himl->hbmImage);
    2649     himl->hbmImage = hbmNewBitmap;
     2648        DeleteObject (himl->hbmImage);
     2649        himl->hbmImage = hbmNewBitmap;
    26502650    }
    26512651    else
    2652     ERR("Could not create new image bitmap !\n");
     2652        ERR("Could not create new image bitmap !\n");
    26532653
    26542654    if (himl->hbmMask)
     
    26612661            SelectObject (hdcBitmap, hbmNewBitmap);
    26622662
    2663         /* copy images */
     2663            /* copy images */
    26642664            BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
    26652665                      hdcImageList, 0, 0, SRCCOPY);
    26662666#if 0
    2667         /* delete 'empty' image space */
    2668         SetBkColor (hdcBitmap, RGB(255, 255, 255));
    2669         SetTextColor (hdcBitmap, RGB(0, 0, 0));
    2670             PatBlt (hdcBitmap,  nCopyCount * himl->cx, 0,
    2671               (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
     2667            /* delete 'empty' image space */
     2668            SetBkColor (hdcBitmap, RGB(255, 255, 255));
     2669            SetTextColor (hdcBitmap, RGB(0, 0, 0));
     2670            PatBlt (hdcBitmap,  nCopyCount * himl->cx, 0, 
     2671                      (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
    26722672#endif
    26732673            DeleteObject (himl->hbmMask);
     
    27092709{
    27102710    if (!himl)
    2711     return FALSE;
     2711        return FALSE;
    27122712    if ((iOverlay < 1) || (iOverlay > MAX_OVERLAYIMAGE))
    2713     return FALSE;
     2713        return FALSE;
    27142714    if ((iImage!=-1) && ((iImage < 0) || (iImage > himl->cCurImage)))
    2715     return FALSE;
     2715        return FALSE;
    27162716    himl->nOvlIdx[iOverlay - 1] = iImage;
    27172717    return TRUE;
     
    27442744{
    27452745    if (!himl)
     2746        return FALSE;
     2747
     2748    FIXME("empty stub!\n");
     2749
    27462750    return FALSE;
    2747 
    2748     FIXME("empty stub!\n");
    2749 
    2750     return FALSE;
    2751 }
    2752 
     2751}
     2752
Note: See TracChangeset for help on using the changeset viewer.