Changeset 113:f353be82b6be

Show
Ignore:
Timestamp:
02/10/08 21:42:25 (1 year ago)
Author:
John Reimer <terminal.node@gmail.com
Children:

114:aa406905e538 115:640928daee8c

branch:
default
Message:

More "static if" changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/graphics/Cursor.d

    r48 r113  
    232232        if (width is 32 && height is 32) { 
    233233            auto hInst = OS.GetModuleHandle(null); 
    234             if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     234            static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    235235            handle = OS.CreateCursor(hInst, 5, 0, 32, 32, HAND_SOURCE.ptr, HAND_MASK.ptr); 
    236236 
     
    302302    /* Create the cursor */ 
    303303    auto hInst = OS.GetModuleHandle(null); 
    304     if (OS.IsWinCE) DWT.error (DWT.ERROR_NOT_IMPLEMENTED); 
     304    static if (OS.IsWinCE) DWT.error (DWT.ERROR_NOT_IMPLEMENTED); 
    305305    handle = OS.CreateCursor(hInst, hotspotX, hotspotY, source.width, source.height, sourceData.ptr, maskData.ptr); 
    306306    if (handle is null) DWT.error(DWT.ERROR_NO_HANDLES); 
     
    397397        * put the flag back in. 
    398398        */ 
    399         if (!OS.IsWinCE) OS.DestroyCursor(handle); 
     399        static if (!OS.IsWinCE) OS.DestroyCursor(handle); 
    400400    } 
    401401    handle = null; 
  • dwt/graphics/Device.d

    r84 r113  
    196196void checkGDIP() { 
    197197    if (gdipToken) return; 
    198     if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     198    static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    199199    int oldErrorMode = OS.SetErrorMode (OS.SEM_FAILCRITICALERRORS); 
    200200    try { 
     
    674674protected void init () { 
    675675    if (debug_) { 
    676         if (!OS.IsWinCE) OS.GdiSetBatchLimit(1); 
     676        static if (!OS.IsWinCE) OS.GdiSetBatchLimit(1); 
    677677    } 
    678678 
    679679    /* Initialize scripts list */ 
    680     if (!OS.IsWinCE) { 
     680    static if (!OS.IsWinCE) { 
    681681        SCRIPT_PROPERTIES** ppSp; 
    682682        int piNumScripts; 
     
    703703    int numEntries = OS.GetDeviceCaps (hDC, OS.SIZEPALETTE); 
    704704 
    705     if (OS.IsWinCE) { 
     705    static if (OS.IsWinCE) { 
    706706        /* 
    707707        * Feature on WinCE.  For some reason, certain 8 bit WinCE 
  • dwt/graphics/GC.d

    r81 r113  
    554554        * BitBlt and invalidate the appropriate source area. 
    555555        */ 
    556         if (res is 0 && OS.IsWinCE) { 
    557             OS.BitBlt(handle, destX, destY, width, height, handle, srcX, srcY, OS.SRCCOPY); 
    558             if (paint) { 
    559                 int deltaX = destX - srcX, deltaY = destY - srcY; 
    560                 bool disjoint = (destX + width < srcX) || (srcX + width < destX) || (destY + height < srcY) || (srcY + height < destY); 
    561                 if (disjoint) { 
    562                     OS.InvalidateRect(hwnd, &lprcScroll, true); 
    563                 } else { 
    564                     if (deltaX !is 0) { 
    565                         int newX = destX - deltaX; 
    566                         if (deltaX < 0) newX = destX + width; 
    567                         OS.SetRect(&lprcScroll, newX, srcY, newX + Math.abs(deltaX), srcY + height); 
     556        static if (OS.IsWinCE) { 
     557            if (res is 0) { 
     558                OS.BitBlt(handle, destX, destY, width, height, handle, srcX, srcY, OS.SRCCOPY); 
     559                if (paint) { 
     560                    int deltaX = destX - srcX, deltaY = destY - srcY; 
     561                    bool disjoint = (destX + width < srcX) || (srcX + width < destX) || (destY + height < srcY) || (srcY + height < destY); 
     562                    if (disjoint) { 
    568563                        OS.InvalidateRect(hwnd, &lprcScroll, true); 
    569                     } 
    570                     if (deltaY !is 0) { 
    571                         int newY = destY - deltaY; 
    572                         if (deltaY < 0) newY = destY + height; 
    573                         OS.SetRect(&lprcScroll, srcX, newY, srcX + width, newY + Math.abs(deltaY)); 
    574                         OS.InvalidateRect(hwnd, &lprcScroll, true); 
     564                    } else { 
     565                        if (deltaX !is 0) { 
     566                            int newX = destX - deltaX; 
     567                            if (deltaX < 0) newX = destX + width; 
     568                            OS.SetRect(&lprcScroll, newX, srcY, newX + Math.abs(deltaX), srcY + height); 
     569                            OS.InvalidateRect(hwnd, &lprcScroll, true); 
     570                        } 
     571                        if (deltaY !is 0) { 
     572                            int newY = destY - deltaY; 
     573                            if (deltaY < 0) newY = destY + height; 
     574                            OS.SetRect(&lprcScroll, srcX, newY, srcX + width, newY + Math.abs(deltaY)); 
     575                            OS.InvalidateRect(hwnd, &lprcScroll, true); 
     576                        } 
    575577                    } 
    576578                } 
     
    769771    * Polyline. 
    770772    */ 
    771     if (OS.IsWinCE) { 
     773    static if (OS.IsWinCE) { 
    772774        /* compute arc with a simple linear interpolation */ 
    773775        if (arcAngle < 0) { 
     
    10581060    /* Get the icon info */ 
    10591061    ICONINFO srcIconInfo; 
    1060     if (OS.IsWinCE) { 
     1062    static if (OS.IsWinCE) { 
    10611063        Image.GetIconInfo(srcImage, &srcIconInfo); 
    10621064    } else { 
     
    11101112            bool stretch = !simple && (srcWidth !is destWidth || srcHeight !is destHeight); 
    11111113            if (stretch) { 
    1112                 if (!OS.IsWinCE) OS.SetStretchBltMode(dstHdc, OS.COLORONCOLOR); 
     1114                static if (!OS.IsWinCE) OS.SetStretchBltMode(dstHdc, OS.COLORONCOLOR); 
    11131115                OS.StretchBlt(dstHdc, 0, 0, destWidth, destHeight, srcHdc, srcX, srcColorY, srcWidth, srcHeight, OS.SRCCOPY); 
    11141116            } else { 
     
    13371339        auto oldTempBitmap = OS.SelectObject(tempHdc, tempDib); 
    13381340        if (!simple && (srcWidth !is destWidth || srcHeight !is destHeight)) { 
    1339             if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc, OS.COLORONCOLOR); 
     1341            static if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc, OS.COLORONCOLOR); 
    13401342            OS.StretchBlt(tempHdc, 0, 0, destWidth, destHeight, memHdc, 0, 0, srcWidth, srcHeight, OS.SRCCOPY); 
    13411343        } else { 
     
    13481350    } else { 
    13491351        if (!simple && (srcWidth !is destWidth || srcHeight !is destHeight)) { 
    1350             if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc, OS.COLORONCOLOR); 
     1352            static if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc, OS.COLORONCOLOR); 
    13511353            OS.StretchBlt(memHdc, 0, 0, destWidth, destHeight, memHdc, 0, 0, srcWidth, srcHeight, OS.SRCCOPY); 
    13521354        } else { 
     
    14131415    OS.SelectClipRgn(handle, rgn); 
    14141416    int rop2 = 0; 
    1415     if (!OS.IsWinCE) { 
     1417    static if (!OS.IsWinCE) { 
    14161418        rop2 = OS.GetROP2(handle); 
    14171419    } else { 
     
    14221424    if (!simple && (srcWidth !is destWidth || srcHeight !is destHeight)) { 
    14231425        int mode = 0; 
    1424         if (!OS.IsWinCE) mode = OS.SetStretchBltMode(handle, OS.COLORONCOLOR); 
     1426        static if (!OS.IsWinCE) mode = OS.SetStretchBltMode(handle, OS.COLORONCOLOR); 
    14251427        OS.StretchBlt(handle, destX, destY, destWidth, destHeight, srcHdc, srcX, srcY, srcWidth, srcHeight, dwRop); 
    1426         if (!OS.IsWinCE) OS.SetStretchBltMode(handle, mode); 
     1428        static if (!OS.IsWinCE) OS.SetStretchBltMode(handle, mode); 
    14271429    } else { 
    14281430        OS.BitBlt(handle, destX, destY, destWidth, destHeight, srcHdc, srcX, srcY, dwRop); 
     
    14591461    if (!simple && (srcWidth !is destWidth || srcHeight !is destHeight)) { 
    14601462        int mode = 0; 
    1461         if (!OS.IsWinCE) mode = OS.SetStretchBltMode(handle, OS.COLORONCOLOR); 
     1463        static if (!OS.IsWinCE) mode = OS.SetStretchBltMode(handle, OS.COLORONCOLOR); 
    14621464        OS.StretchBlt(destHdc, x, y, destWidth, destHeight, srcHdc, srcX, srcColorY, srcWidth, srcHeight, OS.SRCINVERT); 
    14631465        OS.SelectObject(srcHdc, srcMask); 
     
    14651467        OS.SelectObject(srcHdc, srcColor); 
    14661468        OS.StretchBlt(destHdc, x, y, destWidth, destHeight, srcHdc, srcX, srcColorY, srcWidth, srcHeight, OS.SRCINVERT); 
    1467         if (!OS.IsWinCE) OS.SetStretchBltMode(handle, mode); 
     1469        static if (!OS.IsWinCE) OS.SetStretchBltMode(handle, mode); 
    14681470    } else { 
    14691471        OS.BitBlt(destHdc, x, y, destWidth, destHeight, srcHdc, srcX, srcColorY, OS.SRCINVERT); 
     
    14991501        if (isDib) { 
    15001502            /* Palette-based DIBSECTION */ 
    1501             if (OS.IsWinCE) { 
     1503            static if (OS.IsWinCE) { 
    15021504                byte* pBits = cast(byte*)bm.bmBits; 
    15031505                //OS.MoveMemory(pBits, bm.bmBits, 1); 
     
    15501552            byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + numColors * 4]; 
    15511553            bmi[] = (cast(byte*)&bmiHeader)[ 0 .. BITMAPINFOHEADER.sizeof ]; 
    1552             if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1554            static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    15531555            OS.GetDIBits(srcHdc, srcImage.handle, 0, 0, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    15541556            int offset = BITMAPINFOHEADER.sizeof + 4 * srcImage.transparentPixel; 
     
    16111613            OS.BitBlt(tempHdc, 0, 0, destWidth, destHeight, handle, destX, destY, OS.SRCCOPY); 
    16121614            if (!simple && (srcWidth !is destWidth || srcHeight !is destHeight)) { 
    1613                 if (!OS.IsWinCE) OS.SetStretchBltMode(tempHdc, OS.COLORONCOLOR); 
     1615                static if (!OS.IsWinCE) OS.SetStretchBltMode(tempHdc, OS.COLORONCOLOR); 
    16141616                OS.StretchBlt(tempHdc, 0, 0, destWidth, destHeight, srcHdc, srcX, srcY, srcWidth, srcHeight, OS.SRCINVERT); 
    16151617                OS.StretchBlt(tempHdc, 0, 0, destWidth, destHeight, maskHdc, srcX, srcY, srcWidth, srcHeight, OS.SRCAND); 
     
    16381640    auto oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle); 
    16391641    int rop2 = 0; 
    1640     if (!OS.IsWinCE) { 
     1642    static if (!OS.IsWinCE) { 
    16411643        rop2 = OS.GetROP2(handle); 
    16421644    } else { 
     
    16471649    if (!simple && (srcWidth !is destWidth || srcHeight !is destHeight)) { 
    16481650        int mode = 0; 
    1649         if (!OS.IsWinCE) mode = OS.SetStretchBltMode(handle, OS.COLORONCOLOR); 
     1651        static if (!OS.IsWinCE) mode = OS.SetStretchBltMode(handle, OS.COLORONCOLOR); 
    16501652        OS.StretchBlt(handle, destX, destY, destWidth, destHeight, srcHdc, srcX, srcY, srcWidth, srcHeight, dwRop); 
    1651         if (!OS.IsWinCE) OS.SetStretchBltMode(handle, mode); 
     1653        static if (!OS.IsWinCE) OS.SetStretchBltMode(handle, mode); 
    16521654    } else { 
    16531655        OS.BitBlt(handle, destX, destY, destWidth, destHeight, srcHdc, srcX, srcY, dwRop); 
     
    16861688        } 
    16871689    } 
    1688     if (OS.IsWinCE) { 
     1690    static if (OS.IsWinCE) { 
    16891691        int [] points = [x1, y1, x2, y2]; 
    16901692        OS.Polyline (handle, cast(POINT*)points.ptr, points.length / 2); 
     
    19861988        if (data.lineWidth !is 0 && data.lineWidth % 2 is 0) x--; 
    19871989    } 
    1988     if (OS.IsWinCE) { 
     1990    static if (OS.IsWinCE) { 
    19891991        /* 
    19901992        * Bug in WinCE PPC.  On certain devices, RoundRect does not draw 
     
    21772179    } 
    21782180    int rop2 = 0; 
    2179     if (OS.IsWinCE) { 
     2181    static if (OS.IsWinCE) { 
    21802182        rop2 = OS.SetROP2(handle, OS.R2_COPYPEN); 
    21812183        OS.SetROP2(handle, rop2); 
     
    24012403    } 
    24022404    int rop2 = 0; 
    2403     if (OS.IsWinCE) { 
     2405    static if (OS.IsWinCE) { 
    24042406        rop2 = OS.SetROP2(handle, OS.R2_COPYPEN); 
    24052407        OS.SetROP2(handle, rop2); 
     
    25182520    * WinCE SDK.  The fix is to emulate it by using Polygon. 
    25192521    */ 
    2520     if (OS.IsWinCE) { 
     2522    static if (OS.IsWinCE) { 
    25212523        /* compute arc with a simple linear interpolation */ 
    25222524        if (arcAngle < 0) { 
     
    26522654    */ 
    26532655    int rop2 = 0; 
    2654     if (OS.IsWinCE) { 
     2656    static if (OS.IsWinCE) { 
    26552657        rop2 = OS.SetROP2(handle, OS.R2_COPYPEN); 
    26562658        OS.SetROP2(handle, rop2); 
     
    28222824    } 
    28232825    int rop2 = 0; 
    2824     if (OS.IsWinCE) { 
     2826    static if (OS.IsWinCE) { 
    28252827        rop2 = OS.SetROP2(handle, OS.R2_COPYPEN); 
    28262828        OS.SetROP2(handle, rop2); 
     
    32683270public int getFillRule() { 
    32693271    if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    3270     if (OS.IsWinCE) return DWT.FILL_EVEN_ODD; 
     3272    static if (OS.IsWinCE) return DWT.FILL_EVEN_ODD; 
    32713273    return OS.GetPolyFillMode(handle) is OS.WINDING ? DWT.FILL_WINDING : DWT.FILL_EVEN_ODD; 
    32723274} 
     
    36143616    if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    36153617    int rop2 = 0; 
    3616     if (OS.IsWinCE) { 
     3618    static if (OS.IsWinCE) { 
    36173619        rop2 = OS.SetROP2 (handle, OS.R2_COPYPEN); 
    36183620        OS.SetROP2 (handle, rop2); 
     
    36923694        } 
    36933695        POINT pt; 
    3694         if (!OS.IsWinCE) OS.GetWindowOrgEx (handle, &pt); 
     3696        static if (!OS.IsWinCE) OS.GetWindowOrgEx (handle, &pt); 
    36953697        return Gdip.Matrix_new(-1, 0, 0, 1, width + 2 * pt.x, 0); 
    36963698    } 
     
    41494151public void setFillRule(int rule) { 
    41504152    if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    4151     if (OS.IsWinCE) return; 
     4153    static if (OS.IsWinCE) return; 
    41524154    int mode = OS.ALTERNATE; 
    41534155    switch (rule) { 
  • dwt/graphics/Image.d

    r95 r113  
    269269                    break; 
    270270                case DWT.ICON: 
    271                     if (OS.IsWinCE) { 
     271                    static if (OS.IsWinCE) { 
    272272                        init(device, srcImage.data); 
    273273                    } else { 
     
    984984            */ 
    985985            ICONINFO iconInfo; 
    986             if (OS.IsWinCE) { 
     986            static if (OS.IsWinCE) { 
    987987                GetIconInfo(this, &iconInfo); 
    988988            } else { 
     
    10541054    if (memGC !is null) memGC.dispose(); 
    10551055    if (type is DWT.ICON) { 
    1056         if (OS.IsWinCE) data = null; 
     1056        static if (OS.IsWinCE) data = null; 
    10571057        OS.DestroyIcon (handle); 
    10581058    } else { 
     
    11141114    int red = 0, green = 0, blue = 0; 
    11151115    if (bm.bmBitsPixel <= 8)  { 
    1116         if (OS.IsWinCE) { 
     1116        static if (OS.IsWinCE) { 
    11171117            byte[1] pBits; 
    11181118            OS.MoveMemory(pBits.ptr, bm.bmBits, 1); 
     
    11861186            return new Rectangle(0, 0, width = bm.bmWidth, height = bm.bmHeight); 
    11871187        case DWT.ICON: 
    1188             if (OS.IsWinCE) { 
     1188            static if (OS.IsWinCE) { 
    11891189                return new Rectangle(0, 0, width = data.width, height = data.height); 
    11901190            } else { 
     
    12261226    switch (type) { 
    12271227        case DWT.ICON: { 
    1228             if (OS.IsWinCE) return data; 
     1228            static if (OS.IsWinCE) return data; 
    12291229            ICONINFO info; 
    1230             if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1230            static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    12311231            OS.GetIconInfo(handle, &info); 
    12321232            /* Get the basic BITMAP information */ 
     
    12691269            int imageSize; 
    12701270            /* Call with null lpBits to get the image size */ 
    1271             if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1271            static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    12721272            OS.GetDIBits(hBitmapDC, hBitmap, 0, height, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    12731273            OS.MoveMemory(&bmiHeader, bmi.ptr, BITMAPINFOHEADER.sizeof); 
     
    12781278            auto lpvBits = cast(byte*) OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, imageSize); 
    12791279            if (lpvBits is null) DWT.error(DWT.ERROR_NO_HANDLES); 
    1280             if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1280            static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    12811281            OS.GetDIBits(hBitmapDC, hBitmap, 0, height, lpvBits, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    12821282            OS.MoveMemory(data.ptr, lpvBits, imageSize); 
     
    13051305            if (info.hbmColor is null) { 
    13061306                /* Do the bottom half of the mask */ 
    1307                 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1307                static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    13081308                OS.GetDIBits(hBitmapDC, hBitmap, height, height, lpvBits, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    13091309                OS.MoveMemory(maskData.ptr, lpvBits, imageSize); 
     
    13271327                OS.SelectObject(hBitmapDC, info.hbmMask); 
    13281328                /* Call with null lpBits to get the image size */ 
    1329                 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1329                static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    13301330                OS.GetDIBits(hBitmapDC, info.hbmMask, 0, height, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    13311331                OS.MoveMemory(&bmiHeader, bmi.ptr, BITMAPINFOHEADER.sizeof); 
     
    13341334                auto lpvMaskBits = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, imageSize); 
    13351335                if (lpvMaskBits is null) DWT.error(DWT.ERROR_NO_HANDLES); 
    1336                 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1336                static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    13371337                OS.GetDIBits(hBitmapDC, info.hbmMask, 0, height, lpvMaskBits, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    13381338                OS.MoveMemory(maskData.ptr, lpvMaskBits, imageSize); 
     
    13891389            */ 
    13901390            auto handle = this.handle; 
    1391             if (OS.IsWinCE) { 
     1391            static if (OS.IsWinCE) { 
    13921392                if (!isDib) { 
    13931393                    bool mustRestore = false; 
     
    14541454            } else { 
    14551455                /* Call with null lpBits to get the image size */ 
    1456                 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1456                static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    14571457                OS.GetDIBits(hBitmapDC, handle, 0, height, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    14581458                OS.MoveMemory(&bmiHeader, bmi.ptr, BITMAPINFOHEADER.sizeof); 
     
    14621462            /* Get the bitmap data */ 
    14631463            if (isDib) { 
    1464                 if (OS.IsWinCE && this.handle !is handle) { 
    1465                     /* get image data from the temporary DIB */ 
    1466                     OS.MoveMemory(data.ptr, dib.bmBits, imageSize); 
     1464                if (OS.IsWinCE) { 
     1465                    if (this.handle !is handle) { 
     1466                        /* get image data from the temporary DIB */ 
     1467                        OS.MoveMemory(data.ptr, dib.bmBits, imageSize); 
     1468                    } 
    14671469                } else { 
    14681470                    OS.MoveMemory(data.ptr, bm.bmBits, imageSize); 
     
    14721474                auto lpvBits = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, imageSize); 
    14731475                if (lpvBits is null) DWT.error(DWT.ERROR_NO_HANDLES); 
    1474                 if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     1476                static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    14751477                OS.GetDIBits(hBitmapDC, handle, 0, height, lpvBits, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 
    14761478                OS.MoveMemory(data.ptr, lpvBits, imageSize); 
     
    14821484                RGB[] rgbs = new RGB[numColors]; 
    14831485                if (isDib) { 
    1484                     if (OS.IsWinCE) { 
     1486                    static if (OS.IsWinCE) { 
    14851487                        /* 
    14861488                        * Feature on WinCE.  GetDIBColorTable is not supported. 
     
    15371539                OS.RealizePalette(hBitmapDC); 
    15381540            } 
    1539             if (OS.IsWinCE) { 
     1541            static if (OS.IsWinCE) { 
    15401542                if (handle !is this.handle) { 
    15411543                    /* free temporary DIB */ 
     
    16181620    bmiHeader.biPlanes = 1; 
    16191621    bmiHeader.biBitCount = cast(short)depth; 
    1620     if (OS.IsWinCE) bmiHeader.biCompression = OS.BI_BITFIELDS; 
     1622    static if (OS.IsWinCE) bmiHeader.biCompression = OS.BI_BITFIELDS; 
    16211623    else bmiHeader.biCompression = OS.BI_RGB; 
    16221624    byte[] bmi = new byte[BITMAPINFOHEADER.sizeof + (OS.IsWinCE ? 12 : 0)]; 
    16231625    OS.MoveMemory(bmi.ptr, &bmiHeader, BITMAPINFOHEADER.sizeof); 
    16241626    /* Set the rgb colors into the bitmap info */ 
    1625     if (OS.IsWinCE) { 
     1627    static if (OS.IsWinCE) { 
    16261628        int redMask = 0xFF00; 
    16271629        int greenMask = 0xFF0000; 
     
    18731875            image.handle = hIcon; 
    18741876            image.type = DWT.ICON; 
    1875             if (OS.IsWinCE) image.data = i; 
     1877            static if (OS.IsWinCE) image.data = i; 
    18761878        } 
    18771879    } else { 
     
    20862088    * Note.  Not implemented on WinCE. 
    20872089    */ 
    2088     if (OS.IsWinCE) return; 
     2090    static if (OS.IsWinCE) return; 
    20892091    if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    20902092    if (color is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
     
    21022104    int maxColors = 1 << bm.bmBitsPixel; 
    21032105    byte[] colors = new byte[maxColors * 4]; 
    2104     if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     2106    static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    21052107    int numColors = OS.GetDIBColorTable(hdcMem, 0, maxColors, cast(RGBQUAD*)colors.ptr); 
    21062108    int offset = transparentPixel * 4; 
     
    21082110    colors[offset + 1] = cast(byte)color.getGreen(); 
    21092111    colors[offset + 2] = cast(byte)color.getRed(); 
    2110     if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     2112    static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    21112113    OS.SetDIBColorTable(hdcMem, 0, numColors, cast(RGBQUAD*)colors.ptr); 
    21122114    OS.DeleteDC(hdcMem); 
  • dwt/graphics/Region.d

    r48 r113  
    120120    if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    121121    if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    122     if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     122    static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    123123    auto polyRgn = OS.CreatePolygonRgn(cast(POINT*)pointArray.ptr, pointArray.length / 2, OS.ALTERNATE); 
    124124    OS.CombineRgn (handle, handle, polyRgn, OS.RGN_OR); 
     
    468468    if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 
    469469    if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    470     if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
     470    static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    471471    auto polyRgn = OS.CreatePolygonRgn(cast(POINT*)pointArray.ptr, pointArray.length / 2, OS.ALTERNATE); 
    472472    OS.CombineRgn (handle, handle, polyRgn, OS.RGN_DIFF); 
  • dwt/internal/ImageList.d

    r33 r113  
    3535    this.style = style; 
    3636    int flags = OS.ILC_MASK; 
    37     if (OS.IsWinCE) { 
     37    static if (OS.IsWinCE) { 
    3838        flags |= OS.ILC_COLOR; 
    3939    } else { 
     
    120120        //OS.MoveMemory(bmi, bmiHeader, BITMAPINFOHEADER.sizeof); 
    121121        /* Set the rgb colors into the bitmap info */ 
    122         if (OS.IsWinCE) { 
     122        static if (OS.IsWinCE) { 
    123123            int redMask = 0xFF00; 
    124124            int greenMask = 0xFF0000; 
     
    146146    OS.SelectObject (hdc2, hBitmap); 
    147147    if (width !is bm.bmWidth || height !is bm.bmHeight) { 
    148         if (!OS.IsWinCE) OS.SetStretchBltMode(hdc2, OS.COLORONCOLOR); 
     148        static if (!OS.IsWinCE) OS.SetStretchBltMode(hdc2, OS.COLORONCOLOR); 
    149149        OS.StretchBlt (hdc2, 0, 0, width, height, hdc1, 0, 0, bm.bmWidth, bm.bmHeight, OS.SRCCOPY); 
    150150    } else { 
     
    242242        auto memHdc2 = OS.CreateCompatibleDC (hdc); 
    243243        auto oldMemBitmap2 = OS.SelectObject (memHdc2, memDib2); 
    244         if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc2, OS.COLORONCOLOR); 
     244        static if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc2, OS.COLORONCOLOR); 
    245245        OS.StretchBlt (memHdc2, 0, 0, destWidth, destHeight, memHdc, 0, 0, srcWidth, srcHeight, OS.SRCCOPY); 
    246246        OS.SelectObject (memHdc2, oldMemBitmap2); 
     
    280280        auto hMask2 = OS.CreateBitmap (destWidth, destHeight, 1, 1, null); 
    281281        OS.SelectObject (hdc2, hMask2); 
    282         if (!OS.IsWinCE) OS.SetStretchBltMode(hdc2, OS.COLORONCOLOR); 
     282        static if (!OS.IsWinCE) OS.SetStretchBltMode(hdc2, OS.COLORONCOLOR); 
    283283        OS.StretchBlt (hdc2, 0, 0, destWidth, destHeight, hdc1, 0, 0, srcWidth, srcHeight, OS.SRCCOPY); 
    284284        OS.DeleteDC (hdc1); 
     
    331331        OS.SelectObject (hdc2, hMask); 
    332332        if (destWidth !is srcWidth || destHeight !is srcHeight) { 
    333             if (!OS.IsWinCE) OS.SetStretchBltMode (hdc2, OS.COLORONCOLOR); 
     333            static if (!OS.IsWinCE) OS.SetStretchBltMode (hdc2, OS.COLORONCOLOR); 
    334334            OS.StretchBlt (hdc2, 0, 0, destWidth, destHeight, hdc1, 0, 0, srcWidth, srcHeight, OS.SRCCOPY); 
    335335        } else { 
     
    448448        } 
    449449        case DWT.ICON: { 
    450             if (OS.IsWinCE) { 
     450            static if (OS.IsWinCE) { 
    451451                OS.ImageList_ReplaceIcon (handle, index is count ? -1 : index, hImage); 
    452452            } else { 
  • dwt/ole/win32/OleFrame.d

    r98 r113  
    244244                        case OS.WM_KEYDOWN: 
    245245                        case OS.WM_SYSKEYDOWN: { 
    246                             if (!OS.IsWinCE) { 
     246                            static if (!OS.IsWinCE) { 
    247247                                switch (msg.wParam) { 
    248248                                    case OS.VK_SHIFT: 
  • dwt/widgets/Canvas.d

    r108 r113  
    198198    OS.GetClientRect (handle, &clientRect); 
    199199    if (OS.IntersectRect (&clientRect, &sourceRect, &clientRect)) { 
    200         if (OS.IsWinCE) { 
     200        static if (OS.IsWinCE) { 
    201201            OS.UpdateWindow (handle); 
    202202        } else { 
     
    207207    int deltaX = destX - x, deltaY = destY - y; 
    208208    if (findImageControl () !is null) { 
    209         if (OS.IsWinCE) { 
     209        static if (OS.IsWinCE) { 
    210210            OS.InvalidateRect (handle, &sourceRect, true); 
    211211        } else { 
     
    215215        } 
    216216        OS.OffsetRect (&sourceRect, deltaX, deltaY); 
    217         if (OS.IsWinCE) { 
     217        static if (OS.IsWinCE) { 
    218218            OS.InvalidateRect (handle, &sourceRect, true); 
    219219        } else { 
  • dwt/widgets/Combo.d

    r108 r113  
    16091609public void setOrientation (int orientation) { 
    16101610    checkWidget(); 
    1611     if (OS.IsWinCE) return; 
     1611    static if (OS.IsWinCE) return; 
    16121612    if (OS.WIN32_VERSION < OS.VERSION (4, 10)) return; 
    16131613    int flags = DWT.RIGHT_TO_LEFT | DWT.LEFT_TO_RIGHT; 
     
    21732173        LRESULT result = super.WM_SIZE (wParam, lParam); 
    21742174        if (OS.IsWindowVisible (handle)) { 
    2175             if (OS.IsWinCE) { 
     2175            static if (OS.IsWinCE) { 
    21762176                auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 
    21772177                if (hwndText !is null) OS.InvalidateRect (hwndText, null, true); 
  • dwt/widgets/Composite.d

    r108 r113  
    761761        if (processID is OS.GetCurrentProcessId ()) { 
    762762            if (display.msgHook is null) { 
    763                 if (!OS.IsWinCE) { 
     763                static if (!OS.IsWinCE) { 
    764764                    //display.getMsgCallback = new Callback (display, "getMsgProc", 3); 
    765765                    //display.getMsgProc = display.getMsgCallback.getAddress (); 
     
    11381138    /* Set the clipping bits */ 
    11391139    int oldBits = 0, newBits = 0; 
    1140     if (!OS.IsWinCE) { 
     1140    static if (!OS.IsWinCE) { 
    11411141        oldBits = OS.GetWindowLong (handle, OS.GWL_STYLE); 
    11421142        newBits = oldBits | OS.WS_CLIPSIBLINGS | OS.WS_CLIPCHILDREN; 
     
    14481448    * redraw the non-client area. 
    14491449    */ 
    1450     if (!OS.IsWinCE) { 
     1450    static if (!OS.IsWinCE) { 
    14511451        int cmd = wParam & 0xFFF0; 
    14521452        switch (cmd) { 
     
    15031503 
    15041504override LRESULT wmNotify (NMHDR* hdr, int wParam, int lParam) { 
    1505     if (!OS.IsWinCE) { 
     1505    static if (!OS.IsWinCE) { 
    15061506        switch (hdr.code) { 
    15071507            /* 
  • dwt/widgets/CoolBar.d

    r108 r113  
    761761    */ 
    762762    if (!OS.IsWindowVisible (handle)) return; 
    763     if (OS.IsWinCE) { 
     763    static if (OS.IsWinCE) { 
    764764        OS.InvalidateRect (handle, null, true); 
    765765    } else { 
  • dwt/widgets/Decorations.d

    r108 r113  
    183183void _setMaximized (bool maximized) { 
    184184    swFlags = maximized ? OS.SW_SHOWMAXIMIZED : OS.SW_RESTORE; 
    185     if (OS.IsWinCE) { 
     185    static if (OS.IsWinCE) { 
    186186        /* 
    187187        * Note: WinCE does not support SW_SHOWMAXIMIZED and SW_RESTORE. The 
     
    213213 
    214214void _setMinimized (bool minimized) { 
    215     if (OS.IsWinCE) return; 
     215    static if (OS.IsWinCE) return; 
    216216    swFlags = minimized ? OS.SW_SHOWMINNOACTIVE : OS.SW_RESTORE; 
    217217    if (!OS.IsWindowVisible (handle)) return; 
     
    261261        style &= ~(DWT.CLOSE | DWT.TITLE | DWT.MIN | DWT.MAX | DWT.RESIZE | DWT.BORDER); 
    262262    } 
    263     if (OS.IsWinCE) { 
     263    static if (OS.IsWinCE) { 
    264264        /* 
    265265        * Feature in WinCE PPC.  WS_MINIMIZEBOX or WS_MAXIMIZEBOX 
     
    457457    */ 
    458458    if ((state & FOREIGN_HANDLE) is 0) { 
    459         if (!OS.IsWinCE) { 
     459        static if (!OS.IsWinCE) { 
    460460            auto hIcon = OS.LoadIcon (null, cast(wchar*)OS.IDI_APPLICATION); 
    461461            OS.SendMessage (handle, OS.WM_SETICON, OS.ICON_SMALL, hIcon); 
     
    521521override public Rectangle getBounds () { 
    522522    checkWidget (); 
    523     if (!OS.IsWinCE) { 
     523    static if (!OS.IsWinCE) { 
    524524        if (OS.IsIconic (handle)) { 
    525525            WINDOWPLACEMENT lpwndpl; 
     
    665665override public Point getLocation () { 
    666666    checkWidget (); 
    667     if (!OS.IsWinCE) { 
     667    static if (!OS.IsWinCE) { 
    668668        if (OS.IsIconic (handle)) { 
    669669            WINDOWPLACEMENT lpwndpl; 
     
    868868 
    869869override void setBounds (int x, int y, int width, int height, int flags, bool defer) { 
    870     if (OS.IsWinCE) { 
     870    static if (OS.IsWinCE) { 
    871871        swFlags = OS.SW_RESTORE; 
    872872    } else { 
     
    989989    * On WinCE PPC, icons in windows are not displayed. 
    990990    */ 
    991     if (OS.IsWinCE) return; 
     991    static if (OS.IsWinCE) return; 
    992992    if (smallImage !is null) smallImage.dispose (); 
    993993    if (largeImage !is null) largeImage.dispose (); 
     
    10661066    * The fix is to force a redraw. 
    10671067    */ 
    1068     if (!OS.IsWinCE) { 
     1068    static if (!OS.IsWinCE) { 
    10691069        if (hSmallIcon is null && hLargeIcon is null && (style & DWT.BORDER) !is 0) { 
    10701070            int flags = OS.RDW_FRAME | OS.RDW_INVALIDATE; 
  • dwt/widgets/Display.d

    r82 r113  
    654654 
    655655int asciiKey (int key) { 
    656     if (OS.IsWinCE) return 0; 
     656    static if (OS.IsWinCE) return 0; 
    657657 
    658658    /* Get the current keyboard. */ 
     
    11031103        auto hMask2 = OS.CreateBitmap (destWidth, destHeight, 1, 1, null); 
    11041104        OS.SelectObject (hdc2, hMask2); 
    1105         if (!OS.IsWinCE) OS.SetStretchBltMode(hdc2, OS.COLORONCOLOR); 
     1105        static if (!OS.IsWinCE) OS.SetStretchBltMode(hdc2, OS.COLORONCOLOR); 
    11061106        OS.StretchBlt (hdc2, 0, 0, destWidth, destHeight, hdc1, 0, 0, srcWidth, srcHeight, OS.SRCCOPY); 
    11071107        OS.DeleteDC (hdc1); 
     
    23182318    if (systemFont !is null) return systemFont; 
    23192319    HFONT hFont; 
    2320     if (!OS.IsWinCE) { 
     2320    static if (!OS.IsWinCE) { 
    23212321        NONCLIENTMETRICS info; 
    23222322        info.cbSize = NONCLIENTMETRICS.sizeof; 
     
    24022402    checkDevice (); 
    24032403    if (tray !is null) return tray; 
    2404     if (!OS.IsWinCE) tray = new Tray (this, DWT.NONE); 
     2404    static if (!OS.IsWinCE) tray = new Tray (this, DWT.NONE); 
    24052405    return tray; 
    24062406} 
     
    28772877                    case OS.WM_KEYDOWN: 
    28782878                    case OS.WM_SYSKEYDOWN: { 
    2879                         if (!OS.IsWinCE) { 
     2879                        static if (!OS.IsWinCE) { 
    28802880                            switch (keyMsg.wParam) { 
    28812881                                case OS.VK_SHIFT: 
     
    32493249                    case DWT.LF: return false; 
    32503250                    default: { 
    3251                         if (OS.IsWinCE) { 
     3251                        static if (OS.IsWinCE) { 
    32523252                            inputs.wVk = cast(int)OS.CharUpper (cast(wchar*) key); 
    32533253                        } else { 
     
    34933493 
    34943494    /* Unhook the idle hook */ 
    3495     if (!OS.IsWinCE) { 
     3495    static if (!OS.IsWinCE) { 
    34963496        if (idleHook !is null) OS.UnhookWindowsHookEx (idleHook); 
    34973497        idleHook = null; 
     
    38693869    } 
    38703870    if (systemFont !is null) { 
    3871         if (!OS.IsWinCE) { 
     3871        static if (!OS.IsWinCE) { 
    38723872            NONCLIENTMETRICS info; 
    38733873            info.cbSize = NONCLIENTMETRICS.sizeof; 
     
    41384138 
    41394139int shiftedKey (int key) { 
    4140     if (OS.IsWinCE) return 0; 
     4140    static if (OS.IsWinCE) return 0; 
    41414141 
    41424142    /* Clear the virtual keyboard and press the shift key */ 
     
    44034403 
    44044404void wakeThread () { 
    4405     if (OS.IsWinCE) { 
     4405    static if (OS.IsWinCE) { 
    44064406        OS.PostMessage