diff dwt/widgets/Table.d @ 249:b3dbd786541a

Fix: compile errors
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Jul 2008 17:23:35 +0200
parents fd9c62a2998e
children 27244095ce14
line wrap: on
line diff
--- a/dwt/widgets/Table.d	Tue Jul 01 10:18:15 2008 +0200
+++ b/dwt/widgets/Table.d	Sun Jul 06 17:23:35 2008 +0200
@@ -23,7 +23,6 @@
 import dwt.graphics.Point;
 import dwt.graphics.Rectangle;
 import dwt.internal.ImageList;
-import dwt.internal.win32.BITMAPINFOHEADER;
 import dwt.internal.win32.OS;
 
 import dwt.widgets.Composite;
@@ -5442,14 +5441,14 @@
         * The fix for both cases is to create the image using PrintWindow(). 
         */
         if ((!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) || hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) {
-            int topIndex = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETTOPINDEX, 0, 0);
-            int selection = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETNEXTITEM, topIndex - 1, OS.LVNI_SELECTED);
+            int topIndex = OS.SendMessage (handle, OS.LVM_GETTOPINDEX, 0, 0);
+            int selection = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, topIndex - 1, OS.LVNI_SELECTED);
             if (selection is -1) return 0;
-            POINT mousePos = new POINT ();
+            POINT mousePos;
             OS.POINTSTOPOINT (mousePos, OS.GetMessagePos ());
-            OS.MapWindowPoints(0, handle, mousePos, 1);
-            RECT clientRect = new RECT ();
-            OS.GetClientRect (handle, clientRect);
+            OS.MapWindowPoints(null, handle, &mousePos, 1);
+            RECT clientRect;
+            OS.GetClientRect (handle, &clientRect);
             TableItem item = _getItem (selection);
             RECT rect = item.getBounds (selection, 0, true, true, true);
             if ((style & DWT.FULL_SELECTION) !is 0) {
@@ -5462,22 +5461,22 @@
                     rect.left = Math.max (clientRect.left, rect.right - width);
                 }
             }
-            int /*long*/ hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom);
-            while ((selection = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETNEXTITEM, selection, OS.LVNI_SELECTED)) !is -1) {
+            auto hRgn = OS.CreateRectRgn (rect.left, rect.top, rect.right, rect.bottom);
+            while ((selection = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, selection, OS.LVNI_SELECTED)) !is -1) {
                 if (rect.bottom - rect.top > DRAG_IMAGE_SIZE) break;
                 if (rect.bottom > clientRect.bottom) break;
                 RECT itemRect = item.getBounds (selection, 0, true, true, true);
-                int /*long*/ rectRgn = OS.CreateRectRgn (rect.left, itemRect.top, rect.right, itemRect.bottom);
+                auto rectRgn = OS.CreateRectRgn (rect.left, itemRect.top, rect.right, itemRect.bottom);
                 OS.CombineRgn (hRgn, hRgn, rectRgn, OS.RGN_OR);
                 OS.DeleteObject (rectRgn);
                 rect.bottom = itemRect.bottom;
             }
-            OS.GetRgnBox (hRgn, rect);
+            OS.GetRgnBox (hRgn, &rect);
             
             /* Create resources */
-            int /*long*/ hdc = OS.GetDC (handle);
-            int /*long*/ memHdc = OS.CreateCompatibleDC (hdc);
-            BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER ();
+            auto hdc = OS.GetDC (handle);
+            auto memHdc = OS.CreateCompatibleDC (hdc);
+            BITMAPINFOHEADER bmiHeader;
             bmiHeader.biSize = BITMAPINFOHEADER.sizeof;
             bmiHeader.biWidth = rect.right - rect.left;
             bmiHeader.biHeight = -(rect.bottom - rect.top);
@@ -5485,25 +5484,25 @@
             bmiHeader.biBitCount = 32;
             bmiHeader.biCompression = OS.BI_RGB;
             byte [] bmi = new byte [BITMAPINFOHEADER.sizeof];
-            OS.MoveMemory (bmi, bmiHeader, BITMAPINFOHEADER.sizeof);
-            int /*long*/ [] pBits = new int /*long*/ [1];
-            int /*long*/ memDib = OS.CreateDIBSection (0, bmi, OS.DIB_RGB_COLORS, pBits, 0, 0);
-            if (memDib is 0) DWT.error (DWT.ERROR_NO_HANDLES);
-            int /*long*/ oldMemBitmap = OS.SelectObject (memHdc, memDib);
+            OS.MoveMemory (bmi.ptr, &bmiHeader, BITMAPINFOHEADER.sizeof);
+            void*[1] pBits;
+            auto memDib = OS.CreateDIBSection (null, cast(BITMAPINFO*) bmi.ptr, OS.DIB_RGB_COLORS, pBits.ptr, null, 0);
+            if (memDib is null) DWT.error (DWT.ERROR_NO_HANDLES);
+            auto oldMemBitmap = OS.SelectObject (memHdc, memDib);
             int colorKey = 0x0000FD;
-            POINT pt = new POINT();
-            OS.SetWindowOrgEx (memHdc, rect.left, rect.top, pt);
-            OS.FillRect (memHdc, rect, findBrush (colorKey, OS.BS_SOLID));
+            POINT pt;
+            OS.SetWindowOrgEx (memHdc, rect.left, rect.top, &pt);
+            OS.FillRect (memHdc, &rect, findBrush (colorKey, OS.BS_SOLID));
             OS.OffsetRgn (hRgn, -rect.left, -rect.top);
             OS.SelectClipRgn (memHdc, hRgn);
             OS.PrintWindow (handle, memHdc, 0);
             OS.SetWindowOrgEx (memHdc, pt.x, pt.y, null);
             OS.SelectObject (memHdc, oldMemBitmap);
             OS.DeleteDC (memHdc);
-            OS.ReleaseDC (0, hdc);
+            OS.ReleaseDC (null, hdc);
             OS.DeleteObject (hRgn);
             
-            SHDRAGIMAGE shdi = new SHDRAGIMAGE ();
+            SHDRAGIMAGE shdi;
             shdi.hbmpDragImage = memDib;
             shdi.crColorKey = colorKey;
             shdi.sizeDragImage.cx = bmiHeader.biWidth;
@@ -5513,7 +5512,7 @@
             if ((style & DWT.MIRRORED) !is 0) {
                 shdi.ptOffset.x = shdi.sizeDragImage.cx - shdi.ptOffset.x; 
             }
-            OS.MoveMemory (lParam, shdi, SHDRAGIMAGE.sizeof);
+            OS.MoveMemory (cast(void*)lParam, &shdi, SHDRAGIMAGE.sizeof);
             return 1;
         }
     }