Changeset 15

Show
Ignore:
Timestamp:
05/18/04 02:28:11 (5 years ago)
Author:
brad
Message:

Used DMD 0.89 to continue the Forward References battle. Also got rid of C-style casts that the compiler was barfing on. Got rid of some junk, like the 'all.d' files in each folder. Also, began using SCons as the build tool. Implemented more of the widget files, and stopped when trying to compile widget.d outside of Eclipse at a prompt. Start there.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.1/src/dwt/graphics/color.d

    r11 r15  
    149149    if (object == this) return true; 
    150150// TODO: deal with instanceof       if (!(object instanceof Color)) return false; 
    151     Color color = (Color) object; 
     151    Color color = cast(Color) object; 
    152152    return device == color.device && (handle & 0xFFFFFF) == (color.handle & 0xFFFFFF); 
    153153} 
     
    254254    byte[] entry = new byte[4]; 
    255255    OS.GetPaletteEntries(hPal, index, 1, entry); 
    256     if ((entry[0] == (byte)red) && (entry[1] == (byte)green) && 
    257         (entry[2] == (byte)blue)) { 
     256    if ((entry[0] == cast(byte)red) && (entry[1] == cast(byte)green) && 
     257        (entry[2] == cast(byte)blue)) { 
    258258            /* Found the color. Increment the ref count and return */ 
    259259            colorRefCount[index]++; 
  • branches/0.1/src/dwt/graphics/cursor.d

    r3 r15  
    5555     */ 
    5656    static final byte[] HAND_SOURCE = [ 
    57         (byte)0xf9,(byte)0xff,(byte)0xff,(byte)0xff, 
    58         (byte)0xf0,(byte)0xff,(byte)0xff,(byte)0xff, 
    59         (byte)0xf0,(byte)0xff,(byte)0xff,(byte)0xff, 
    60         (byte)0xf0,(byte)0xff,(byte)0xff,(byte)0xff, 
    61         (byte)0xf0,(byte)0x3f,(byte)0xff,(byte)0xff, 
    62         (byte)0xf0,(byte)0x07,(byte)0xff,(byte)0xff, 
    63         (byte)0xf0,(byte)0x03,(byte)0xff,(byte)0xff, 
    64         (byte)0xf0,(byte)0x00,(byte)0xff,(byte)0xff, 
    65  
    66         (byte)0x10,(byte)0x00,(byte)0x7f,(byte)0xff, 
    67         (byte)0x00,(byte)0x00,(byte)0x7f,(byte)0xff, 
    68         (byte)0x80,(byte)0x00,(byte)0x7f,(byte)0xff, 
    69         (byte)0xc0,(byte)0x00,(byte)0x7f,(byte)0xff, 
    70         (byte)0xe0,(byte)0x00,(byte)0x7f,(byte)0xff, 
    71         (byte)0xf0,(byte)0x00,(byte)0x7f,(byte)0xff, 
    72         (byte)0xf8,(byte)0x00,(byte)0xff,(byte)0xff, 
    73         (byte)0xfc,(byte)0x01,(byte)0xff,(byte)0xff, 
    74  
    75         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    76         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    77         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    78         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    79         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    80         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    81         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    82         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    83  
    84         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    85         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    86         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    87         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    88         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    89         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    90         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff, 
    91         (byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff 
     57        cast(byte)0xf9,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     58        cast(byte)0xf0,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     59        cast(byte)0xf0,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     60        cast(byte)0xf0,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     61        cast(byte)0xf0,cast(byte)0x3f,cast(byte)0xff,cast(byte)0xff, 
     62        cast(byte)0xf0,cast(byte)0x07,cast(byte)0xff,cast(byte)0xff, 
     63        cast(byte)0xf0,cast(byte)0x03,cast(byte)0xff,cast(byte)0xff, 
     64        cast(byte)0xf0,cast(byte)0x00,cast(byte)0xff,cast(byte)0xff, 
     65 
     66        cast(byte)0x10,cast(byte)0x00,cast(byte)0x7f,cast(byte)0xff, 
     67        cast(byte)0x00,cast(byte)0x00,cast(byte)0x7f,cast(byte)0xff, 
     68        cast(byte)0x80,cast(byte)0x00,cast(byte)0x7f,cast(byte)0xff, 
     69        cast(byte)0xc0,cast(byte)0x00,cast(byte)0x7f,cast(byte)0xff, 
     70        cast(byte)0xe0,cast(byte)0x00,cast(byte)0x7f,cast(byte)0xff, 
     71        cast(byte)0xf0,cast(byte)0x00,cast(byte)0x7f,cast(byte)0xff, 
     72        cast(byte)0xf8,cast(byte)0x00,cast(byte)0xff,cast(byte)0xff, 
     73        cast(byte)0xfc,cast(byte)0x01,cast(byte)0xff,cast(byte)0xff, 
     74 
     75        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     76        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     77        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     78        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     79        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     80        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     81        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     82        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     83 
     84        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     85        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     86        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     87        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     88        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     89        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     90        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff, 
     91        cast(byte)0xff,cast(byte)0xff,cast(byte)0xff,cast(byte)0xff 
    9292    ]; 
    9393    static final byte[] HAND_MASK = [ 
    94         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    95         (byte)0x06,(byte)0x00,(byte)0x00,(byte)0x00, 
    96         (byte)0x06,(byte)0x00,(byte)0x00,(byte)0x00, 
    97         (byte)0x06,(byte)0x00,(byte)0x00,(byte)0x00, 
    98         (byte)0x06,(byte)0x00,(byte)0x00,(byte)0x00, 
    99         (byte)0x06,(byte)0xc0,(byte)0x00,(byte)0x00, 
    100         (byte)0x06,(byte)0xd8,(byte)0x00,(byte)0x00, 
    101         (byte)0x06,(byte)0xd8,(byte)0x00,(byte)0x00, 
    102  
    103         (byte)0x07,(byte)0xdb,(byte)0x00,(byte)0x00, 
    104         (byte)0x67,(byte)0xfb,(byte)0x00,(byte)0x00, 
    105         (byte)0x3f,(byte)0xff,(byte)0x00,(byte)0x00, 
    106         (byte)0x1f,(byte)0xff,(byte)0x00,(byte)0x00, 
    107         (byte)0x0f,(byte)0xff,(byte)0x00,(byte)0x00, 
    108         (byte)0x07,(byte)0xff,(byte)0x00,(byte)0x00, 
    109         (byte)0x03,(byte)0xfe,(byte)0x00,(byte)0x00, 
    110         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    111  
    112         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    113         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    114         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    115         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    116         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    117         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    118         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    119         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    120  
    121         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    122         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    123         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    124         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    125         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    126         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    127         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, 
    128         (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00 
     94        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     95        cast(byte)0x06,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     96        cast(byte)0x06,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     97        cast(byte)0x06,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     98        cast(byte)0x06,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     99        cast(byte)0x06,cast(byte)0xc0,cast(byte)0x00,cast(byte)0x00, 
     100        cast(byte)0x06,cast(byte)0xd8,cast(byte)0x00,cast(byte)0x00, 
     101        cast(byte)0x06,cast(byte)0xd8,cast(byte)0x00,cast(byte)0x00, 
     102 
     103        cast(byte)0x07,cast(byte)0xdb,cast(byte)0x00,cast(byte)0x00, 
     104        cast(byte)0x67,cast(byte)0xfb,cast(byte)0x00,cast(byte)0x00, 
     105        cast(byte)0x3f,cast(byte)0xff,cast(byte)0x00,cast(byte)0x00, 
     106        cast(byte)0x1f,cast(byte)0xff,cast(byte)0x00,cast(byte)0x00, 
     107        cast(byte)0x0f,cast(byte)0xff,cast(byte)0x00,cast(byte)0x00, 
     108        cast(byte)0x07,cast(byte)0xff,cast(byte)0x00,cast(byte)0x00, 
     109        cast(byte)0x03,cast(byte)0xfe,cast(byte)0x00,cast(byte)0x00, 
     110        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     111 
     112        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     113        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     114        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     115        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     116        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     117        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     118        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     119        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     120 
     121        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     122        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     123        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     124        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     125        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     126        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     127        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00, 
     128        cast(byte)0x00,cast(byte)0x00,cast(byte)0x00,cast(byte)0x00 
    129129    ]; 
    130130 
  • branches/0.1/src/dwt/graphics/font.d

    r11 r15  
    162162    if (object == this) return true; 
    163163// TODO: instanceof     if (!(object instanceof Font)) return false; 
    164     Font font = (Font) object; 
     164    Font font = cast(Font) object; 
    165165    return device == font.device && handle == font.handle; 
    166166} 
  • branches/0.1/src/dwt/graphics/fontdata.d

    r11 r15  
    258258    if (object == this) return true; 
    259259// TODO: instanceof     if (!(object instanceof FontData)) return false; 
    260     FontData fd = (FontData)object; 
     260    FontData fd = cast(FontData)object; 
    261261    LOGFONT* lf = fd.data; 
    262262    return data.lfCharSet == lf.lfCharSet && 
     
    309309    int [] lpCs = new int[8]; 
    310310    OS.TranslateCharsetInfo(cp, lpCs, OS.TCI_SRCCODEPAGE); 
    311     data.lfCharSet = (byte)lpCs[0]; 
     311    data.lfCharSet = cast(byte)lpCs[0]; 
    312312        return 0; 
    313313} 
  • branches/0.1/src/dwt/graphics/gc.d

    r12 r15  
    2626    import dwt.graphics.rgb; 
    2727 
    28     import dwt.util.util; 
    29  
    30     import dwt.internal.win32.all; 
    3128    import dwt.internal.compatibility; 
     29 
     30    import dwt.internal.win32.iconinfo; 
     31    import dwt.internal.win32.os; 
     32    import dwt.internal.win32.rect; 
     33    import dwt.internal.win32.tchar; 
     34    import dwt.internal.win32.textmetric; 
     35    import dwt.internal.win32.types; 
     36     
    3237    import dwt.util.util; 
    3338 
     
    841846                byte oldValue = pBits[0]; 
    842847                int mask = (0xFF << (8 - bm.bmBitsPixel)) & 0x00FF; 
    843                 pBits[0] = (byte)((srcImage.transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask)); 
     848                pBits[0] = cast(byte)((srcImage.transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask)); 
    844849                OS.MoveMemory(bm.bmBits, pBits, 1); 
    845850                int color = OS.GetPixel(srcHdc, 0, 0); 
     
    856861                byte[] newColors = new byte[oldColors.length]; 
    857862                transRed = transGreen = transBlue = 0xff; 
    858                 newColors[offset] = (byte)transBlue; 
    859                 newColors[offset+1] = (byte)transGreen; 
    860                 newColors[offset+2] = (byte)transRed; 
     863                newColors[offset] = cast(byte)transBlue; 
     864                newColors[offset+1] = cast(byte)transGreen; 
     865                newColors[offset+2] = cast(byte)transRed; 
    861866                OS.SetDIBColorTable(srcHdc, 0, maxColors, newColors); 
    862867                originalColors = oldColors; 
     
    16521657        trivertex[0].x = x; 
    16531658        trivertex[0].y = y; 
    1654         trivertex[0].Red = (short)((fromRGB.red << 8) | fromRGB.red); 
    1655         trivertex[0].Green = (short)((fromRGB.green << 8) | fromRGB.green); 
    1656         trivertex[0].Blue = (short)((fromRGB.blue << 8) | fromRGB.blue); 
     1659        trivertex[0].Red = cast(short)((fromRGB.red << 8) | fromRGB.red); 
     1660        trivertex[0].Green = cast(short)((fromRGB.green << 8) | fromRGB.green); 
     1661        trivertex[0].Blue = cast(short)((fromRGB.blue << 8) | fromRGB.blue); 
    16571662        trivertex[0].Alpha = -1; 
    16581663        //OS.MoveMemory(pVertex, trivertex, TRIVERTEX.sizeof); 
     
    16601665        trivertex[1].x = x + width; 
    16611666        trivertex[1].y = y + height; 
    1662         trivertex[1].Red = (short)((toRGB.red << 8) | toRGB.red); 
    1663         trivertex[1].Green = (short)((toRGB.green << 8) | toRGB.green); 
    1664         trivertex[1].Blue = (short)((toRGB.blue << 8) | toRGB.blue); 
     1667        trivertex[1].Red = cast(short)((toRGB.red << 8) | toRGB.red); 
     1668        trivertex[1].Green = cast(short)((toRGB.green << 8) | toRGB.green); 
     1669        trivertex[1].Blue = cast(short)((toRGB.blue << 8) | toRGB.blue); 
    16651670        trivertex[1].Alpha = -1; 
    16661671        //OS.MoveMemory(pVertex + TRIVERTEX.sizeof, trivertex, TRIVERTEX.sizeof); 
  • branches/0.1/src/dwt/graphics/image.d

    r12 r15  
    281281            /*byte[] rgbBwBitmapInfo = { 
    282282                40,0,0,0, //  biSize 
    283                 (byte)(r.width & 0xFF), //  biWidth 
    284                 (byte)((r.width & 0xFF00) >> 8), 
    285                 (byte)((r.width & 0xFF0000) >> 16), 
    286                 (byte)((r.width & 0xFF000000) >> 24), 
    287                 (byte)(r.height & 0xFF), //  biHeight 
    288                 (byte)((r.height & 0xFF00) >> 8), 
    289                 (byte)((r.height & 0xFF0000) >> 16), 
    290                 (byte)((r.height & 0xFF000000) >> 24), 
     283                cast(byte)(r.width & 0xFF), //  biWidth 
     284                cast(byte)((r.width & 0xFF00) >> 8), 
     285                cast(byte)((r.width & 0xFF0000) >> 16), 
     286                cast(byte)((r.width & 0xFF000000) >> 24), 
     287                cast(byte)(r.height & 0xFF), //  biHeight 
     288                cast(byte)((r.height & 0xFF00) >> 8), 
     289                cast(byte)((r.height & 0xFF0000) >> 16), 
     290                cast(byte)((r.height & 0xFF000000) >> 24), 
    291291                1,0, //  biPlanes 
    292292                1,0, //  biBitCount 
     
    298298                0,0,0,0, //  biClrImportant 
    299299                0,0,0,0, //  First color: black 
    300                 (byte)0xFF,(byte)0xFF,(byte)0xFF,0 //  Second color: white 
     300                cast(byte)0xFF,cast(byte)0xFF,cast(byte)0xFF,0 //  Second color: white 
    301301            };*/ 
    302302 
     
    512512                        blue = (blueShift < 0) ? blue >>> -blueShift : blue << blueShift; 
    513513                        newData.data[offset++] = 
    514                             (byte)((red+red+green+green+green+green+green+blue) >> 3); 
     514                            cast(byte)((red+red+green+green+green+green+green+blue) >> 3); 
    515515                    } 
    516516                } 
     
    782782    bmiHeader.biHeight = -height; 
    783783    bmiHeader.biPlanes = 1; 
    784     bmiHeader.biBitCount = (short)depth; 
     784    bmiHeader.biBitCount = cast(short)depth; 
    785785    if (useBitfields) bmiHeader.biCompression = OS.BI_BITFIELDS; 
    786786    else bmiHeader.biCompression = OS.BI_RGB; 
     
    799799                    blueMask = 0x1F; 
    800800                    //  little endian 
    801                     bmi[offset] = (byte)((redMask & 0xFF) >> 0); 
    802                     bmi[offset + 1] = (byte)((redMask & 0xFF00) >> 8); 
    803                     bmi[offset + 2] = (byte)((redMask & 0xFF0000) >> 16); 
    804                     bmi[offset + 3] = (byte)((redMask & 0xFF000000) >> 24); 
    805                     bmi[offset + 4] = (byte)((greenMask & 0xFF) >> 0); 
    806                     bmi[offset + 5] = (byte)((greenMask & 0xFF00) >> 8); 
    807                     bmi[offset + 6] = (byte)((greenMask & 0xFF0000) >> 16); 
    808                     bmi[offset + 7] = (byte)((greenMask & 0xFF000000) >> 24); 
    809                     bmi[offset + 8] = (byte)((blueMask & 0xFF) >> 0); 
    810                     bmi[offset + 9] = (byte)((blueMask & 0xFF00) >> 8); 
    811                     bmi[offset + 10] = (byte)((blueMask & 0xFF0000) >> 16); 
    812                     bmi[offset + 11] = (byte)((blueMask & 0xFF000000) >> 24); 
     801                    bmi[offset] = cast(byte)((redMask & 0xFF) >> 0); 
     802                    bmi[offset + 1] = cast(byte)((redMask & 0xFF00) >> 8); 
     803                    bmi[offset + 2] = cast(byte)((redMask & 0xFF0000) >> 16); 
     804                    bmi[offset + 3] = cast(byte)((redMask & 0xFF000000) >> 24); 
     805                    bmi[offset + 4] = cast(byte)((greenMask & 0xFF) >> 0); 
     806                    bmi[offset + 5] = cast(byte)((greenMask & 0xFF00) >> 8); 
     807                    bmi[offset + 6] = cast(byte)((greenMask & 0xFF0000) >> 16); 
     808                    bmi[offset + 7] = cast(byte)((greenMask & 0xFF000000) >> 24); 
     809                    bmi[offset + 8] = cast(byte)((blueMask & 0xFF) >> 0); 
     810                    bmi[offset + 9] = cast(byte)((blueMask & 0xFF00) >> 8); 
     811                    bmi[offset + 10] = cast(byte)((blueMask & 0xFF0000) >> 16); 
     812                    bmi[offset + 11] = cast(byte)((blueMask & 0xFF000000) >> 24); 
    813813                    break; 
    814814                case 32: 
     
    817817                    blueMask = 0xFF000000; 
    818818                    //  big endian 
    819                     bmi[offset] = (byte)((redMask & 0xFF000000) >> 24); 
    820                     bmi[offset + 1] = (byte)((redMask & 0xFF0000) >> 16); 
    821                     bmi[offset + 2] = (byte)((redMask & 0xFF00) >> 8); 
    822                     bmi[offset + 3] = (byte)((redMask & 0xFF) >> 0); 
    823                     bmi[offset + 4] = (byte)((greenMask & 0xFF000000) >> 24); 
    824                     bmi[offset + 5] = (byte)((greenMask & 0xFF0000) >> 16); 
    825                     bmi[offset + 6] = (byte)((greenMask & 0xFF00) >> 8); 
    826                     bmi[offset + 7] = (byte)((greenMask & 0xFF) >> 0); 
    827                     bmi[offset + 8] = (byte)((blueMask & 0xFF000000) >> 24); 
    828                     bmi[offset + 9] = (byte)((blueMask & 0xFF0000) >> 16); 
    829                     bmi[offset + 10] = (byte)((blueMask & 0xFF00) >> 8); 
    830                     bmi[offset + 11] = (byte)((blueMask & 0xFF) >> 0); 
     819                    bmi[offset] = cast(byte)((redMask & 0xFF000000) >> 24); 
     820                    bmi[offset + 1] = cast(byte)((redMask & 0xFF0000) >> 16); 
     821                    bmi[offset + 2] = cast(byte)((redMask & 0xFF00) >> 8); 
     822                    bmi[offset + 3] = cast(byte)((redMask & 0xFF) >> 0); 
     823                    bmi[offset + 4] = cast(byte)((greenMask & 0xFF000000) >> 24); 
     824                    bmi[offset + 5] = cast(byte)((greenMask & 0xFF0000) >> 16); 
     825                    bmi[offset + 6] = cast(byte)((greenMask & 0xFF00) >> 8); 
     826                    bmi[offset + 7] = cast(byte)((greenMask & 0xFF) >> 0); 
     827                    bmi[offset + 8] = cast(byte)((blueMask & 0xFF000000) >> 24); 
     828                    bmi[offset + 9] = cast(byte)((blueMask & 0xFF0000) >> 16); 
     829                    bmi[offset + 10] = cast(byte)((blueMask & 0xFF00) >> 8); 
     830                    bmi[offset + 11] = cast(byte)((blueMask & 0xFF) >> 0); 
    831831                    break; 
    832832                default: 
     
    836836    } else { 
    837837        for (int j = 0; j < rgbs.length; j++) { 
    838             bmi[offset] = (byte)rgbs[j].blue; 
    839             bmi[offset + 1] = (byte)rgbs[j].green; 
    840             bmi[offset + 2] = (byte)rgbs[j].red; 
     838            bmi[offset] = cast(byte)rgbs[j].blue; 
     839            bmi[offset + 1] = cast(byte)rgbs[j].green; 
     840            bmi[offset + 2] = cast(byte)rgbs[j].red; 
    841841            bmi[offset + 3] = 0; 
    842842            offset += 4; 
     
    936936            byte oldValue = pBits[0]; 
    937937            int mask = (0xFF << (8 - bm.bmBitsPixel)) & 0x00FF; 
    938             pBits[0] = (byte)((transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask)); 
     938            pBits[0] = cast(byte)((transparentPixel << (8 - bm.bmBitsPixel)) | (pBits[0] & ~mask)); 
    939939            OS.MoveMemory(bm.bmBits, pBits, 1); 
    940940            int color = OS.GetPixel(hdcMem, 0, 0); 
     
    11391139                //  First color black, second color white 
    11401140                int offset = BITMAPINFOHEADER.size; 
    1141                 bmi[offset + 4] = bmi[offset + 5] = bmi[offset + 6] = (byte)0xFF; 
     1141                bmi[offset + 4] = bmi[offset + 5] = bmi[offset + 6] = cast(byte)0xFF; 
    11421142                bmi[offset + 7] = 0; 
    11431143 
     
    15501550    bmiHeader.biHeight = -i.height; 
    15511551    bmiHeader.biPlanes = 1; 
    1552     bmiHeader.biBitCount = (short)i.depth; 
     1552    bmiHeader.biBitCount = cast(short)i.depth; 
    15531553    if (useBitfields) bmiHeader.biCompression = OS.BI_BITFIELDS; 
    15541554    else bmiHeader.biCompression = OS.BI_RGB; 
     
    15681568             */ 
    15691569            if (i.getByteOrder() == ImageData.LSB_FIRST) { 
    1570                 bmi[offset] = (byte)((redMask & 0xFF) >> 0); 
    1571                 bmi[offset + 1] = (byte)((redMask & 0xFF00) >> 8); 
    1572                 bmi[offset + 2] = (byte)((redMask & 0xFF0000) >> 16); 
    1573                 bmi[offset + 3] = (byte)((redMask & 0xFF000000) >> 24); 
    1574                 bmi[offset + 4] = (byte)((greenMask & 0xFF) >> 0); 
    1575                 bmi[offset + 5] = (byte)((greenMask & 0xFF00) >> 8); 
    1576                 bmi[offset + 6] = (byte)((greenMask & 0xFF0000) >> 16); 
    1577                 bmi[offset + 7] = (byte)((greenMask & 0xFF000000) >> 24); 
    1578                 bmi[offset + 8] = (byte)((blueMask & 0xFF) >> 0); 
    1579                 bmi[offset + 9] = (byte)((blueMask & 0xFF00) >> 8); 
    1580                 bmi[offset + 10] = (byte)((blueMask & 0xFF0000) >> 16); 
    1581                 bmi[offset + 11] = (byte)((blueMask & 0xFF000000) >> 24); 
     1570                bmi[offset] = cast(byte)((redMask & 0xFF) >> 0); 
     1571                bmi[offset + 1] = cast(byte)((redMask & 0xFF00) >> 8); 
     1572                bmi[offset + 2] = cast(byte)((redMask & 0xFF0000) >> 16); 
     1573                bmi[offset + 3] = cast(byte)((redMask & 0xFF000000) >> 24); 
     1574                bmi[offset + 4] = cast(byte)((greenMask & 0xFF) >> 0); 
     1575                bmi[offset + 5] = cast(byte)((greenMask & 0xFF00) >> 8); 
     1576                bmi[offset + 6] = cast(byte)((greenMask & 0xFF0000) >> 16); 
     1577                bmi[offset + 7] = cast(byte)((greenMask & 0xFF000000) >> 24); 
     1578                bmi[offset + 8] = cast(byte)((blueMask & 0xFF) >> 0); 
     1579                bmi[offset + 9] = cast(byte)((blueMask & 0xFF00) >> 8); 
     1580                bmi[offset + 10] = cast(byte)((blueMask & 0xFF0000) >> 16); 
     1581                bmi[offset + 11] = cast(byte)((blueMask & 0xFF000000) >> 24); 
    15821582            } else { 
    1583                 bmi[offset] = (byte)((redMask & 0xFF000000) >> 24); 
    1584                 bmi[offset + 1] = (byte)((redMask & 0xFF0000) >> 16); 
    1585                 bmi[offset + 2] = (byte)((redMask & 0xFF00) >> 8); 
    1586                 bmi[offset + 3] = (byte)((redMask & 0xFF) >> 0); 
    1587                 bmi[offset + 4] = (byte)((greenMask & 0xFF000000) >> 24); 
    1588                 bmi[offset + 5] = (byte)((greenMask & 0xFF0000) >> 16); 
    1589                 bmi[offset + 6] = (byte)((greenMask & 0xFF00) >> 8); 
    1590                 bmi[offset + 7] = (byte)((greenMask & 0xFF) >> 0); 
    1591                 bmi[offset + 8] = (byte)((blueMask & 0xFF000000) >> 24); 
    1592                 bmi[offset + 9] = (byte)((blueMask & 0xFF0000) >> 16); 
    1593                 bmi[offset + 10] = (byte)((blueMask & 0xFF00) >> 8); 
    1594                 bmi[offset + 11] = (byte)((blueMask & 0xFF) >> 0); 
     1583                bmi[offset] = cast(byte)((redMask & 0xFF000000) >> 24); 
     1584                bmi[offset + 1] = cast(byte)((redMask & 0xFF0000) >> 16); 
     1585                bmi[offset + 2] = cast(byte)((redMask & 0xFF00) >> 8); 
     1586                bmi[offset + 3] = cast(byte)((redMask & 0xFF) >> 0); 
     1587                bmi[offset + 4] = cast(byte)((greenMask & 0xFF000000) >> 24); 
     1588                bmi[offset + 5] = cast(byte)((greenMask & 0xFF0000) >> 16); 
     1589                bmi[offset + 6] = cast(byte)((greenMask & 0xFF00) >> 8); 
     1590                bmi[offset + 7] = cast(byte)((greenMask & 0xFF) >> 0); 
     1591                bmi[offset + 8] = cast(byte)((blueMask & 0xFF000000) >> 24); 
     1592                bmi[offset + 9] = cast(byte)((blueMask & 0xFF0000) >> 16); 
     1593                bmi[offset + 10] = cast(byte)((blueMask & 0xFF00) >> 8); 
     1594                bmi[offset + 11] = cast(byte)((blueMask & 0xFF) >> 0); 
    15951595            } 
    15961596        } 
    15971597    } else { 
    15981598        for (int j = 0; j < rgbs.length; j++) { 
    1599             bmi[offset] = (byte)rgbs[j].blue; 
    1600             bmi[offset + 1] = (byte)rgbs[j].green; 
    1601             bmi[offset + 2] = (byte)rgbs[j].red; 
     1599            bmi[offset] = cast(byte)rgbs[j].blue; 
     1600            bmi[offset + 1] = cast(byte)rgbs[j].green; 
     1601            bmi[offset + 2] = cast(byte)rgbs[j].red; 
    16021602            bmi[offset + 3] = 0; 
    16031603            offset += 4; 
     
    19281928    int numColors = OS.GetDIBColorTable(hdcMem, 0, maxColors, colors); 
    19291929    int offset = transparentPixel * 4; 
    1930     colors[offset] = (byte)color.getBlue(); 
    1931     colors[offset + 1] = (byte)color.getGreen(); 
    1932     colors[offset + 2] = (byte)color.getRed(); 
     1930    colors[offset] = cast(byte)color.getBlue(); 
     1931    colors[offset + 1] = cast(byte)color.getGreen(); 
     1932    colors[offset + 2] = cast(byte)color.getRed(); 
    19331933    if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 
    19341934    OS.SetDIBColorTable(hdcMem, 0, numColors, colors); 
  • branches/0.1/src/dwt/graphics/imagedata.d

    r11 r15  
    223223            int inc = 0; 
    224224            for (int _bit = 0x10000; (_bit >>= b) != 0;) inc |= _bit; 
    225             for (int v = 0, p = 0; v < 0x10000; v+= inc) data[p++] = (byte)(v >> 8); 
     225            for (int v = 0, p = 0; v < 0x10000; v+= inc) data[p++] = cast(byte)(v >> 8); 
    226226        } 
    227227 
     
    602602        int endIndex = startIndex + getWidth; 
    603603        for (int i = startIndex; i < endIndex; i++) { 
    604             alphas[i] = (byte)255; 
     604            alphas[i] = cast(byte)255; 
    605605        } 
    606606        return; 
     
    746746            offset = 3 - (srcX % 4); 
    747747            mask = 3 << (offset * 2); 
    748             pixels[i] = (byte)((theByte & mask) >> (offset * 2)); 
     748            pixels[i] = cast(byte)((theByte & mask) >> (offset * 2)); 
    749749            i++; 
    750750            n--; 
     
    768768        if ((x & 0x1) == 1) { 
    769769            theByte = data[index] & 0xFF; 
    770             pixels[i] = (byte)(theByte & 0x0F); 
     770            pixels[i] = cast(byte)(theByte & 0x0F); 
    771771            i++; 
    772772            n--; 
     
    782782        while (n > 1) { 
    783783            theByte = data[index] & 0xFF; 
    784             pixels[i] = (byte)(theByte >> 4); 
     784            pixels[i] = cast(byte)(theByte >> 4); 
    785785            i++; 
    786786            n--; 
     
    791791                srcX = 0; 
    792792            } else { 
    793                 pixels[i] = (byte)(theByte & 0x0F); 
     793                pixels[i] = cast(byte)(theByte & 0x0F); 
    794794                i++; 
    795795                n--; 
     
    806806        if (n > 0) { 
    807807            theByte = data[index] & 0xFF; 
    808             pixels[i] = (byte)(theByte >> 4); 
     808            pixels[i] = cast(byte)(theByte >> 4); 
    809809        } 
    810810        return; 
     
    894894            offset = 3 - (srcX % 4); 
    895895            mask = 3 << (offset * 2); 
    896             pixels[i] = (byte)((theByte & mask) >> (offset * 2)); 
     896            pixels[i] = cast(byte)((theByte & mask) >> (offset * 2)); 
    897897            i++; 
    898898            n--; 
     
    11551155 
    11561156    if (alphaData == null) alphaData = new byte[width * height]; 
    1157     alphaData[y * width + x] = (byte)alpha; 
     1157    alphaData[y * width + x] = cast(byte)alpha; 
    11581158} 
    11591159 
     
    12151215        mask = 1 << (7 - (x & 0x7)); 
    12161216        if ((pixelValue & 0x1) == 1) { 
    1217             data[index] = (byte)(theByte | mask); 
     1217            data[index] = cast(byte)(theByte | mask); 
    12181218        } else { 
    1219             data[index] = (byte)(theByte & (mask ^ -1)); 
     1219            data[index] = cast(byte)(theByte & (mask ^ -1)); 
    12201220        } 
    12211221        return; 
     
    12261226        int offset = 3 - (x % 4); 
    12271227        mask = 0xFF ^ (3 << (offset * 2)); 
    1228         data[index] = (byte)((data[index] & mask) | (pixelValue << (offset * 2))); 
     1228        data[index] = cast(byte)((data[index] & mask) | (pixelValue << (offset * 2))); 
    12291229        return; 
    12301230    } 
     
    12321232        index = (y * bytesPerLine) + (x >> 1); 
    12331233        if ((x & 0x1) == 0) { 
    1234             data[index] = (byte)((data[index] & 0x0F) | ((pixelValue & 0x0F) << 4)); 
     1234            data[index] = cast(byte)((data[index] & 0x0F) | ((pixelValue & 0x0F) << 4)); 
    12351235        } else { 
    1236             data[index] = (byte)((data[index] & 0xF0) | (pixelValue & 0x0F)); 
     1236            data[index] = cast(byte)((data[index] & 0xF0) | (pixelValue & 0x0F)); 
    12371237        } 
    12381238        return; 
     
    12401240    if (depth == 8) { 
    12411241        index = (y * bytesPerLine) + x ; 
    1242         data[index] = (byte)(pixelValue & 0xFF); 
     1242        data[index] = cast(byte)(pixelValue & 0xFF); 
    12431243        return; 
    12441244    } 
    12451245    if (depth == 16) { 
    12461246        index = (y * bytesPerLine) + (x * 2); 
    1247         data[index + 1] = (byte)((pixelValue >> 8) & 0xFF); 
    1248         data[index] = (byte)(pixelValue & 0xFF); 
     1247        data[index + 1] = cast(byte)((pixelValue >> 8) & 0xFF); 
     1248        data[index] = cast(byte)(pixelValue & 0xFF); 
    12491249        return; 
    12501250    } 
    12511251    if (depth == 24) { 
    12521252        index = (y * bytesPerLine) + (x * 3); 
    1253         data[index] = (byte)((pixelValue >> 16) & 0xFF); 
    1254         data[index + 1] = (byte)((pixelValue >> 8) & 0xFF); 
    1255         data[index + 2] = (byte)(pixelValue & 0xFF); 
     1253        data[index] = cast(byte)((pixelValue >> 16) & 0xFF); 
     1254        data[index + 1] = cast(byte)((pixelValue >> 8) & 0xFF); 
     1255        data[index + 2] = cast(byte)(pixelValue & 0xFF); 
    12561256        return; 
    12571257    } 
    12581258    if (depth == 32) { 
    12591259        index = (y * bytesPerLine) + (x * 4); 
    1260         data[index]  = (byte)((pixelValue >> 24) & 0xFF); 
    1261         data[index + 1] = (byte)((pixelValue >> 16) & 0xFF); 
    1262         data[index + 2] = (byte)((pixelValue >> 8) & 0xFF); 
    1263         data[index + 3] = (byte)(pixelValue & 0xFF); 
     1260        data[index]  = cast(byte)((pixelValue >> 24) & 0xFF); 
     1261        data[index + 1] = cast(byte)((pixelValue >> 16) & 0xFF); 
     1262        data[index + 2] = cast(byte)((pixelValue >> 8) & 0xFF); 
     1263        data[index + 3] = cast(byte)(pixelValue & 0xFF); 
    12641264        return; 
    12651265    } 
     
    13051305            mask = 1 << (7 - (srcX & 0x7)); 
    13061306            if ((pixels[i] & 0x1) == 1) { 
    1307                 data[index] = (byte)((data[index] & 0xFF) | mask); 
     1307                data[index] = cast(byte)((data[index] & 0xFF) | mask); 
    13081308            } else { 
    1309                 data[index] = (byte)((data[index] & 0xFF) & (mask ^ -1)); 
     1309                data[index] = cast(byte)((data[index] & 0xFF) & (mask ^ -1)); 
    13101310            } 
    13111311            i++; 
     
    13251325    } 
    13261326    if (depth == 2) { 
    1327         static byte [] masks = [ (byte)0xFC, (byte)0xF3, (byte)0xCF, (byte)0x3F ]; 
     1327        static byte [] masks = [ cast(byte)0xFC, cast(byte)0xF3, cast(byte)0xCF, cast(byte)0x3F ]; 
    13281328        index = (y * bytesPerLine) + (x >> 2); 
    13291329        int offset = 3 - (x % 4); 
    13301330        while (n > 0) { 
    13311331            theByte = pixels[i] & 0x3; 
    1332             data[index] = (byte)((data[index] & masks[offset]) | (theByte << (offset * 2))); 
     1332            data[index] = cast(byte)((data[index] & masks[offset]) | (theByte << (offset * 2))); 
    13331333            i++; 
    13341334            n--; 
     
    13561356            theByte = pixels[i] & 0x0F; 
    13571357            if (high) { 
    1358                 data[index] = (byte)((data[index] & 0x0F) | (theByte << 4)); 
     1358                data[index] = cast(byte)((data[index] & 0x0F) | (theByte << 4)); 
    13591359            } else { 
    1360                 data[index] = (byte)((data[index] & 0xF0) | theByte); 
     1360                data[index] = cast(byte)((data[index] & 0xF0) | theByte); 
    13611361            } 
    13621362            i++; 
     
    13781378        index = (y * bytesPerLine) + x; 
    13791379        for (int j = 0; j < putWidth; j++) { 
    1380             data[index] = (byte)(pixels[i] & 0xFF); 
     1380            data[index] = cast(byte)(pixels[i] & 0xFF); 
    13811381            i++; 
    13821382            srcX++; 
     
    14321432            mask = 1 << (7 - (srcX & 0x7)); 
    14331433            if ((pixels[i] & 0x1) == 1) { 
    1434                 data[index] = (byte)((data[index] & 0xFF) | mask); 
     1434                data[index] = cast(byte)((data[index] & 0xFF) | mask); 
    14351435            } else { 
    1436                 data[index] = (byte)((data[index] & 0xFF) & (mask ^ -1)); 
     1436                data[index] = cast(byte)((data[index] & 0xFF) & (mask ^ -1)); 
    14371437            } 
    14381438            i++; 
     
    14521452    } 
    14531453    if (depth == 2) { 
    1454         static byte [] masks = [ (byte)0xFC, (byte)0xF3, (byte)0xCF, (byte)0x3F ]; 
     1454        static byte [] masks = [ cast(byte)0xFC, cast(byte)0xF3, cast(byte)0xCF, cast(byte)0x3F ]; 
    14551455        index = (y * bytesPerLine) + (x >> 2); 
    14561456        int offset = 3 - (x % 4); 
    14571457        while (n > 0) { 
    14581458            theByte = pixels[i] & 0x3; 
    1459             data[index] = (byte)((data[index] & masks[offset]) | (theByte << (offset * 2))); 
     1459            data[index] = cast(byte)((data[index] & masks[offset]) | (theByte << (offset * 2))); 
    14601460            i++; 
    14611461            n--; 
     
    14831483            theByte = pixels[i] & 0x0F; 
    14841484            if (high) { 
    1485                 data[index] = (byte)((data[index] & 0x0F) | (theByte << 4)); 
     1485                data[index] = cast(byte)((data[index] & 0x0F) | (theByte << 4)); 
    14861486            } else { 
    1487                 data[index] = (byte)((data[index] & 0xF0) | theByte); 
     1487                data[index] = cast(byte)((data[index] & 0xF0) | theByte); 
    14881488            } 
    14891489            i++; 
     
    15051505        index = (y * bytesPerLine) + x; 
    15061506        for (int j = 0; j < putWidth; j++) { 
    1507             data[index] = (byte)(pixels[i] & 0xFF); 
     1507            data[index] = cast(byte)(pixels[i] & 0xFF); 
    15081508            i++; 
    15091509            srcX++; 
     
    15231523        for (int j = 0; j < putWidth; j++) { 
    15241524            pixel = pixels[i]; 
    1525             data[index] = (byte)(pixel & 0xFF); 
    1526             data[index + 1] = (byte)((pixel >> 8) & 0xFF); 
     1525            data[index] = cast(byte)(pixel & 0xFF); 
     1526            data[index + 1] = cast(byte)((pixel >> 8) & 0xFF); 
    15271527            i++; 
    15281528            srcX++; 
     
    15411541        for (int j = 0; j < putWidth; j++) { 
    15421542            pixel = pixels[i]; 
    1543             data[index] = (byte)((pixel >> 16) & 0xFF); 
    1544             data[index + 1] = (byte)((pixel >> 8) & 0xFF); 
    1545             data[index + 2] = (byte)(pixel & 0xFF); 
     1543            data[index] = cast(byte)((pixel >> 16) & 0xFF); 
     1544            data[index + 1] = cast(byte)((pixel >> 8) & 0xFF); 
     1545            data[index + 2] = cast(byte)(pixel & 0xFF); 
    15461546            i++; 
    15471547            srcX++; 
     
    15601560        for (int j = 0; j < putWidth; j++) { <