summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java280
1 files changed, 142 insertions, 138 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index 44d8aee4d9..e1b63979af 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -58,7 +58,7 @@ public final class GC extends Resource {
* platforms and should never be accessed from application code.
* </p>
*/
- public int handle;
+ public int /*long*/ handle;
Drawable drawable;
GCData data;
@@ -150,7 +150,7 @@ public GC(Drawable drawable, int style) {
if (drawable == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
GCData data = new GCData ();
data.style = checkStyle(style);
- int hDC = drawable.internal_new_GC(data);
+ int /*long*/ hDC = drawable.internal_new_GC(data);
Device device = data.device;
if (device == null) device = Device.getDevice();
if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
@@ -169,14 +169,14 @@ void checkGC(int mask) {
if ((state & mask) == mask) return;
state = (state ^ mask) & mask;
data.state |= mask;
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
- int pen = data.gdipPen;
+ int /*long*/ pen = data.gdipPen;
float width = data.lineWidth;
if ((state & FOREGROUND) != 0 || (pen == 0 && (state & (LINE_WIDTH | LINE_STYLE | LINE_MITERLIMIT | LINE_JOIN | LINE_CAP)) != 0)) {
if (data.gdipFgBrush != 0) Gdip.SolidBrush_delete(data.gdipFgBrush);
data.gdipFgBrush = 0;
- int brush;
+ int /*long*/ brush;
Pattern pattern = data.foregroundPattern;
if (pattern != null) {
brush = pattern.handle;
@@ -192,7 +192,7 @@ void checkGC(int mask) {
} else {
int foreground = data.foreground;
int rgb = ((foreground >> 16) & 0xFF) | (foreground & 0xFF00) | ((foreground & 0xFF) << 16);
- int color = Gdip.Color_new(data.alpha << 24 | rgb);
+ int /*long*/ color = Gdip.Color_new(data.alpha << 24 | rgb);
if (color == 0) SWT.error(SWT.ERROR_NO_HANDLES);
brush = Gdip.SolidBrush_new(color);
if (brush == 0) SWT.error(SWT.ERROR_NO_HANDLES);
@@ -272,7 +272,7 @@ void checkGC(int mask) {
if ((data.style & SWT.MIRRORED) != 0) {
switch (Gdip.Brush_GetType(data.gdipBrush)) {
case Gdip.BrushTypeTextureFill:
- int brush = Gdip.Brush_Clone(data.gdipBrush);
+ int /*long*/ brush = Gdip.Brush_Clone(data.gdipBrush);
if (brush == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Gdip.TextureBrush_ScaleTransform(brush, -1, 1, Gdip.MatrixOrderPrepend);
data.gdipBrush = data.gdipBgBrush = brush;
@@ -281,9 +281,9 @@ void checkGC(int mask) {
} else {
int background = data.background;
int rgb = ((background >> 16) & 0xFF) | (background & 0xFF00) | ((background & 0xFF) << 16);
- int color = Gdip.Color_new(data.alpha << 24 | rgb);
+ int /*long*/ color = Gdip.Color_new(data.alpha << 24 | rgb);
if (color == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int brush = Gdip.SolidBrush_new(color);
+ int /*long*/ brush = Gdip.SolidBrush_new(color);
if (brush == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Gdip.Color_delete(color);
data.gdipBrush = data.gdipBgBrush = brush;
@@ -291,13 +291,13 @@ void checkGC(int mask) {
}
if ((state & FONT) != 0) {
OS.SelectObject(handle, data.hFont);
- int font = createGdipFont(handle, data.hFont);
+ int /*long*/ font = createGdipFont(handle, data.hFont);
if (data.gdipFont != 0) Gdip.Font_delete(data.gdipFont);
data.gdipFont = font;
}
if ((state & DRAW_OFFSET) != 0) {
data.gdipXOffset = data.gdipYOffset = 0;
- int matrix = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
+ int /*long*/ matrix = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
float[] elements = new float[6];
Gdip.Graphics_GetTransform(gdipGraphics, matrix);
Gdip.Matrix_GetElements(matrix, elements);
@@ -360,7 +360,7 @@ void checkGC(int mask) {
* PS_SOLID for pens wider than 1 pixel created with CreatePen(). The fix
* is to use ExtCreatePen() instead.
*/
- int newPen;
+ int /*long*/ newPen;
if (OS.IsWinCE || (width == 0 && lineStyle != OS.PS_USERSTYLE) || style == 0) {
newPen = OS.CreatePen(style & OS.PS_STYLE_MASK, width, color);
} else {
@@ -383,7 +383,7 @@ void checkGC(int mask) {
data.state &= ~PEN;
}
if ((state & BACKGROUND) != 0) {
- int newBrush = OS.CreateSolidBrush(data.background);
+ int /*long*/ newBrush = OS.CreateSolidBrush(data.background);
OS.SelectObject(handle, newBrush);
data.state |= BRUSH;
data.state &= ~NULL_BRUSH;
@@ -430,8 +430,8 @@ public void copyArea(Image image, int x, int y) {
/* Copy the bitmap area */
Rectangle rect = image.getBounds();
- int memHdc = OS.CreateCompatibleDC(handle);
- int hOldBitmap = OS.SelectObject(memHdc, image.handle);
+ int /*long*/ memHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ hOldBitmap = OS.SelectObject(memHdc, image.handle);
OS.BitBlt(memHdc, 0, 0, rect.width, rect.height, handle, x, y, OS.SRCCOPY);
OS.SelectObject(memHdc, hOldBitmap);
OS.DeleteDC(memHdc);
@@ -481,12 +481,12 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d
* Feature in WinCE. The function WindowFromDC is not part of the
* WinCE SDK. The fix is to remember the HWND.
*/
- int hwnd = data.hwnd;
+ int /*long*/ hwnd = data.hwnd;
if (hwnd == 0) {
OS.BitBlt(handle, destX, destY, width, height, handle, srcX, srcY, OS.SRCCOPY);
} else {
RECT lprcClip = null;
- int hrgn = OS.CreateRectRgn(0, 0, 0, 0);
+ int /*long*/ hrgn = OS.CreateRectRgn(0, 0, 0, 0);
if (OS.GetClipRgn(handle, hrgn) == 1) {
lprcClip = new RECT();
OS.GetRgnBox(hrgn, lprcClip);
@@ -528,8 +528,8 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d
}
}
-static int createGdipFont(int hDC, int hFont) {
- int font = Gdip.Font_new(hDC, hFont);
+static int /*long*/ createGdipFont(int /*long*/ hDC, int /*long*/ hFont) {
+ int /*long*/ font = Gdip.Font_new(hDC, hFont);
if (font == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (!Gdip.Font_IsAvailable(font)) {
Gdip.Font_delete(font);
@@ -564,7 +564,7 @@ static int createGdipFont(int hDC, int hFont) {
return font;
}
-static void destroyGdipBrush(int brush) {
+static void destroyGdipBrush(int /*long*/ brush) {
int type = Gdip.Brush_GetType(brush);
switch (type) {
case Gdip.BrushTypeSolidColor:
@@ -614,7 +614,7 @@ public void dispose() {
* This will ensure that we have not left a bitmap
* selected in it when we delete the HDC.
*/
- int hNullBitmap = data.hNullBitmap;
+ int /*long*/ hNullBitmap = data.hNullBitmap;
if (hNullBitmap != 0) {
OS.SelectObject(handle, hNullBitmap);
data.hNullBitmap = 0;
@@ -687,15 +687,15 @@ public void drawArc (int x, int y, int width, int height, int startAngle, int ar
height = -height;
}
if (width == 0 || height == 0 || arcAngle == 0) return;
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
if (width == height) {
Gdip.Graphics_DrawArc(gdipGraphics, data.gdipPen, x, y, width, height, -startAngle, -arcAngle);
} else {
- int path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
+ int /*long*/ path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
if (path == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int matrix = Gdip.Matrix_new(width, 0, 0, height, x, y);
+ int /*long*/ matrix = Gdip.Matrix_new(width, 0, 0, height, x, y);
if (matrix == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Gdip.GraphicsPath_AddArc(path, 0, 0, 1, 1, -startAngle, -arcAngle);
Gdip.GraphicsPath_Transform(path, matrix);
@@ -776,12 +776,13 @@ public void drawArc (int x, int y, int width, int height, int startAngle, int ar
public void drawFocus (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if ((data.uiState & OS.UISF_HIDEFOCUS) != 0) return;
- int hdc = handle, state = 0;
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ hdc = handle;
+ int state = 0;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
- int clipRgn = 0;
+ int /*long*/ clipRgn = 0;
Gdip.Graphics_SetPixelOffsetMode(gdipGraphics, Gdip.PixelOffsetModeNone);
- int rgn = Gdip.Region_new();
+ int /*long*/ rgn = Gdip.Region_new();
if (rgn == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Gdip.Graphics_GetClip(gdipGraphics, rgn);
if (!Gdip.Region_IsInfinite(rgn, gdipGraphics)) {
@@ -790,7 +791,7 @@ public void drawFocus (int x, int y, int width, int height) {
Gdip.Region_delete(rgn);
Gdip.Graphics_SetPixelOffsetMode(gdipGraphics, Gdip.PixelOffsetModeHalf);
float[] lpXform = null;
- int matrix = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
+ int /*long*/ matrix = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
if (matrix == 0) SWT.error(SWT.ERROR_NO_HANDLES);
Gdip.Graphics_GetTransform(gdipGraphics, matrix);
if (!Gdip.Matrix_IsIdentity(matrix)) {
@@ -892,8 +893,8 @@ public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeig
void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple) {
if (data.gdipGraphics != 0) {
//TODO - cache bitmap
- int[] gdipImage = srcImage.createGdipImage();
- int img = gdipImage[0];
+ int /*long*/ [] gdipImage = srcImage.createGdipImage();
+ int /*long*/ img = gdipImage[0];
int imgWidth = Gdip.Image_GetWidth(img);
int imgHeight = Gdip.Image_GetHeight(img);
if (simple) {
@@ -916,7 +917,7 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
* Note that if the wrap mode is not WrapModeTileFlipXY, the scaled image
* is translucent around the borders.
*/
- int attrib = Gdip.ImageAttributes_new();
+ int /*long*/ attrib = Gdip.ImageAttributes_new();
Gdip.ImageAttributes_SetWrapMode(attrib, Gdip.WrapModeTileFlipXY);
if (data.alpha != 0xFF) {
float[] matrix = new float[]{
@@ -941,7 +942,7 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
Gdip.ImageAttributes_delete(attrib);
Gdip.Bitmap_delete(img);
if (gdipImage[1] != 0) {
- int hHeap = OS.GetProcessHeap ();
+ int /*long*/ hHeap = OS.GetProcessHeap ();
OS.HeapFree(hHeap, 0, gdipImage[1]);
}
return;
@@ -999,7 +1000,7 @@ void drawIcon(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, i
}
/* Get the icon width and height */
- int hBitmap = srcIconInfo.hbmColor;
+ int /*long*/ hBitmap = srcIconInfo.hbmColor;
if (hBitmap == 0) hBitmap = srcIconInfo.hbmMask;
BITMAP bm = new BITMAP();
OS.GetObject(hBitmap, BITMAP.sizeof, bm);
@@ -1028,20 +1029,20 @@ void drawIcon(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, i
/* Create the icon info and HDC's */
ICONINFO newIconInfo = new ICONINFO();
newIconInfo.fIcon = true;
- int srcHdc = OS.CreateCompatibleDC(handle);
- int dstHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ srcHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ dstHdc = OS.CreateCompatibleDC(handle);
/* Blt the color bitmap */
int srcColorY = srcY;
- int srcColor = srcIconInfo.hbmColor;
+ int /*long*/ srcColor = srcIconInfo.hbmColor;
if (srcColor == 0) {
srcColor = srcIconInfo.hbmMask;
srcColorY += iconHeight;
}
- int oldSrcBitmap = OS.SelectObject(srcHdc, srcColor);
+ int /*long*/ oldSrcBitmap = OS.SelectObject(srcHdc, srcColor);
newIconInfo.hbmColor = OS.CreateCompatibleBitmap(srcHdc, destWidth, destHeight);
if (newIconInfo.hbmColor == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int oldDestBitmap = OS.SelectObject(dstHdc, newIconInfo.hbmColor);
+ int /*long*/ oldDestBitmap = OS.SelectObject(dstHdc, newIconInfo.hbmColor);
boolean stretch = !simple && (srcWidth != destWidth || srcHeight != destHeight);
if (stretch) {
if (!OS.IsWinCE) OS.SetStretchBltMode(dstHdc, OS.COLORONCOLOR);
@@ -1070,7 +1071,7 @@ void drawIcon(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, i
} else {
OS.SelectObject(srcHdc, oldSrcBitmap);
OS.SelectObject(dstHdc, oldDestBitmap);
- int hIcon = OS.CreateIconIndirect(newIconInfo);
+ int /*long*/ hIcon = OS.CreateIconIndirect(newIconInfo);
if (hIcon == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (offsetX != 0 || offsetY != 0) OS.SetWindowOrgEx(handle, 0, 0, null);
OS.DrawIconEx(handle, destX - offsetX, destY - offsetY, hIcon, destWidth, destHeight, 0, 0, flags);
@@ -1130,7 +1131,7 @@ void drawBitmap(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
drawBitmap(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, bm, imgWidth, imgHeight);
}
if (mustRestore) {
- int hOldBitmap = OS.SelectObject(memGC.handle, srcImage.handle);
+ int /*long*/ hOldBitmap = OS.SelectObject(memGC.handle, srcImage.handle);
memGC.data.hNullBitmap = hOldBitmap;
}
}
@@ -1146,16 +1147,16 @@ void drawBitmapAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHe
if (OS.IsWinNT && OS.WIN32_VERSION >= OS.VERSION(4, 10)) {
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.BlendOp = OS.AC_SRC_OVER;
- int srcHdc = OS.CreateCompatibleDC(handle);
- int oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
+ int /*long*/ srcHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
if (srcImage.alpha != -1) {
blend.SourceConstantAlpha = (byte)srcImage.alpha;
OS.AlphaBlend(handle, destX, destY, destWidth, destHeight, srcHdc, srcX, srcY, srcWidth, srcHeight, blend);
} else {
- int memDib = Image.createDIB(srcWidth, srcHeight, 32);
+ int /*long*/ memDib = Image.createDIB(srcWidth, srcHeight, 32);
if (memDib == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int memHdc = OS.CreateCompatibleDC(handle);
- int oldMemBitmap = OS.SelectObject(memHdc, memDib);
+ int /*long*/ memHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ oldMemBitmap = OS.SelectObject(memHdc, memDib);
BITMAP dibBM = new BITMAP();
OS.GetObject(memDib, BITMAP.sizeof, dibBM);
OS.BitBlt(memHdc, 0, 0, srcWidth, srcHeight, srcHdc, srcX, srcY, OS.SRCCOPY);
@@ -1217,12 +1218,12 @@ void drawBitmapAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHe
srcHeight = Math.max(1, sy2 - sy1);
/* Create resources */
- int srcHdc = OS.CreateCompatibleDC(handle);
- int oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
- int memHdc = OS.CreateCompatibleDC(handle);
- int memDib = Image.createDIB(Math.max(srcWidth, destWidth), Math.max(srcHeight, destHeight), 32);
+ int /*long*/ srcHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
+ int /*long*/ memHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ memDib = Image.createDIB(Math.max(srcWidth, destWidth), Math.max(srcHeight, destHeight), 32);
if (memDib == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int oldMemBitmap = OS.SelectObject(memHdc, memDib);
+ int /*long*/ oldMemBitmap = OS.SelectObject(memHdc, memDib);
BITMAP dibBM = new BITMAP();
OS.GetObject(memDib, BITMAP.sizeof, dibBM);
@@ -1266,10 +1267,10 @@ void drawBitmapAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHe
* source and destination HDCs are the same.
*/
if ((OS.IsWinCE && (destWidth > srcWidth || destHeight > srcHeight)) || (!OS.IsWinNT && !OS.IsWinCE)) {
- int tempHdc = OS.CreateCompatibleDC(handle);
- int tempDib = Image.createDIB(destWidth, destHeight, 32);
+ int /*long*/ tempHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ tempDib = Image.createDIB(destWidth, destHeight, 32);
if (tempDib == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int oldTempBitmap = OS.SelectObject(tempHdc, tempDib);
+ int /*long*/ oldTempBitmap = OS.SelectObject(tempHdc, tempDib);
if (!simple && (srcWidth != destWidth || srcHeight != destHeight)) {
if (!OS.IsWinCE) OS.SetStretchBltMode(memHdc, OS.COLORONCOLOR);
OS.StretchBlt(tempHdc, 0, 0, destWidth, destHeight, memHdc, 0, 0, srcWidth, srcHeight, OS.SRCCOPY);
@@ -1316,13 +1317,13 @@ void drawBitmapAlpha(Image srcImage, int srcX, int srcY, int srcWidth, int srcHe
OS.DeleteDC(srcHdc);
}
-void drawBitmapTransparentByClipping(int srcHdc, int maskHdc, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple, int imgWidth, int imgHeight) {
+void drawBitmapTransparentByClipping(int /*long*/ srcHdc, int /*long*/ maskHdc, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple, int imgWidth, int imgHeight) {
/* Create a clipping region from the mask */
- int rgn = OS.CreateRectRgn(0, 0, 0, 0);
+ int /*long*/ rgn = OS.CreateRectRgn(0, 0, 0, 0);
for (int y=0; y<imgHeight; y++) {
for (int x=0; x<imgWidth; x++) {
if (OS.GetPixel(maskHdc, x, y) == 0) {
- int tempRgn = OS.CreateRectRgn(x, y, x+1, y+1);
+ int /*long*/ tempRgn = OS.CreateRectRgn(x, y, x+1, y+1);
OS.CombineRgn(rgn, rgn, tempRgn, OS.RGN_OR);
OS.DeleteObject(tempRgn);
}
@@ -1334,12 +1335,12 @@ void drawBitmapTransparentByClipping(int srcHdc, int maskHdc, int srcX, int srcY
int[] lpRgnData = new int[nBytes / 4];
OS.GetRegionData (rgn, nBytes, lpRgnData);
float[] lpXform = new float[] {(float)destWidth/srcWidth, 0, 0, (float)destHeight/srcHeight, 0, 0};
- int tmpRgn = OS.ExtCreateRegion(lpXform, nBytes, lpRgnData);
+ int /*long*/ tmpRgn = OS.ExtCreateRegion(lpXform, nBytes, lpRgnData);
OS.DeleteObject(rgn);
rgn = tmpRgn;
}
OS.OffsetRgn(rgn, destX, destY);
- int clip = OS.CreateRectRgn(0, 0, 0, 0);
+ int /*long*/ clip = OS.CreateRectRgn(0, 0, 0, 0);
int result = OS.GetClipRgn(handle, clip);
if (result == 1) OS.CombineRgn(rgn, rgn, clip, OS.RGN_AND);
OS.SelectClipRgn(handle, rgn);
@@ -1364,16 +1365,17 @@ void drawBitmapTransparentByClipping(int srcHdc, int maskHdc, int srcX, int srcY
OS.DeleteObject(rgn);
}
-void drawBitmapMask(Image srcImage, int srcColor, int srcMask, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple, int imgWidth, int imgHeight, boolean offscreen) {
+void drawBitmapMask(Image srcImage, int /*long*/ srcColor, int /*long*/ srcMask, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple, int imgWidth, int imgHeight, boolean offscreen) {
int srcColorY = srcY;
if (srcColor == 0) {
srcColor = srcMask;
srcColorY += imgHeight;
}
- int srcHdc = OS.CreateCompatibleDC(handle);
- int oldSrcBitmap = OS.SelectObject(srcHdc, srcColor);
- int destHdc = handle, x = destX, y = destY;
- int tempHdc = 0, tempBitmap = 0, oldTempBitmap = 0;
+ int /*long*/ srcHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ oldSrcBitmap = OS.SelectObject(srcHdc, srcColor);
+ int /*long*/ destHdc = handle;
+ int x = destX, y = destY;
+ int /*long*/ tempHdc = 0, tempBitmap = 0, oldTempBitmap = 0;
int oldBkColor = 0, oldTextColor = 0;
if (offscreen) {
tempHdc = OS.CreateCompatibleDC(handle);
@@ -1421,9 +1423,9 @@ void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int
/* Find the RGB values for the transparent pixel. */
int transBlue = 0, transGreen = 0, transRed = 0;
boolean isDib = bm.bmBits != 0;
- int hBitmap = srcImage.handle;
- int srcHdc = OS.CreateCompatibleDC(handle);
- int oldSrcBitmap = OS.SelectObject(srcHdc, hBitmap);
+ int /*long*/ hBitmap = srcImage.handle;
+ int /*long*/ srcHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ oldSrcBitmap = OS.SelectObject(srcHdc, hBitmap);
byte[] originalColors = null;
if (bm.bmBitsPixel <= 8) {
if (isDib) {
@@ -1522,9 +1524,9 @@ void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int
OS.SetStretchBltMode(handle, mode);
} else {
/* Create the mask for the source image */
- int maskHdc = OS.CreateCompatibleDC(handle);
- int maskBitmap = OS.CreateBitmap(imgWidth, imgHeight, 1, 1, null);
- int oldMaskBitmap = OS.SelectObject(maskHdc, maskBitmap);
+ int /*long*/ maskHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ maskBitmap = OS.CreateBitmap(imgWidth, imgHeight, 1, 1, null);
+ int /*long*/ oldMaskBitmap = OS.SelectObject(maskHdc, maskBitmap);
OS.SetBkColor(srcHdc, transparentColor);
OS.BitBlt(maskHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, OS.SRCCOPY);
if (originalColors != null) OS.SetDIBColorTable(srcHdc, 0, 1 << bm.bmBitsPixel, originalColors);
@@ -1534,9 +1536,9 @@ void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int
drawBitmapTransparentByClipping(srcHdc, maskHdc, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple, imgWidth, imgHeight);
} else {
/* Draw the source bitmap transparently using invert/and mask/invert */
- int tempHdc = OS.CreateCompatibleDC(handle);
- int tempBitmap = OS.CreateCompatibleBitmap(handle, destWidth, destHeight);
- int oldTempBitmap = OS.SelectObject(tempHdc, tempBitmap);
+ int /*long*/ tempHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ tempBitmap = OS.CreateCompatibleBitmap(handle, destWidth, destHeight);
+ int /*long*/ oldTempBitmap = OS.SelectObject(tempHdc, tempBitmap);
OS.BitBlt(tempHdc, 0, 0, destWidth, destHeight, handle, destX, destY, OS.SRCCOPY);
if (!simple && (srcWidth != destWidth || srcHeight != destHeight)) {
if (!OS.IsWinCE) OS.SetStretchBltMode(tempHdc, OS.COLORONCOLOR);
@@ -1563,8 +1565,8 @@ void drawBitmapTransparent(Image srcImage, int srcX, int srcY, int srcWidth, int
}
void drawBitmap(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple, BITMAP bm, int imgWidth, int imgHeight) {
- int srcHdc = OS.CreateCompatibleDC(handle);
- int oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
+ int /*long*/ srcHdc = OS.CreateCompatibleDC(handle);
+ int /*long*/ oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
int rop2 = 0;
if (!OS.IsWinCE) {
rop2 = OS.GetROP2(handle);
@@ -1601,7 +1603,7 @@ void drawBitmap(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
public void drawLine (int x1, int y1, int x2, int y2) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
checkGC(DRAW);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
Gdip.Graphics_DrawLine(gdipGraphics, data.gdipPen, x1, y1, x2, y2);
@@ -1650,7 +1652,7 @@ public void drawLine (int x1, int y1, int x2, int y2) {
public void drawOval (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
checkGC(DRAW);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
Gdip.Graphics_DrawEllipse(gdipGraphics, data.gdipPen, x, y, width, height);
@@ -1692,7 +1694,7 @@ public void drawPath (Path path) {
if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
initGdip();
checkGC(DRAW);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
Gdip.Graphics_DrawPath(gdipGraphics, data.gdipPen, path.handle);
Gdip.Graphics_TranslateTransform(gdipGraphics, -data.gdipXOffset, -data.gdipYOffset, Gdip.MatrixOrderPrepend);
@@ -1746,7 +1748,7 @@ public void drawPolygon(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
checkGC(DRAW);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
Gdip.Graphics_DrawPolygon(gdipGraphics, data.gdipPen, pointArray, pointArray.length / 2);
@@ -1791,7 +1793,7 @@ public void drawPolyline(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
checkGC(DRAW);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
Gdip.Graphics_DrawLines(gdipGraphics, data.gdipPen, pointArray, pointArray.length / 2);
@@ -1839,7 +1841,7 @@ public void drawPolyline(int[] pointArray) {
public void drawRectangle (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
checkGC(DRAW);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
Gdip.Graphics_DrawRectangle(gdipGraphics, data.gdipPen, x, y, width, height);
@@ -1957,7 +1959,7 @@ public void drawRoundRectangle (int x, int y, int width, int height, int arcWidt
}
}
-void drawRoundRectangleGdip (int gdipGraphics, int pen, int x, int y, int width, int height, int arcWidth, int arcHeight) {
+void drawRoundRectangleGdip (int /*long*/ gdipGraphics, int /*long*/ pen, int x, int y, int width, int height, int arcWidth, int arcHeight) {
int nx = x;
int ny = y;
int nw = width;
@@ -1979,7 +1981,7 @@ void drawRoundRectangleGdip (int gdipGraphics, int pen, int x, int y, int width,
nah = 0 - nah;
Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);
- int path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
+ int /*long*/ path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
if (path == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (nw > naw) {
if (nh > nah) {
@@ -2055,11 +2057,11 @@ public void drawString (String string, int x, int y, boolean isTransparent) {
if (length == 0) return;
char[] buffer = new char [length];
string.getChars(0, length, buffer, 0);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
checkGC(FONT | FOREGROUND | (isTransparent ? 0 : BACKGROUND));
PointF pt = new PointF();
- int format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
+ int /*long*/ format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
int formatFlags = Gdip.StringFormat_GetFormatFlags(format) | Gdip.StringFormatFlagsMeasureTrailingSpaces;
if ((data.style & SWT.MIRRORED) != 0) formatFlags |= Gdip.StringFormatFlagsDirectionRightToLeft;
Gdip.StringFormat_SetFormatFlags(format, formatFlags);
@@ -2068,7 +2070,8 @@ public void drawString (String string, int x, int y, boolean isTransparent) {
Gdip.Graphics_MeasureString(gdipGraphics, buffer, length, data.gdipFont, pt, format, bounds);
Gdip.Graphics_FillRectangle(gdipGraphics, data.gdipBrush, x, y, Math.round(bounds.Width), Math.round(bounds.Height));
}
- int gstate = 0, brush = getFgBrush();
+ int gstate = 0;
+ int /*long*/ brush = getFgBrush();
if ((data.style & SWT.MIRRORED) != 0) {
switch (Gdip.Brush_GetType(brush)) {
case Gdip.BrushTypeLinearGradient:
@@ -2136,10 +2139,10 @@ public void drawString (String string, int x, int y, boolean isTransparent) {
OS.GetTextExtentPoint32W(handle, buffer, length, size);
}
int width = size.cx, height = size.cy;
- int hBitmap = OS.CreateCompatibleBitmap(handle, width, height);
+ int /*long*/ hBitmap = OS.CreateCompatibleBitmap(handle, width, height);
if (hBitmap == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int memDC = OS.CreateCompatibleDC(handle);
- int hOldBitmap = OS.SelectObject(memDC, hBitmap);
+ int /*long*/ memDC = OS.CreateCompatibleDC(handle);
+ int /*long*/ hOldBitmap = OS.SelectObject(memDC, hBitmap);
OS.PatBlt(memDC, 0, 0, width, height, OS.BLACKNESS);
OS.SetBkMode(memDC, OS.TRANSPARENT);
OS.SetTextColor(memDC, foreground);
@@ -2245,14 +2248,14 @@ public void drawText (String string, int x, int y, int flags) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (string.length() == 0) return;
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
checkGC(FONT | FOREGROUND | ((flags & SWT.DRAW_TRANSPARENT) != 0 ? 0 : BACKGROUND));
int length = string.length();
char[] buffer = new char [length];
string.getChars(0, length, buffer, 0);
PointF pt = new PointF();
- int format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
+ int /*long*/ format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
int formatFlags = Gdip.StringFormat_GetFormatFlags(format) | Gdip.StringFormatFlagsMeasureTrailingSpaces;
if ((data.style & SWT.MIRRORED) != 0) formatFlags |= Gdip.StringFormatFlagsDirectionRightToLeft;
Gdip.StringFormat_SetFormatFlags(format, formatFlags);
@@ -2266,7 +2269,8 @@ public void drawText (String string, int x, int y, int flags) {
Gdip.Graphics_MeasureString(gdipGraphics, buffer, length, data.gdipFont, pt, format, bounds);
Gdip.Graphics_FillRectangle(gdipGraphics, data.gdipBrush, x, y, Math.round(bounds.Width), Math.round(bounds.Height));
}
- int gstate = 0, brush = getFgBrush();
+ int gstate = 0;
+ int /*long*/ brush = getFgBrush();
if ((data.style & SWT.MIRRORED) != 0) {
switch (Gdip.Brush_GetType(brush)) {
case Gdip.BrushTypeLinearGradient:
@@ -2339,10 +2343,10 @@ public void drawText (String string, int x, int y, int flags) {
OS.DrawText(handle, buffer, buffer.length(), rect, uFormat | OS.DT_CALCRECT);
int width = rect.right - rect.left;
int height = rect.bottom - rect.top;
- int hBitmap = OS.CreateCompatibleBitmap(handle, width, height);
+ int /*long*/ hBitmap = OS.CreateCompatibleBitmap(handle, width, height);
if (hBitmap == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int memDC = OS.CreateCompatibleDC(handle);
- int hOldBitmap = OS.SelectObject(memDC, hBitmap);
+ int /*long*/ memDC = OS.CreateCompatibleDC(handle);
+ int /*long*/ hOldBitmap = OS.SelectObject(memDC, hBitmap);
OS.PatBlt(memDC, 0, 0, width, height, OS.BLACKNESS);
OS.SetBkMode(memDC, OS.TRANSPARENT);
OS.SetTextColor(memDC, foreground);
@@ -2421,7 +2425,7 @@ public void fillArc (int x, int y, int width, int height, int startAngle, int ar
height = -height;
}
if (width == 0 || height == 0 || arcAngle == 0) return;
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
if (width == height) {
Gdip.Graphics_FillPie(gdipGraphics, data.gdipBrush, x, y, width, height, -startAngle, -arcAngle);
@@ -2552,12 +2556,12 @@ public void fillGradientRectangle(int x, int y, int width, int height, boolean v
p2.Y = p1.Y;
}
int rgb = ((fromRGB.red & 0xFF) << 16) | ((fromRGB.green & 0xFF) << 8) | (fromRGB.blue & 0xFF);
- int fromGpColor = Gdip.Color_new(data.alpha << 24 | rgb);
+ int /*long*/ fromGpColor = Gdip.Color_new(data.alpha << 24 | rgb);
if (fromGpColor == 0) SWT.error(SWT.ERROR_NO_HANDLES);
rgb = ((toRGB.red & 0xFF) << 16) | ((toRGB.green & 0xFF) << 8) | (toRGB.blue & 0xFF);
- int toGpColor = Gdip.Color_new(data.alpha << 24 | rgb);
+ int /*long*/ toGpColor = Gdip.Color_new(data.alpha << 24 | rgb);
if (toGpColor == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- int brush = Gdip.LinearGradientBrush_new(p1, p2, fromGpColor, toGpColor);
+ int /*long*/ brush = Gdip.LinearGradientBrush_new(p1, p2, fromGpColor, toGpColor);
Gdip.Graphics_FillRectangle(data.gdipGraphics, brush, x, y, width, height);
Gdip.LinearGradientBrush_delete(brush);
Gdip.Color_delete(fromGpColor);
@@ -2581,10 +2585,10 @@ public void fillGradientRectangle(int x, int y, int width, int height, boolean v
rop2 = OS.GetROP2(handle);
}
if (OS.IsWinNT && rop2 != OS.R2_XORPEN && OS.GetDeviceCaps(handle, OS.TECHNOLOGY) != OS.DT_RASPRINTER) {
- final int hHeap = OS.GetProcessHeap();
- final int pMesh = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, GRADIENT_RECT.sizeof + TRIVERTEX.sizeof * 2);
+ final int /*long*/ hHeap = OS.GetProcessHeap();
+ final int /*long*/ pMesh = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, GRADIENT_RECT.sizeof + TRIVERTEX.sizeof * 2);
if (pMesh == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- final int pVertex = pMesh + GRADIENT_RECT.sizeof;
+ final int /*long*/ pVertex = pMesh + GRADIENT_RECT.sizeof;
GRADIENT_RECT gradientRect = new GRADIENT_RECT();
gradientRect.UpperLeft = 0;
@@ -2803,7 +2807,7 @@ public void fillRoundRectangle (int x, int y, int width, int height, int arcWidt
OS.RoundRect(handle, x,y,x+width+1,y+height+1,arcWidth, arcHeight);
}
-void fillRoundRectangleGdip (int gdipGraphics, int brush, int x, int y, int width, int height, int arcWidth, int arcHeight) {
+void fillRoundRectangleGdip (int /*long*/ gdipGraphics, int /*long*/ brush, int x, int y, int width, int height, int arcWidth, int arcHeight) {
int nx = x;
int ny = y;
int nw = width;
@@ -2824,7 +2828,7 @@ void fillRoundRectangleGdip (int gdipGraphics, int brush, int x, int y, int widt
if (nah < 0)
nah = 0 - nah;
- int path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
+ int /*long*/ path = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
if (path == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (nw > naw) {
if (nh > nah) {
@@ -2857,7 +2861,7 @@ void flush () {
* underline HDC. This is done by calling GetHDC()
* followed by ReleaseHDC().
*/
- int hdc = Gdip.Graphics_GetHDC(data.gdipGraphics);
+ int /*long*/ hdc = Gdip.Graphics_GetHDC(data.gdipGraphics);
Gdip.Graphics_ReleaseHDC(data.gdipGraphics, hdc);
}
}
@@ -3060,7 +3064,7 @@ public int getCharWidth(char ch) {
*/
public Rectangle getClipping() {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Rect rect = new Rect();
Gdip.Graphics_SetPixelOffsetMode(gdipGraphics, Gdip.PixelOffsetModeNone);
@@ -3091,9 +3095,9 @@ public void getClipping (Region region) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (region == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
if (region.isDisposed()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
- int rgn = Gdip.Region_new();
+ int /*long*/ rgn = Gdip.Region_new();
Gdip.Graphics_GetClip(data.gdipGraphics, rgn);
if (Gdip.Region_IsInfinite(rgn, gdipGraphics)) {
Rect rect = new Rect();
@@ -3102,11 +3106,11 @@ public void getClipping (Region region) {
Gdip.Graphics_SetPixelOffsetMode(gdipGraphics, Gdip.PixelOffsetModeHalf);
OS.SetRectRgn(region.handle, rect.X, rect.Y, rect.X + rect.Width, rect.Y + rect.Height);
} else {
- int matrix = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
- int identity = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
+ int /*long*/ matrix = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
+ int /*long*/ identity = Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
Gdip.Graphics_GetTransform(gdipGraphics, matrix);
Gdip.Graphics_SetTransform(gdipGraphics, identity);
- int hRgn = Gdip.Region_GetHRGN(rgn, data.gdipGraphics);
+ int /*long*/ hRgn = Gdip.Region_GetHRGN(rgn, data.gdipGraphics);
Gdip.Graphics_SetTransform(gdipGraphics, matrix);
Gdip.Matrix_delete(identity);
Gdip.Matrix_delete(matrix);
@@ -3127,22 +3131,22 @@ public void getClipping (Region region) {
OS.OffsetRgn (region.handle, pt.x, pt.y);
}
if (!OS.IsWinCE) {
- int metaRgn = OS.CreateRectRgn (0, 0, 0, 0);
+ int /*long*/ metaRgn = OS.CreateRectRgn (0, 0, 0, 0);
if (OS.GetMetaRgn (handle, metaRgn) != 0) {
OS.OffsetRgn (metaRgn, pt.x, pt.y);
OS.CombineRgn (region.handle, metaRgn, region.handle, OS.RGN_AND);
}
OS.DeleteObject(metaRgn);
- int hwnd = data.hwnd;
+ int /*long*/ hwnd = data.hwnd;
if (hwnd != 0 && data.ps != null) {
- int sysRgn = OS.CreateRectRgn (0, 0, 0, 0);
+ int /*long*/ sysRgn = OS.CreateRectRgn (0, 0, 0, 0);
if (OS.GetRandomRgn (handle, sysRgn, OS.SYSRGN) == 1) {
if (OS.WIN32_VERSION >= OS.VERSION(4, 10)) {
if ((OS.GetLayout(handle) & OS.LAYOUT_RTL) != 0) {
int nBytes = OS.GetRegionData (sysRgn, 0, null);
int [] lpRgnData = new int [nBytes / 4];
OS.GetRegionData (sysRgn, nBytes, lpRgnData);
- int newSysRgn = OS.ExtCreateRegion(new float [] {-1, 0, 0, 1, 0, 0}, nBytes, lpRgnData);
+ int /*long*/ newSysRgn = OS.ExtCreateRegion(new float [] {-1, 0, 0, 1, 0, 0}, nBytes, lpRgnData);
OS.DeleteObject(sysRgn);
sysRgn = newSysRgn;
}
@@ -3166,7 +3170,7 @@ int getCodePage () {
return lpCs[1];
}
-int getFgBrush() {
+int /*long*/ getFgBrush() {
return data.foregroundPattern != null ? data.foregroundPattern.handle : data.gdipFgBrush;
}
@@ -3499,10 +3503,10 @@ public void getTransform(Transform transform) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (transform == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
Gdip.Graphics_GetTransform(gdipGraphics, transform.handle);
- int identity = identity();
+ int /*long*/ identity = identity();
Gdip.Matrix_Invert(identity);
Gdip.Matrix_Multiply(transform.handle, identity, Gdip.MatrixOrderAppend);
Gdip.Matrix_delete(identity);
@@ -3539,7 +3543,7 @@ public boolean getXORMode() {
void initGdip() {
data.device.checkGDIP();
- int gdipGraphics = data.gdipGraphics;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) return;
/*
* Feature in GDI+. The GDI+ clipping set with Graphics->SetClip()
@@ -3548,7 +3552,7 @@ void initGdip() {
* cannot be reset. The fix is to clear the clipping before
* the GDI+ graphics is created and reset it afterwards.
*/
- int hRgn = OS.CreateRectRgn(0, 0, 0, 0);
+ int /*long*/ hRgn = OS.CreateRectRgn(0, 0, 0, 0);
int result = OS.GetClipRgn(handle, hRgn);
if (!OS.IsWinCE) {
POINT pt = new POINT ();
@@ -3573,7 +3577,7 @@ void initGdip() {
Gdip.Graphics_SetPageUnit(gdipGraphics, Gdip.UnitPixel);
Gdip.Graphics_SetPixelOffsetMode(gdipGraphics, Gdip.PixelOffsetModeHalf);
if ((data.style & SWT.MIRRORED) != 0) {
- int matrix = identity();
+ int /*long*/ matrix = identity();
Gdip.Graphics_SetTransform(gdipGraphics, matrix);
Gdip.Matrix_delete(matrix);
}
@@ -3592,7 +3596,7 @@ void initGdip() {
}
}
-int identity() {
+int /*long*/ identity() {
if ((data.style & SWT.MIRRORED) != 0) {
int width = 0;
Image image = data.image;
@@ -3612,7 +3616,7 @@ int identity() {
return Gdip.Matrix_new(1, 0, 0, 1, 0, 0);
}
-void init(Drawable drawable, GCData data, int hDC) {
+void init(Drawable drawable, GCData data, int /*long*/ hDC) {
int foreground = data.foreground;
if (foreground != -1) {
data.state &= ~(FOREGROUND | FOREGROUND_TEXT | PEN);
@@ -3626,13 +3630,13 @@ void init(Drawable drawable, GCData data, int hDC) {
data.background = OS.GetBkColor(hDC);
}
data.state &= ~(NULL_BRUSH | NULL_PEN);
- int hFont = data.hFont;
+ int /*long*/ hFont = data.hFont;
if (hFont != 0) {
data.state &= ~FONT;
} else {
hFont = OS.GetCurrentObject(hDC, OS.OBJ_FONT);
}
- int hPalette = data.device.hPalette;
+ int /*long*/ hPalette = data.device.hPalette;
if (hPalette != 0) {
OS.SelectPalette(hDC, hPalette, true);
OS.RealizePalette(hDC);
@@ -3673,7 +3677,7 @@ void init(Drawable drawable, GCData data, int hDC) {
* @see #equals
*/
public int hashCode () {
- return handle;
+ return (int)/*64*/handle;
}
/**
@@ -3692,7 +3696,7 @@ public int hashCode () {
*/
public boolean isClipped() {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- int region = OS.CreateRectRgn(0, 0, 0, 0);
+ int /*long*/ region = OS.CreateRectRgn(0, 0, 0, 0);
int result = OS.GetClipRgn(handle, region);
OS.DeleteObject(region);
return result > 0;
@@ -3712,7 +3716,7 @@ public boolean isDisposed() {
return handle == 0;
}
-float measureSpace(int font, int format) {
+float measureSpace(int /*long*/ font, int /*long*/ format) {
PointF pt = new PointF();
RectF bounds = new RectF();
Gdip.Graphics_MeasureString(data.gdipGraphics, new char[]{' '}, 1, font, pt, format, bounds);
@@ -3915,12 +3919,12 @@ public void setBackgroundPattern (Pattern pattern) {
data.state &= ~BACKGROUND;
}
-void setClipping(int clipRgn) {
- int hRgn = clipRgn;
- int gdipGraphics = data.gdipGraphics;
+void setClipping(int /*long*/ clipRgn) {
+ int /*long*/ hRgn = clipRgn;
+ int /*long*/ gdipGraphics = data.gdipGraphics;
if (gdipGraphics != 0) {
if (hRgn != 0) {
- int region = Gdip.Region_new(hRgn);
+ int /*long*/ region = Gdip.Region_new(hRgn);
Gdip.Graphics_SetClip(gdipGraphics, region, Gdip.CombineModeReplace);
Gdip.Region_delete(region);
} else {
@@ -3959,7 +3963,7 @@ void setClipping(int clipRgn) {
*/
public void setClipping (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- int hRgn = OS.CreateRectRgn(x, y, x + width, y + height);
+ int /*long*/ hRgn = OS.CreateRectRgn(x, y, x + width, y + height);
setClipping(hRgn);
OS.DeleteObject(hRgn);
}
@@ -4588,7 +4592,7 @@ public void setTransform(Transform transform) {
if (transform != null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.gdipGraphics == 0 && transform == null) return;
initGdip();
- int identity = identity();
+ int /*long*/ identity = identity();
if (transform != null) {
Gdip.Matrix_Multiply(identity, transform.handle, Gdip.MatrixOrderPrepend);
}
@@ -4631,7 +4635,7 @@ public Point stringExtent(String string) {
} else {
buffer = new char[]{' '};
}
- int format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
+ int /*long*/ format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
int formatFlags = Gdip.StringFormat_GetFormatFlags(format) | Gdip.StringFormatFlagsMeasureTrailingSpaces;
if ((data.style & SWT.MIRRORED) != 0) formatFlags |= Gdip.StringFormatFlagsDirectionRightToLeft;
Gdip.StringFormat_SetFormatFlags(format, formatFlags);
@@ -4722,7 +4726,7 @@ public Point textExtent(String string, int flags) {
} else {
buffer = new char[]{' '};
}
- int format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
+ int /*long*/ format = Gdip.StringFormat_Clone(Gdip.StringFormat_GenericTypographic());
int formatFlags = Gdip.StringFormat_GetFormatFlags(format) | Gdip.StringFormatFlagsMeasureTrailingSpaces;
if ((data.style & SWT.MIRRORED) != 0) formatFlags |= Gdip.StringFormatFlagsDirectionRightToLeft;
Gdip.StringFormat_SetFormatFlags(format, formatFlags);
@@ -4777,7 +4781,7 @@ public String toString () {
*/
public static GC win32_new(Drawable drawable, GCData data) {
GC gc = new GC();
- int hDC = drawable.internal_new_GC(data);
+ int /*long*/ hDC = drawable.internal_new_GC(data);
gc.device = data.device;
gc.init(drawable, data, hDC);
return gc;
@@ -4798,7 +4802,7 @@ public static GC win32_new(Drawable drawable, GCData data) {
*
* @return a new <code>GC</code>
*/
-public static GC win32_new(int hDC, GCData data) {
+public static GC win32_new(int /*long*/ hDC, GCData data) {
GC gc = new GC();
gc.device = data.device;
gc.init(null, data, hDC);