Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties418
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.properties3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp923
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.h22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_custom.cpp130
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp117
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h99
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.cpp168
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.h61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_gdip.rc45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java126
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/GdiplusStartupInput.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/PointF.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Rect.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/RectF.java19
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java22
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java452
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java154
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Transform.java125
21 files changed, 2949 insertions, 18 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties
new file mode 100644
index 0000000000..b89c701f34
--- /dev/null
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties
@@ -0,0 +1,418 @@
+###############################################################################
+# Copyright (c) 2004 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Common Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/cpl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+org_eclipse_swt_internal_gdip_Gdip=flags=cpp
+Gdip_Bitmap_delete=flags=delete
+Gdip_Bitmap_delete_0=
+
+Gdip_Bitmap_new=flags=new
+Gdip_Bitmap_new_0=cast=HBITMAP
+Gdip_Bitmap_new_1=cast=HPALETTE
+
+Gdip_Color_delete=flags=delete
+Gdip_Color_delete_0=
+
+Gdip_Color_new=flags=new
+Gdip_Color_new_0=cast=ARGB
+
+Gdip_FontFamily_delete=flags=delete
+Gdip_FontFamily_delete_0=
+
+Gdip_FontFamily_new=flags=new
+
+Gdip_Font_GetFamily=flags=cpp
+Gdip_Font_GetFamily_0=cast=(Font *)
+Gdip_Font_GetFamily_1=cast=(FontFamily *)
+
+Gdip_Font_GetSize=flags=cpp
+Gdip_Font_GetSize_0=cast=(Font *)
+
+Gdip_Font_GetStyle=flags=cpp
+Gdip_Font_GetStyle_0=cast=(Font *)
+
+Gdip_Font_delete=flags=delete
+Gdip_Font_delete_0=
+
+Gdip_Font_new=flags=new
+Gdip_Font_new_0=cast=(HDC)
+Gdip_Font_new_1=cast=(HFONT
+
+Gdip_GdiplusShutdown=
+Gdip_GdiplusShutdown_0=cast=ULONG_PTR
+
+Gdip_GdiplusStartup=
+Gdip_GdiplusStartup_0=cast=(ULONG_PTR *)
+Gdip_GdiplusStartup_1=cast=const GdiplusStartupInput *
+Gdip_GdiplusStartup_2=cast=GdiplusStartupOutput *
+
+Gdip_GraphicsPath_AddArc=flags=cpp
+Gdip_GraphicsPath_AddArc_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddArc_1=cast=(REAL)
+Gdip_GraphicsPath_AddArc_2=cast=(REAL)
+Gdip_GraphicsPath_AddArc_3=cast=(REAL)
+Gdip_GraphicsPath_AddArc_4=cast=(REAL)
+Gdip_GraphicsPath_AddArc_5=cast=(REAL)
+Gdip_GraphicsPath_AddArc_6=cast=(REAL)
+
+Gdip_GraphicsPath_AddBezier=flags=cpp
+Gdip_GraphicsPath_AddBezier_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddBezier_1=cast=(REAL)
+Gdip_GraphicsPath_AddBezier_2=cast=REAL
+Gdip_GraphicsPath_AddBezier_3=cast=REAL
+Gdip_GraphicsPath_AddBezier_4=cast=(REAL)
+Gdip_GraphicsPath_AddBezier_5=cast=REAL
+Gdip_GraphicsPath_AddBezier_6=cast=(REAL)
+Gdip_GraphicsPath_AddBezier_7=cast=(REAL)
+Gdip_GraphicsPath_AddBezier_8=cast=(REAL)
+
+Gdip_GraphicsPath_AddLine=flags=cpp
+Gdip_GraphicsPath_AddLine_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddLine_1=cast=REAL
+Gdip_GraphicsPath_AddLine_2=cast=REAL
+Gdip_GraphicsPath_AddLine_3=cast=REAL
+Gdip_GraphicsPath_AddLine_4=cast=REAL
+
+Gdip_GraphicsPath_AddPath=flags=cpp
+Gdip_GraphicsPath_AddPath_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddPath_1=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddPath_2=cast=BOOL
+
+Gdip_GraphicsPath_AddRectangle=flags=cpp
+Gdip_GraphicsPath_AddRectangle_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddRectangle_1=flags=struct
+
+Gdip_GraphicsPath_AddString=flags=cpp
+Gdip_GraphicsPath_AddString_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_AddString_1=cast=const WCHAR *
+Gdip_GraphicsPath_AddString_2=cast=INT
+Gdip_GraphicsPath_AddString_3=cast=const FontFamily *
+Gdip_GraphicsPath_AddString_4=cast=INT
+Gdip_GraphicsPath_AddString_5=cast=(REAL)
+Gdip_GraphicsPath_AddString_6=cast=const PointF *,flags=struct
+Gdip_GraphicsPath_AddString_7=cast=const StringFormat *
+
+Gdip_GraphicsPath_CloseFigure=flags=cpp
+Gdip_GraphicsPath_CloseFigure_0=cast=(GraphicsPath *)
+
+Gdip_GraphicsPath_GetLastPoint=flags=cpp
+Gdip_GraphicsPath_GetLastPoint_0=cast=(GraphicsPath *)
+Gdip_GraphicsPath_GetLastPoint_1=cast=(PointF *)
+
+Gdip_GraphicsPath_delete=flags=delete
+Gdip_GraphicsPath_delete_0=
+
+Gdip_GraphicsPath_new=flags=new
+Gdip_GraphicsPath_new_0=cast=FillMode
+
+Gdip_Graphics_DrawArc=flags=cpp
+Gdip_Graphics_DrawArc_0=cast=(Graphics *)
+Gdip_Graphics_DrawArc_1=cast=(Pen *)
+Gdip_Graphics_DrawArc_2=cast=INT
+Gdip_Graphics_DrawArc_3=cast=INT
+Gdip_Graphics_DrawArc_4=cast=(INT)
+Gdip_Graphics_DrawArc_5=cast=(INT)
+Gdip_Graphics_DrawArc_6=cast=REAL
+Gdip_Graphics_DrawArc_7=cast=REAL
+
+Gdip_Graphics_DrawEllipse=flags=cpp
+Gdip_Graphics_DrawEllipse_0=cast=(Graphics *)
+Gdip_Graphics_DrawEllipse_1=cast=(Pen *)
+Gdip_Graphics_DrawEllipse_2=cast=(INT)
+Gdip_Graphics_DrawEllipse_3=cast=(INT)
+Gdip_Graphics_DrawEllipse_4=cast=(INT)
+Gdip_Graphics_DrawEllipse_5=cast=(INT)
+
+Gdip_Graphics_1DrawImage__IIII=flags=cpp
+Gdip_Graphics_1DrawImage__IIII_0=cast=(Graphics *)
+Gdip_Graphics_1DrawImage__IIII_1=cast=(Image *)
+Gdip_Graphics_1DrawImage__IIII_2=cast=(INT)
+Gdip_Graphics_1DrawImage__IIII_3=cast=(INT)
+
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII=flags=cpp
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_0=cast=(Graphics *)
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_1=cast=(Image *)
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_2=cast=const Rect *,flags=struct
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_3=cast=(INT)
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_4=cast=(INT)
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_5=cast=INT
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_6=cast=INT
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_7=cast=(Unit)
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_8=cast=ImageAttributes *
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_9=cast=DrawImageAbort
+Gdip_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_10=cast=VOID *
+
+Gdip_Graphics_DrawLine=flags=cpp
+Gdip_Graphics_DrawLine_0=cast=(Graphics *)
+Gdip_Graphics_DrawLine_1=cast=(Pen *)
+Gdip_Graphics_DrawLine_2=cast=(INT)
+Gdip_Graphics_DrawLine_3=cast=(INT)
+Gdip_Graphics_DrawLine_4=cast=(INT)
+Gdip_Graphics_DrawLine_5=cast=(INT)
+
+Gdip_Graphics_DrawLines=flags=no_gen cpp
+Gdip_Graphics_DrawLines_0=cast=(Graphics *)
+Gdip_Graphics_DrawLines_1=cast=(Pen *)
+Gdip_Graphics_DrawLines_2=cast=(Point *)
+Gdip_Graphics_DrawLines_3=cast=INT
+
+Gdip_Graphics_DrawPath=flags=cpp
+Gdip_Graphics_DrawPath_0=cast=(Graphics *)
+Gdip_Graphics_DrawPath_1=cast=(Pen *)
+Gdip_Graphics_DrawPath_2=cast=(GraphicsPath *)
+
+Gdip_Graphics_DrawPolygon=flags=no_gen cpp
+Gdip_Graphics_DrawPolygon_0=cast=(Graphics *)
+Gdip_Graphics_DrawPolygon_1=cast=(Pen *)
+Gdip_Graphics_DrawPolygon_2=cast=(Point *)
+Gdip_Graphics_DrawPolygon_3=cast=INT
+
+Gdip_Graphics_DrawRectangle=flags=cpp
+Gdip_Graphics_DrawRectangle_0=cast=(Graphics *)
+Gdip_Graphics_DrawRectangle_1=cast=(Pen *)
+Gdip_Graphics_DrawRectangle_2=cast=(INT)
+Gdip_Graphics_DrawRectangle_3=cast=INT
+Gdip_Graphics_DrawRectangle_4=cast=INT
+Gdip_Graphics_DrawRectangle_5=cast=INT
+
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I=flags=cpp
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_0=cast=(Graphics *)
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_1=cast=WCHAR *
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_2=cast=int
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_3=cast=Font *
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_4=flags=struct
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_5=cast=Brush *
+
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II=flags=cpp
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_0=cast=(Graphics *)
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_1=cast=WCHAR *
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_2=cast=int
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_3=cast=Font *
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_4=flags=struct
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_5=cast=StringFormat *
+Gdip_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_6=cast=(Brush *)
+
+Gdip_Graphics_FillEllipse=flags=cpp
+Gdip_Graphics_FillEllipse_0=cast=(Graphics *)
+Gdip_Graphics_FillEllipse_1=cast=(Brush *)
+Gdip_Graphics_FillEllipse_2=cast=(INT)
+Gdip_Graphics_FillEllipse_3=cast=(INT)
+Gdip_Graphics_FillEllipse_4=cast=(INT)
+Gdip_Graphics_FillEllipse_5=cast=(INT)
+
+Gdip_Graphics_FillPath=flags=cpp
+Gdip_Graphics_FillPath_0=cast=(Graphics *)
+Gdip_Graphics_FillPath_1=cast=(Brush *)
+Gdip_Graphics_FillPath_2=cast=(GraphicsPath *)
+
+Gdip_Graphics_FillPie=flags=cpp
+Gdip_Graphics_FillPie_0=cast=(Graphics *)
+Gdip_Graphics_FillPie_1=cast=(Brush *)
+Gdip_Graphics_FillPie_2=cast=(INT)
+Gdip_Graphics_FillPie_3=cast=(INT)
+Gdip_Graphics_FillPie_4=cast=(INT)
+Gdip_Graphics_FillPie_5=cast=(INT)
+Gdip_Graphics_FillPie_6=cast=(REAL)
+Gdip_Graphics_FillPie_7=cast=(REAL)
+
+Gdip_Graphics_FillPolygon=flags=no_gen cpp
+Gdip_Graphics_FillPolygon_0=cast=(Graphics *)
+Gdip_Graphics_FillPolygon_1=cast=(Brush *)
+Gdip_Graphics_FillPolygon_2=cast=Point *
+Gdip_Graphics_FillPolygon_3=cast=(INT)
+Gdip_Graphics_FillPolygon_4=cast=FillMode
+
+Gdip_Graphics_FillRectangle=flags=cpp
+Gdip_Graphics_FillRectangle_0=cast=(Graphics *)
+Gdip_Graphics_FillRectangle_1=cast=(Brush *)
+Gdip_Graphics_FillRectangle_2=cast=(INT)
+Gdip_Graphics_FillRectangle_3=cast=INT
+Gdip_Graphics_FillRectangle_4=cast=INT
+Gdip_Graphics_FillRectangle_5=cast=INT
+
+Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2=flags=cpp
+Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2_0=cast=Graphics *
+Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2_1=
+
+Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2=flags=cpp
+Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_0=cast=(Graphics *)
+Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_1=
+
+Gdip_Graphics_GetInterpolationMode=flags=cpp
+Gdip_Graphics_GetInterpolationMode_0=cast=(Graphics *)
+
+Gdip_Graphics_ResetClip=flags=cpp
+Gdip_Graphics_ResetClip_0=cast=(Graphics *)
+
+Gdip_Graphics_1SetClip__II=flags=cpp
+Gdip_Graphics_1SetClip__II_0=cast=(Graphics *)
+Gdip_Graphics_1SetClip__II_1=cast=GraphicsPath *
+
+Gdip_Graphics_1SetClip__III=flags=cpp
+Gdip_Graphics_1SetClip__III_0=cast=(Graphics *)
+Gdip_Graphics_1SetClip__III_1=cast=HRGN
+Gdip_Graphics_1SetClip__III_2=cast=CombineMode
+
+Gdip_Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2=flags=cpp
+Gdip_Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2_0=cast=(Graphics *)
+Gdip_Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2_1=flags=struct
+
+Gdip_Graphics_SetInterpolationMode=flags=cpp
+Gdip_Graphics_SetInterpolationMode_0=cast=(Graphics *)
+Gdip_Graphics_SetInterpolationMode_1=cast=InterpolationMode
+
+Gdip_Graphics_SetTransform=flags=cpp
+Gdip_Graphics_SetTransform_0=cast=(Graphics *)
+Gdip_Graphics_SetTransform_1=cast=(Matrix *)
+
+Gdip_Graphics_delete=flags=delete
+Gdip_Graphics_delete_0=
+
+Gdip_Graphics_new=flags=new
+Gdip_Graphics_new_0=cast=(HDC)
+
+Gdip_LinearGradientBrush_delete=flags=delete
+Gdip_LinearGradientBrush_delete_0=
+
+Gdip_LinearGradientBrush_new=flags=new
+Gdip_LinearGradientBrush_new_0=flags=struct
+Gdip_LinearGradientBrush_new_1=flags=struct
+Gdip_LinearGradientBrush_new_2=cast=Color *,flags=struct
+Gdip_LinearGradientBrush_new_3=cast=Color *,flags=struct
+
+Gdip_Matrix_GetElements=flags=cpp
+Gdip_Matrix_GetElements_0=cast=(Matrix *)
+Gdip_Matrix_GetElements_1=cast=(REAL *)
+
+Gdip_Matrix_Invert=flags=cpp
+Gdip_Matrix_Invert_0=cast=(Matrix *)
+
+Gdip_Matrix_IsIdentity=flags=cpp
+Gdip_Matrix_IsIdentity_0=cast=(Matrix *)
+
+Gdip_Matrix_Multiply=flags=cpp
+Gdip_Matrix_Multiply_0=cast=(Matrix *)
+Gdip_Matrix_Multiply_1=cast=(Matrix *)
+Gdip_Matrix_Multiply_2=cast=(MatrixOrder)
+
+Gdip_Matrix_Rotate=flags=cpp
+Gdip_Matrix_Rotate_0=cast=(Matrix *)
+Gdip_Matrix_Rotate_1=cast=(REAL)
+Gdip_Matrix_Rotate_2=cast=(MatrixOrder)
+
+Gdip_Matrix_Scale=flags=cpp
+Gdip_Matrix_Scale_0=cast=(Matrix *)
+Gdip_Matrix_Scale_1=cast=(REAL)
+Gdip_Matrix_Scale_2=cast=(REAL)
+Gdip_Matrix_Scale_3=cast=(MatrixOrder)
+
+Gdip_Matrix_SetElements=flags=cpp
+Gdip_Matrix_SetElements_0=cast=(Matrix *)
+Gdip_Matrix_SetElements_1=cast=(REAL)
+Gdip_Matrix_SetElements_2=cast=(REAL)
+Gdip_Matrix_SetElements_3=cast=(REAL)
+Gdip_Matrix_SetElements_4=cast=(REAL)
+Gdip_Matrix_SetElements_5=cast=(REAL)
+Gdip_Matrix_SetElements_6=cast=(REAL)
+
+Gdip_Matrix_Shear=flags=cpp
+Gdip_Matrix_Shear_0=cast=(Matrix *)
+Gdip_Matrix_Shear_1=cast=(REAL)
+Gdip_Matrix_Shear_2=cast=(REAL)
+Gdip_Matrix_Shear_3=cast=(MatrixOrder)
+
+Gdip_Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I=flags=cpp
+Gdip_Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I_0=cast=(Matrix *)
+Gdip_Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I_1=
+Gdip_Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I_2=
+
+Gdip_Matrix_1TransformPoints__I_3FI=flags=no_gen
+Gdip_Matrix_1TransformPoints__I_3FI_0=
+Gdip_Matrix_1TransformPoints__I_3FI_1=
+Gdip_Matrix_1TransformPoints__I_3FI_2=
+
+Gdip_Matrix_Translate=flags=cpp
+Gdip_Matrix_Translate_0=cast=(Matrix *)
+Gdip_Matrix_Translate_1=cast=(REAL)
+Gdip_Matrix_Translate_2=cast=(REAL)
+Gdip_Matrix_Translate_3=cast=(MatrixOrder)
+
+Gdip_Matrix_delete=flags=delete
+Gdip_Matrix_delete_0=
+
+Gdip_Matrix_new=flags=new
+Gdip_Matrix_new_0=cast=(REAL)
+Gdip_Matrix_new_1=cast=(REAL)
+Gdip_Matrix_new_2=cast=(REAL)
+Gdip_Matrix_new_3=cast=(REAL)
+Gdip_Matrix_new_4=cast=(REAL)
+Gdip_Matrix_new_5=cast=(REAL)
+
+Gdip_Pen_SetDashPattern=flags=cpp
+Gdip_Pen_SetDashPattern_0=cast=Pen *
+Gdip_Pen_SetDashPattern_1=cast=(REAL *)
+Gdip_Pen_SetDashPattern_2=cast=int
+
+Gdip_Pen_SetDashStyle=flags=cpp
+Gdip_Pen_SetDashStyle_0=cast=Pen *
+Gdip_Pen_SetDashStyle_1=cast=DashStyle
+
+Gdip_Pen_SetLineCap=flags=cpp
+Gdip_Pen_SetLineCap_0=cast=(Pen *)
+Gdip_Pen_SetLineCap_1=cast=(LineCap)
+Gdip_Pen_SetLineCap_2=cast=(LineCap)
+Gdip_Pen_SetLineCap_3=cast=(DashCap)
+
+Gdip_Pen_SetLineJoin=flags=cpp
+Gdip_Pen_SetLineJoin_0=cast=(Pen *)
+Gdip_Pen_SetLineJoin_1=cast=(LineJoin)
+
+Gdip_Pen_delete=flags=delete
+Gdip_Pen_delete_0=
+
+Gdip_Pen_new=flags=new
+Gdip_Pen_new_0=cast=(Color *),flags=struct
+Gdip_Pen_new_1=cast=REAL
+
+Gdip_Point_delete=flags=delete
+Gdip_Point_delete_0=
+
+Gdip_Point_new=flags=new
+Gdip_Point_new_0=
+Gdip_Point_new_1=
+
+Gdip_SolidBrush_delete=flags=delete
+Gdip_SolidBrush_delete_0=
+
+Gdip_SolidBrush_new=flags=new
+Gdip_SolidBrush_new_0=cast=(Color *,flags=struct
+
+
+org_eclipse_swt_internal_gdip_GdiplusStartupInput=flags=cpp
+GdiplusStartupInput_GdiplusVersion=
+GdiplusStartupInput_DebugEventCallback=cast=DebugEventProc
+GdiplusStartupInput_SuppressBackgroundThread=cast=BOOL
+GdiplusStartupInput_SuppressExternalCodecs=cast=BOOL
+
+org_eclipse_swt_internal_gdip_PointF=
+PointF_X=cast=REAL
+PointF_Y=cast=REAL
+
+org_eclipse_swt_internal_gdip_Rect=
+Rect_X=
+Rect_Y=
+Rect_Width=
+Rect_Height=
+
+org_eclipse_swt_internal_gdip_RectF=
+RectF_X=
+RectF_Y=
+RectF_Width=
+RectF_Height=
+
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.properties
index e5a321f1c2..3c537da0a1 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.properties
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.properties
@@ -40,4 +40,5 @@ org.eclipse.swt.internal.motif.OS,../org.eclipse.swt/Eclipse SWT PI/motif/librar
org.eclipse.swt.internal.mozilla.XPCOM,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\
org.eclipse.swt.internal.ole.win32.COM,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
org.eclipse.swt.internal.photon.OS,../org.eclipse.swt/Eclipse SWT PI/photon/library/,\
-org.eclipse.swt.internal.win32.OS,../org.eclipse.swt/Eclipse SWT PI/win32/library/
+org.eclipse.swt.internal.win32.OS,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\
+org.eclipse.swt.internal.gdip.Gdip,../org.eclipse.swt/Eclipse SWT PI/win32/library/
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp
new file mode 100644
index 0000000000..fa3dfbb3c5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp
@@ -0,0 +1,923 @@
+/*******************************************************************************
+* Copyright (c) 2000, 2004 IBM Corporation and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Common Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/cpl-v10.html
+*
+* Contributors:
+* IBM Corporation - initial API and implementation
+*******************************************************************************/
+
+#include "swt.h"
+#include "gdip_structs.h"
+#include "gdip_stats.h"
+
+extern "C" {
+
+#define Gdip_NATIVE(func) Java_org_eclipse_swt_internal_gdip_Gdip_##func
+
+#ifndef NO_Bitmap_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Bitmap_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Bitmap_1delete_FUNC);
+ delete (Bitmap *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Bitmap_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Bitmap_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Bitmap_1new)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Bitmap_1new_FUNC);
+ rc = (jint)new Bitmap((HBITMAP)arg0, (HPALETTE)arg1);
+ Gdip_NATIVE_EXIT(env, that, Bitmap_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Color_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Color_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Color_1delete_FUNC);
+ delete (Color *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Color_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Color_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Color_1new)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Color_1new_FUNC);
+ rc = (jint)new Color((ARGB)arg0);
+ Gdip_NATIVE_EXIT(env, that, Color_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_FontFamily_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(FontFamily_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, FontFamily_1delete_FUNC);
+ delete (FontFamily *)arg0;
+ Gdip_NATIVE_EXIT(env, that, FontFamily_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_FontFamily_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(FontFamily_1new)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, FontFamily_1new_FUNC);
+ rc = (jint)new FontFamily();
+ Gdip_NATIVE_EXIT(env, that, FontFamily_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Font_1GetFamily
+JNIEXPORT jint JNICALL Gdip_NATIVE(Font_1GetFamily)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Font_1GetFamily_FUNC);
+ rc = (jint)((Font *)arg0)->GetFamily((FontFamily *)arg1);
+ Gdip_NATIVE_EXIT(env, that, Font_1GetFamily_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Font_1GetSize
+JNIEXPORT jfloat JNICALL Gdip_NATIVE(Font_1GetSize)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jfloat rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Font_1GetSize_FUNC);
+ rc = (jfloat)((Font *)arg0)->GetSize();
+ Gdip_NATIVE_EXIT(env, that, Font_1GetSize_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Font_1GetStyle
+JNIEXPORT jint JNICALL Gdip_NATIVE(Font_1GetStyle)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Font_1GetStyle_FUNC);
+ rc = (jint)((Font *)arg0)->GetStyle();
+ Gdip_NATIVE_EXIT(env, that, Font_1GetStyle_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Font_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Font_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Font_1delete_FUNC);
+ delete (Font *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Font_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Font_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Font_1new)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Font_1new_FUNC);
+ rc = (jint)new Font((HDC)arg0, (HFONT)arg1);
+ Gdip_NATIVE_EXIT(env, that, Font_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GdiplusShutdown
+JNIEXPORT void JNICALL Gdip_NATIVE(GdiplusShutdown)
+ (JNIEnv *env, jclass that, jintArray arg0)
+{
+ jint *lparg0=NULL;
+ Gdip_NATIVE_ENTER(env, that, GdiplusShutdown_FUNC);
+ if (arg0) if ((lparg0 = env->GetIntArrayElements(arg0, NULL)) == NULL) goto fail;
+ GdiplusShutdown((ULONG_PTR)lparg0);
+fail:
+ if (arg0 && lparg0) env->ReleaseIntArrayElements(arg0, lparg0, 0);
+ Gdip_NATIVE_EXIT(env, that, GdiplusShutdown_FUNC);
+}
+#endif
+
+#ifndef NO_GdiplusStartup
+JNIEXPORT jint JNICALL Gdip_NATIVE(GdiplusStartup)
+ (JNIEnv *env, jclass that, jintArray arg0, jobject arg1, jint arg2)
+{
+ jint *lparg0=NULL;
+ GdiplusStartupInput _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GdiplusStartup_FUNC);
+ if (arg0) if ((lparg0 = env->GetIntArrayElements(arg0, NULL)) == NULL) goto fail;
+ if (arg1) if ((lparg1 = getGdiplusStartupInputFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)GdiplusStartup((ULONG_PTR *)lparg0, (const GdiplusStartupInput *)lparg1, (GdiplusStartupOutput *)arg2);
+fail:
+ if (arg1 && lparg1) setGdiplusStartupInputFields(env, arg1, lparg1);
+ if (arg0 && lparg0) env->ReleaseIntArrayElements(arg0, lparg0, 0);
+ Gdip_NATIVE_EXIT(env, that, GdiplusStartup_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1AddArc
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1AddArc)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5, jfloat arg6)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1AddArc_FUNC);
+ rc = (jint)((GraphicsPath *)arg0)->AddArc((REAL)arg1, (REAL)arg2, (REAL)arg3, (REAL)arg4, (REAL)arg5, (REAL)arg6);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1AddArc_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1AddBezier
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1AddBezier)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5, jfloat arg6, jfloat arg7, jfloat arg8)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1AddBezier_FUNC);
+ rc = (jint)((GraphicsPath *)arg0)->AddBezier((REAL)arg1, (REAL)arg2, (REAL)arg3, (REAL)arg4, (REAL)arg5, (REAL)arg6, (REAL)arg7, (REAL)arg8);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1AddBezier_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1AddLine
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1AddLine)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1AddLine_FUNC);
+ rc = (jint)((GraphicsPath *)arg0)->AddLine((REAL)arg1, (REAL)arg2, (REAL)arg3, (REAL)arg4);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1AddLine_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1AddPath
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1AddPath)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1AddPath_FUNC);
+ rc = (jint)((GraphicsPath *)arg0)->AddPath((GraphicsPath *)arg1, (BOOL)arg2);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1AddPath_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1AddRectangle
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1AddRectangle)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1)
+{
+ RectF _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1AddRectangle_FUNC);
+ if (arg1) if ((lparg1 = getRectFFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)((GraphicsPath *)arg0)->AddRectangle(*lparg1);
+fail:
+ if (arg1 && lparg1) setRectFFields(env, arg1, lparg1);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1AddRectangle_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1AddString
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1AddString)
+ (JNIEnv *env, jclass that, jint arg0, jcharArray arg1, jint arg2, jint arg3, jint arg4, jfloat arg5, jobject arg6, jint arg7)
+{
+ jchar *lparg1=NULL;
+ PointF _arg6, *lparg6=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1AddString_FUNC);
+ if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getPointFFields(env, arg6, &_arg6)) == NULL) goto fail;
+ rc = (jint)((GraphicsPath *)arg0)->AddString((const WCHAR *)lparg1, (INT)arg2, (const FontFamily *)arg3, (INT)arg4, (REAL)arg5, *(const PointF *)lparg6, (const StringFormat *)arg7);
+fail:
+ if (arg6 && lparg6) setPointFFields(env, arg6, lparg6);
+ if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1AddString_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1CloseFigure
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1CloseFigure)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1CloseFigure_FUNC);
+ rc = (jint)((GraphicsPath *)arg0)->CloseFigure();
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1CloseFigure_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1GetLastPoint
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1GetLastPoint)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1)
+{
+ PointF _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1GetLastPoint_FUNC);
+ if (arg1) if ((lparg1 = getPointFFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)((GraphicsPath *)arg0)->GetLastPoint((PointF *)lparg1);
+fail:
+ if (arg1 && lparg1) setPointFFields(env, arg1, lparg1);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1GetLastPoint_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GraphicsPath_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(GraphicsPath_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1delete_FUNC);
+ delete (GraphicsPath *)arg0;
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_GraphicsPath_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(GraphicsPath_1new)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, GraphicsPath_1new_FUNC);
+ rc = (jint)new GraphicsPath((FillMode)arg0);
+ Gdip_NATIVE_EXIT(env, that, GraphicsPath_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawArc
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawArc)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jfloat arg6, jfloat arg7)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawArc_FUNC);
+ rc = (jint)((Graphics *)arg0)->DrawArc((Pen *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5, (REAL)arg6, (REAL)arg7);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawArc_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawEllipse
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawEllipse)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawEllipse_FUNC);
+ rc = (jint)((Graphics *)arg0)->DrawEllipse((Pen *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawEllipse_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawImage__IIII
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawImage__IIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawImage__IIII_FUNC);
+ rc = (jint)((Graphics *)arg0)->DrawImage((Image *)arg1, (INT)arg2, (INT)arg3);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawImage__IIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8, jint arg9, jint arg10)
+{
+ Rect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_FUNC);
+ if (arg2) if ((lparg2 = getRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((Graphics *)arg0)->DrawImage((Image *)arg1, *(const Rect *)lparg2, (INT)arg3, (INT)arg4, (INT)arg5, (INT)arg6, (Unit)arg7, (ImageAttributes *)arg8, (DrawImageAbort)arg9, (VOID *)arg10);
+fail:
+ if (arg2 && lparg2) setRectFields(env, arg2, lparg2);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawLine
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawLine)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawLine_FUNC);
+ rc = (jint)((Graphics *)arg0)->DrawLine((Pen *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawLine_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawPath
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawPath)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawPath_FUNC);
+ rc = (jint)((Graphics *)arg0)->DrawPath((Pen *)arg1, (GraphicsPath *)arg2);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawPath_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawRectangle
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawRectangle)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawRectangle_FUNC);
+ rc = (jint)((Graphics *)arg0)->DrawRectangle((Pen *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawRectangle_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I)
+ (JNIEnv *env, jclass that, jint arg0, jcharArray arg1, jint arg2, jint arg3, jobject arg4, jint arg5)
+{
+ jchar *lparg1=NULL;
+ PointF _arg4, *lparg4=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_FUNC);
+ if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getPointFFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((Graphics *)arg0)->DrawString((WCHAR *)lparg1, (int)arg2, (Font *)arg3, *lparg4, (Brush *)arg5);
+fail:
+ if (arg4 && lparg4) setPointFFields(env, arg4, lparg4);
+ if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II)
+ (JNIEnv *env, jclass that, jint arg0, jcharArray arg1, jint arg2, jint arg3, jobject arg4, jint arg5, jint arg6)
+{
+ jchar *lparg1=NULL;
+ PointF _arg4, *lparg4=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_FUNC);
+ if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getPointFFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((Graphics *)arg0)->DrawString((WCHAR *)lparg1, (int)arg2, (Font *)arg3, *lparg4, (StringFormat *)arg5, (Brush *)arg6);
+fail:
+ if (arg4 && lparg4) setPointFFields(env, arg4, lparg4);
+ if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1FillEllipse
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1FillEllipse)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1FillEllipse_FUNC);
+ rc = (jint)((Graphics *)arg0)->FillEllipse((Brush *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1FillEllipse_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1FillPath
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1FillPath)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1FillPath_FUNC);
+ rc = (jint)((Graphics *)arg0)->FillPath((Brush *)arg1, (GraphicsPath *)arg2);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1FillPath_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1FillPie
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1FillPie)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jfloat arg6, jfloat arg7)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1FillPie_FUNC);
+ rc = (jint)((Graphics *)arg0)->FillPie((Brush *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5, (REAL)arg6, (REAL)arg7);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1FillPie_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1FillRectangle
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1FillRectangle)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1FillRectangle_FUNC);
+ rc = (jint)((Graphics *)arg0)->FillRectangle((Brush *)arg1, (INT)arg2, (INT)arg3, (INT)arg4, (INT)arg5);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1FillRectangle_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1)
+{
+ RectF _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC);
+ if (arg1) if ((lparg1 = getRectFFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)((Graphics *)arg0)->GetClipBounds(lparg1);
+fail:
+ if (arg1 && lparg1) setRectFFields(env, arg1, lparg1);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1)
+{
+ Rect _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_FUNC);
+ if (arg1) if ((lparg1 = getRectFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)((Graphics *)arg0)->GetClipBounds(lparg1);
+fail:
+ if (arg1 && lparg1) setRectFields(env, arg1, lparg1);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1GetInterpolationMode
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1GetInterpolationMode)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1GetInterpolationMode_FUNC);
+ rc = (jint)((Graphics *)arg0)->GetInterpolationMode();
+ Gdip_NATIVE_EXIT(env, that, Graphics_1GetInterpolationMode_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1ResetClip
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1ResetClip)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1ResetClip_FUNC);
+ rc = (jint)((Graphics *)arg0)->ResetClip();
+ Gdip_NATIVE_EXIT(env, that, Graphics_1ResetClip_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1SetClip__II
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1SetClip__II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1SetClip__II_FUNC);
+ rc = (jint)((Graphics *)arg0)->SetClip((GraphicsPath *)arg1);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1SetClip__II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1SetClip__III
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1SetClip__III)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1SetClip__III_FUNC);
+ rc = (jint)((Graphics *)arg0)->SetClip((HRGN)arg1, (CombineMode)arg2);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1SetClip__III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1)
+{
+ RectF _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC);
+ if (arg1) if ((lparg1 = getRectFFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)((Graphics *)arg0)->SetClip(*lparg1);
+fail:
+ if (arg1 && lparg1) setRectFFields(env, arg1, lparg1);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1SetInterpolationMode
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1SetInterpolationMode)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1SetInterpolationMode_FUNC);
+ rc = (jint)((Graphics *)arg0)->SetInterpolationMode((InterpolationMode)arg1);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1SetInterpolationMode_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1SetTransform
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1SetTransform)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1SetTransform_FUNC);
+ rc = (jint)((Graphics *)arg0)->SetTransform((Matrix *)arg1);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1SetTransform_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Graphics_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Graphics_1delete_FUNC);
+ delete (Graphics *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Graphics_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Graphics_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1new)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1new_FUNC);
+ rc = (jint)new Graphics((HDC)arg0);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_LinearGradientBrush_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(LinearGradientBrush_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, LinearGradientBrush_1delete_FUNC);
+ delete (LinearGradientBrush *)arg0;
+ Gdip_NATIVE_EXIT(env, that, LinearGradientBrush_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_LinearGradientBrush_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(LinearGradientBrush_1new)
+ (JNIEnv *env, jclass that, jobject arg0, jobject arg1, jint arg2, jint arg3)
+{
+ PointF _arg0, *lparg0=NULL;
+ PointF _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, LinearGradientBrush_1new_FUNC);
+ if (arg0) if ((lparg0 = getPointFFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg1) if ((lparg1 = getPointFFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)new LinearGradientBrush(*lparg0, *lparg1, *(Color *)arg2, *(Color *)arg3);
+fail:
+ if (arg1 && lparg1) setPointFFields(env, arg1, lparg1);
+ if (arg0 && lparg0) setPointFFields(env, arg0, lparg0);
+ Gdip_NATIVE_EXIT(env, that, LinearGradientBrush_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1GetElements
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1GetElements)
+ (JNIEnv *env, jclass that, jint arg0, jfloatArray arg1)
+{
+ jfloat *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1GetElements_FUNC);
+ if (arg1) if ((lparg1 = env->GetFloatArrayElements(arg1, NULL)) == NULL) goto fail;
+ rc = (jint)((Matrix *)arg0)->GetElements((REAL *)lparg1);
+fail:
+ if (arg1 && lparg1) env->ReleaseFloatArrayElements(arg1, lparg1, 0);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1GetElements_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1Invert
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1Invert)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1Invert_FUNC);
+ rc = (jint)((Matrix *)arg0)->Invert();
+ Gdip_NATIVE_EXIT(env, that, Matrix_1Invert_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1IsIdentity
+JNIEXPORT jboolean JNICALL Gdip_NATIVE(Matrix_1IsIdentity)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jboolean rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1IsIdentity_FUNC);
+ rc = (jboolean)((Matrix *)arg0)->IsIdentity();
+ Gdip_NATIVE_EXIT(env, that, Matrix_1IsIdentity_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1Multiply
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1Multiply)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1Multiply_FUNC);
+ rc = (jint)((Matrix *)arg0)->Multiply((Matrix *)arg1, (MatrixOrder)arg2);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1Multiply_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1Rotate
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1Rotate)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jint arg2)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1Rotate_FUNC);
+ rc = (jint)((Matrix *)arg0)->Rotate((REAL)arg1, (MatrixOrder)arg2);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1Rotate_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1Scale
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1Scale)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jint arg3)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1Scale_FUNC);
+ rc = (jint)((Matrix *)arg0)->Scale((REAL)arg1, (REAL)arg2, (MatrixOrder)arg3);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1Scale_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1SetElements
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1SetElements)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5, jfloat arg6)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1SetElements_FUNC);
+ rc = (jint)((Matrix *)arg0)->SetElements((REAL)arg1, (REAL)arg2, (REAL)arg3, (REAL)arg4, (REAL)arg5, (REAL)arg6);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1SetElements_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1Shear
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1Shear)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jint arg3)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1Shear_FUNC);
+ rc = (jint)((Matrix *)arg0)->Shear((REAL)arg1, (REAL)arg2, (MatrixOrder)arg3);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1Shear_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2)
+{
+ PointF _arg1, *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I_FUNC);
+ if (arg1) if ((lparg1 = getPointFFields(env, arg1, &_arg1)) == NULL) goto fail;
+ rc = (jint)((Matrix *)arg0)->TransformPoints(lparg1, arg2);
+fail:
+ if (arg1 && lparg1) setPointFFields(env, arg1, lparg1);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1Translate
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1Translate)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1, jfloat arg2, jint arg3)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1Translate_FUNC);
+ rc = (jint)((Matrix *)arg0)->Translate((REAL)arg1, (REAL)arg2, (MatrixOrder)arg3);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1Translate_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Matrix_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Matrix_1delete_FUNC);
+ delete (Matrix *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Matrix_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Matrix_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1new)
+ (JNIEnv *env, jclass that, jfloat arg0, jfloat arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1new_FUNC);
+ rc = (jint)new Matrix((REAL)arg0, (REAL)arg1, (REAL)arg2, (REAL)arg3, (REAL)arg4, (REAL)arg5);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Pen_1SetDashPattern
+JNIEXPORT jint JNICALL Gdip_NATIVE(Pen_1SetDashPattern)
+ (JNIEnv *env, jclass that, jint arg0, jfloatArray arg1, jint arg2)
+{
+ jfloat *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Pen_1SetDashPattern_FUNC);
+ if (arg1) if ((lparg1 = env->GetFloatArrayElements(arg1, NULL)) == NULL) goto fail;
+ rc = (jint)((Pen *)arg0)->SetDashPattern((REAL *)lparg1, (int)arg2);
+fail:
+ if (arg1 && lparg1) env->ReleaseFloatArrayElements(arg1, lparg1, 0);
+ Gdip_NATIVE_EXIT(env, that, Pen_1SetDashPattern_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Pen_1SetDashStyle
+JNIEXPORT jint JNICALL Gdip_NATIVE(Pen_1SetDashStyle)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Pen_1SetDashStyle_FUNC);
+ rc = (jint)((Pen *)arg0)->SetDashStyle((DashStyle)arg1);
+ Gdip_NATIVE_EXIT(env, that, Pen_1SetDashStyle_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Pen_1SetLineCap
+JNIEXPORT jint JNICALL Gdip_NATIVE(Pen_1SetLineCap)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Pen_1SetLineCap_FUNC);
+ rc = (jint)((Pen *)arg0)->SetLineCap((LineCap)arg1, (LineCap)arg2, (DashCap)arg3);
+ Gdip_NATIVE_EXIT(env, that, Pen_1SetLineCap_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Pen_1SetLineJoin
+JNIEXPORT jint JNICALL Gdip_NATIVE(Pen_1SetLineJoin)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Pen_1SetLineJoin_FUNC);
+ rc = (jint)((Pen *)arg0)->SetLineJoin((LineJoin)arg1);
+ Gdip_NATIVE_EXIT(env, that, Pen_1SetLineJoin_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Pen_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Pen_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Pen_1delete_FUNC);
+ delete (Pen *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Pen_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Pen_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Pen_1new)
+ (JNIEnv *env, jclass that, jint arg0, jfloat arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Pen_1new_FUNC);
+ rc = (jint)new Pen(*(Color *)arg0, (REAL)arg1);
+ Gdip_NATIVE_EXIT(env, that, Pen_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Point_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(Point_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, Point_1delete_FUNC);
+ delete (Point *)arg0;
+ Gdip_NATIVE_EXIT(env, that, Point_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_Point_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(Point_1new)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Point_1new_FUNC);
+ rc = (jint)new Point(arg0, arg1);
+ Gdip_NATIVE_EXIT(env, that, Point_1new_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_SolidBrush_1delete
+JNIEXPORT void JNICALL Gdip_NATIVE(SolidBrush_1delete)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ Gdip_NATIVE_ENTER(env, that, SolidBrush_1delete_FUNC);
+ delete (SolidBrush *)arg0;
+ Gdip_NATIVE_EXIT(env, that, SolidBrush_1delete_FUNC);
+}
+#endif
+
+#ifndef NO_SolidBrush_1new
+JNIEXPORT jint JNICALL Gdip_NATIVE(SolidBrush_1new)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, SolidBrush_1new_FUNC);
+ rc = (jint)new SolidBrush(*(Color *)arg0);
+ Gdip_NATIVE_EXIT(env, that, SolidBrush_1new_FUNC);
+ return rc;
+}
+#endif
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.h
new file mode 100644
index 0000000000..25e8d3d20a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.h
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#ifndef INC_gdip_H
+#define INC_gdip_H
+
+#include <windows.h>
+#include <gdiplus.h>
+using namespace Gdiplus;
+
+/* Optional custom definitions to exclude some types */
+#include "defines.h"
+
+#endif /* INC_gdip_H */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_custom.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_custom.cpp
new file mode 100644
index 0000000000..b86edddc2a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_custom.cpp
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "swt.h"
+#include "gdip_structs.h"
+#include "gdip_stats.h"
+
+extern "C" {
+
+#define Gdip_NATIVE(func) Java_org_eclipse_swt_internal_gdip_Gdip_##func
+
+#ifndef NO_Graphics_1DrawLines
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawLines)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jintArray arg2, jint arg3)
+{
+ Point *points = NULL;
+ jint *lparg2=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawLines_FUNC);
+ if (arg2) if ((lparg2 = env->GetIntArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (lparg2) {
+ points = new Point[arg3];
+ for (int i=0, j=0; i<arg3; i++, j+=2) {
+ Point *point = new Point(lparg2[j], lparg2[j + 1]);
+ points[i] = *point;
+ delete point;
+ }
+ }
+ rc = (jint)((Graphics *)arg0)->DrawLines((Pen *)arg1, points, (INT)arg3);
+fail:
+ if (lparg2 && points) delete points;
+ if (arg2 && lparg2) env->ReleaseIntArrayElements(arg2, lparg2, JNI_ABORT);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawLines_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1DrawPolygon
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1DrawPolygon)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jintArray arg2, jint arg3)
+{
+ Point *points = NULL;
+ jint *lparg2=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1DrawPolygon_FUNC);
+ if (arg2) if ((lparg2 = env->GetIntArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (lparg2) {
+ points = new Point[arg3];
+ for (int i=0, j=0; i<arg3; i++, j+=2) {
+ Point *point = new Point(lparg2[j], lparg2[j + 1]);
+ points[i] = *point;
+ delete point;
+ }
+ }
+ rc = (jint)((Graphics *)arg0)->DrawPolygon((Pen *)arg1, points, (INT)arg3);
+fail:
+ if (lparg2 && points) delete points;
+ if (arg2 && lparg2) env->ReleaseIntArrayElements(arg2, lparg2, JNI_ABORT);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1DrawPolygon_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Graphics_1FillPolygon
+JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1FillPolygon)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jintArray arg2, jint arg3, jint arg4)
+{
+ Point *points = NULL;
+ jint *lparg2=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Graphics_1FillPolygon_FUNC);
+ if (arg2) if ((lparg2 = env->GetIntArrayElements(arg2, NULL)) == NULL) goto fail;
+ if (lparg2) {
+ points = new Point[arg3];
+ for (int i=0, j=0; i<arg3; i++, j+=2) {
+ Point *point = new Point(lparg2[j], lparg2[j + 1]);
+ points[i] = *point;
+ delete point;
+ }
+ }
+ rc = (jint)((Graphics *)arg0)->FillPolygon((Brush *)arg1, points, (INT)arg3, (FillMode)arg4);
+fail:
+ if (lparg2 && points) delete points;
+ if (arg2 && lparg2) env->ReleaseIntArrayElements(arg2, lparg2, JNI_ABORT);
+ Gdip_NATIVE_EXIT(env, that, Graphics_1FillPolygon_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_Matrix_1TransformPoints__I_3FI
+JNIEXPORT jint JNICALL Gdip_NATIVE(Matrix_1TransformPoints__I_3FI)
+ (JNIEnv *env, jclass that, jint arg0, jfloatArray arg1, jint arg2)
+{
+ PointF *points = NULL;
+ jfloat *lparg1=NULL;
+ jint rc = 0;
+ Gdip_NATIVE_ENTER(env, that, Matrix_1TransformPoints__I_3FI_FUNC);
+ if (arg1) if ((lparg1 = env->GetFloatArrayElements(arg1, NULL)) == NULL) goto fail;
+ if (lparg1) {
+ points = new PointF[arg2];
+ for (int i=0, j=0; i<arg2; i++, j+=2) {
+ PointF *point = new PointF(lparg1[j], lparg1[j + 1]);
+ points[i] = *point;
+ delete point;
+ }
+ }
+ rc = (jint)((Matrix *)arg0)->TransformPoints(points, arg2);
+fail:
+ if (lparg1 && points) {
+ for (int i=0, j=0; i<arg2; i++, j+=2) {
+ lparg1[j] = points[i].X;
+ lparg1[j + 1] = points[i].Y;
+ }
+ delete points;
+ }
+ if (arg1 && lparg1) env->ReleaseFloatArrayElements(arg1, lparg1, 0);
+ Gdip_NATIVE_EXIT(env, that, Matrix_1TransformPoints__I_3FI_FUNC);
+ return rc;
+}
+#endif
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp
new file mode 100644
index 0000000000..3dfadaa5fc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp
@@ -0,0 +1,117 @@
+/*******************************************************************************
+* Copyright (c) 2000, 2004 IBM Corporation and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Common Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/cpl-v10.html
+*
+* Contributors:
+* IBM Corporation - initial API and implementation
+*******************************************************************************/
+
+#include "swt.h"
+#include "gdip_stats.h"
+
+#ifdef NATIVE_STATS
+
+int Gdip_nativeFunctionCount = 75;
+int Gdip_nativeFunctionCallCount[75];
+char * Gdip_nativeFunctionNames[] = {
+ "Bitmap_1delete",
+ "Bitmap_1new",
+ "Color_1delete",
+ "Color_1new",
+ "FontFamily_1delete",
+ "FontFamily_1new",
+ "Font_1GetFamily",
+ "Font_1GetSize",
+ "Font_1GetStyle",
+ "Font_1delete",
+ "Font_1new",
+ "GdiplusShutdown",
+ "GdiplusStartup",
+ "GraphicsPath_1AddArc",
+ "GraphicsPath_1AddBezier",
+ "GraphicsPath_1AddLine",
+ "GraphicsPath_1AddPath",
+ "GraphicsPath_1AddRectangle",
+ "GraphicsPath_1AddString",
+ "GraphicsPath_1CloseFigure",
+ "GraphicsPath_1GetLastPoint",
+ "GraphicsPath_1delete",
+ "GraphicsPath_1new",
+ "Graphics_1DrawArc",
+ "Graphics_1DrawEllipse",
+ "Graphics_1DrawImage__IIII",
+ "Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII",
+ "Graphics_1DrawLine",
+ "Graphics_1DrawLines",
+ "Graphics_1DrawPath",
+ "Graphics_1DrawPolygon",
+ "Graphics_1DrawRectangle",
+ "Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I",
+ "Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II",
+ "Graphics_1FillEllipse",
+ "Graphics_1FillPath",
+ "Graphics_1FillPie",
+ "Graphics_1FillPolygon",
+ "Graphics_1FillRectangle",
+ "Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2",
+ "Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2",
+ "Graphics_1GetInterpolationMode",
+ "Graphics_1ResetClip",
+ "Graphics_1SetClip__II",
+ "Graphics_1SetClip__III",
+ "Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2",
+ "Graphics_1SetInterpolationMode",
+ "Graphics_1SetTransform",
+ "Graphics_1delete",
+ "Graphics_1new",
+ "LinearGradientBrush_1delete",
+ "LinearGradientBrush_1new",
+ "Matrix_1GetElements",
+ "Matrix_1Invert",
+ "Matrix_1IsIdentity",
+ "Matrix_1Multiply",
+ "Matrix_1Rotate",
+ "Matrix_1Scale",
+ "Matrix_1SetElements",
+ "Matrix_1Shear",
+ "Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I",
+ "Matrix_1TransformPoints__I_3FI",
+ "Matrix_1Translate",
+ "Matrix_1delete",
+ "Matrix_1new",
+ "Pen_1SetDashPattern",
+ "Pen_1SetDashStyle",
+ "Pen_1SetLineCap",
+ "Pen_1SetLineJoin",
+ "Pen_1delete",
+ "Pen_1new",
+ "Point_1delete",
+ "Point_1new",
+ "SolidBrush_1delete",
+ "SolidBrush_1new",
+};
+
+#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
+
+JNIEXPORT jint JNICALL STATS_NATIVE(Gdip_1GetFunctionCount)
+ (JNIEnv *env, jclass that)
+{
+ return Gdip_nativeFunctionCount;
+}
+
+JNIEXPORT jstring JNICALL STATS_NATIVE(Gdip_1GetFunctionName)
+ (JNIEnv *env, jclass that, jint index)
+{
+ return env->NewStringUTF(Gdip_nativeFunctionNames[index]);
+}
+
+JNIEXPORT jint JNICALL STATS_NATIVE(Gdip_1GetFunctionCallCount)
+ (JNIEnv *env, jclass that, jint index)
+{
+ return Gdip_nativeFunctionCallCount[index];
+}
+
+#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h
new file mode 100644
index 0000000000..889dfd3321
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h
@@ -0,0 +1,99 @@
+/*******************************************************************************
+* Copyright (c) 2000, 2004 IBM Corporation and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Common Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/cpl-v10.html
+*
+* Contributors:
+* IBM Corporation - initial API and implementation
+*******************************************************************************/
+
+#ifdef NATIVE_STATS
+extern int Gdip_nativeFunctionCount;
+extern int Gdip_nativeFunctionCallCount[];
+extern char* Gdip_nativeFunctionNames[];
+#define Gdip_NATIVE_ENTER(env, that, func) Gdip_nativeFunctionCallCount[func]++;
+#define Gdip_NATIVE_EXIT(env, that, func)
+#else
+#define Gdip_NATIVE_ENTER(env, that, func)
+#define Gdip_NATIVE_EXIT(env, that, func)
+#endif
+
+typedef enum {
+ Bitmap_1delete_FUNC,
+ Bitmap_1new_FUNC,
+ Color_1delete_FUNC,
+ Color_1new_FUNC,
+ FontFamily_1delete_FUNC,
+ FontFamily_1new_FUNC,
+ Font_1GetFamily_FUNC,
+ Font_1GetSize_FUNC,
+ Font_1GetStyle_FUNC,
+ Font_1delete_FUNC,
+ Font_1new_FUNC,
+ GdiplusShutdown_FUNC,
+ GdiplusStartup_FUNC,
+ GraphicsPath_1AddArc_FUNC,
+ GraphicsPath_1AddBezier_FUNC,
+ GraphicsPath_1AddLine_FUNC,
+ GraphicsPath_1AddPath_FUNC,
+ GraphicsPath_1AddRectangle_FUNC,
+ GraphicsPath_1AddString_FUNC,
+ GraphicsPath_1CloseFigure_FUNC,
+ GraphicsPath_1GetLastPoint_FUNC,
+ GraphicsPath_1delete_FUNC,
+ GraphicsPath_1new_FUNC,
+ Graphics_1DrawArc_FUNC,
+ Graphics_1DrawEllipse_FUNC,
+ Graphics_1DrawImage__IIII_FUNC,
+ Graphics_1DrawImage__IILorg_eclipse_swt_internal_gdip_Rect_2IIIIIIII_FUNC,
+ Graphics_1DrawLine_FUNC,
+ Graphics_1DrawLines_FUNC,
+ Graphics_1DrawPath_FUNC,
+ Graphics_1DrawPolygon_FUNC,
+ Graphics_1DrawRectangle_FUNC,
+ Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2I_FUNC,
+ Graphics_1DrawString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2II_FUNC,
+ Graphics_1FillEllipse_FUNC,
+ Graphics_1FillPath_FUNC,
+ Graphics_1FillPie_FUNC,
+ Graphics_1FillPolygon_FUNC,
+ Graphics_1FillRectangle_FUNC,
+ Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC,
+ Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_FUNC,
+ Graphics_1GetInterpolationMode_FUNC,
+ Graphics_1ResetClip_FUNC,
+ Graphics_1SetClip__II_FUNC,
+ Graphics_1SetClip__III_FUNC,
+ Graphics_1SetClip__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC,
+ Graphics_1SetInterpolationMode_FUNC,
+ Graphics_1SetTransform_FUNC,
+ Graphics_1delete_FUNC,
+ Graphics_1new_FUNC,
+ LinearGradientBrush_1delete_FUNC,
+ LinearGradientBrush_1new_FUNC,
+ Matrix_1GetElements_FUNC,
+ Matrix_1Invert_FUNC,
+ Matrix_1IsIdentity_FUNC,
+ Matrix_1Multiply_FUNC,
+ Matrix_1Rotate_FUNC,
+ Matrix_1Scale_FUNC,
+ Matrix_1SetElements_FUNC,
+ Matrix_1Shear_FUNC,
+ Matrix_1TransformPoints__ILorg_eclipse_swt_internal_gdip_PointF_2I_FUNC,
+ Matrix_1TransformPoints__I_3FI_FUNC,
+ Matrix_1Translate_FUNC,
+ Matrix_1delete_FUNC,
+ Matrix_1new_FUNC,
+ Pen_1SetDashPattern_FUNC,
+ Pen_1SetDashStyle_FUNC,
+ Pen_1SetLineCap_FUNC,
+ Pen_1SetLineJoin_FUNC,
+ Pen_1delete_FUNC,
+ Pen_1new_FUNC,
+ Point_1delete_FUNC,
+ Point_1new_FUNC,
+ SolidBrush_1delete_FUNC,
+ SolidBrush_1new_FUNC,
+} Gdip_FUNCS;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.cpp
new file mode 100644
index 0000000000..6c6bc0f1b8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.cpp
@@ -0,0 +1,168 @@
+/*******************************************************************************
+* Copyright (c) 2000, 2004 IBM Corporation and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Common Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/cpl-v10.html
+*
+* Contributors:
+* IBM Corporation - initial API and implementation
+*******************************************************************************/
+
+#include "swt.h"
+#include "gdip_structs.h"
+
+#ifndef NO_GdiplusStartupInput
+typedef struct GdiplusStartupInput_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID GdiplusVersion, DebugEventCallback, SuppressBackgroundThread, SuppressExternalCodecs;
+} GdiplusStartupInput_FID_CACHE;
+
+GdiplusStartupInput_FID_CACHE GdiplusStartupInputFc;
+
+void cacheGdiplusStartupInputFields(JNIEnv *env, jobject lpObject)
+{
+ if (GdiplusStartupInputFc.cached) return;
+ GdiplusStartupInputFc.clazz = env->GetObjectClass(lpObject);
+ GdiplusStartupInputFc.GdiplusVersion = env->GetFieldID(GdiplusStartupInputFc.clazz, "GdiplusVersion", "I");
+ GdiplusStartupInputFc.DebugEventCallback = env->GetFieldID(GdiplusStartupInputFc.clazz, "DebugEventCallback", "I");
+ GdiplusStartupInputFc.SuppressBackgroundThread = env->GetFieldID(GdiplusStartupInputFc.clazz, "SuppressBackgroundThread", "I");
+ GdiplusStartupInputFc.SuppressExternalCodecs = env->GetFieldID(GdiplusStartupInputFc.clazz, "SuppressExternalCodecs", "I");
+ GdiplusStartupInputFc.cached = 1;
+}
+
+GdiplusStartupInput *getGdiplusStartupInputFields(JNIEnv *env, jobject lpObject, GdiplusStartupInput *lpStruct)
+{
+ if (!GdiplusStartupInputFc.cached) cacheGdiplusStartupInputFields(env, lpObject);
+ lpStruct->GdiplusVersion = env->GetIntField(lpObject, GdiplusStartupInputFc.GdiplusVersion);
+ lpStruct->DebugEventCallback = (DebugEventProc)env->GetIntField(lpObject, GdiplusStartupInputFc.DebugEventCallback);
+ lpStruct->SuppressBackgroundThread = (BOOL)env->GetIntField(lpObject, GdiplusStartupInputFc.SuppressBackgroundThread);
+ lpStruct->SuppressExternalCodecs = (BOOL)env->GetIntField(lpObject, GdiplusStartupInputFc.SuppressExternalCodecs);
+ return lpStruct;
+}
+
+void setGdiplusStartupInputFields(JNIEnv *env, jobject lpObject, GdiplusStartupInput *lpStruct)
+{
+ if (!GdiplusStartupInputFc.cached) cacheGdiplusStartupInputFields(env, lpObject);
+ env->SetIntField(lpObject, GdiplusStartupInputFc.GdiplusVersion, (jint)lpStruct->GdiplusVersion);
+ env->SetIntField(lpObject, GdiplusStartupInputFc.DebugEventCallback, (jint)lpStruct->DebugEventCallback);
+ env->SetIntField(lpObject, GdiplusStartupInputFc.SuppressBackgroundThread, (jint)lpStruct->SuppressBackgroundThread);
+ env->SetIntField(lpObject, GdiplusStartupInputFc.SuppressExternalCodecs, (jint)lpStruct->SuppressExternalCodecs);
+}
+#endif
+
+#ifndef NO_PointF
+typedef struct PointF_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID X, Y;
+} PointF_FID_CACHE;
+
+PointF_FID_CACHE PointFFc;
+
+void cachePointFFields(JNIEnv *env, jobject lpObject)
+{
+ if (PointFFc.cached) return;
+ PointFFc.clazz = env->GetObjectClass(lpObject);
+ PointFFc.X = env->GetFieldID(PointFFc.clazz, "X", "F");
+ PointFFc.Y = env->GetFieldID(PointFFc.clazz, "Y", "F");
+ PointFFc.cached = 1;
+}
+
+PointF *getPointFFields(JNIEnv *env, jobject lpObject, PointF *lpStruct)
+{
+ if (!PointFFc.cached) cachePointFFields(env, lpObject);
+ lpStruct->X = (REAL)env->GetFloatField(lpObject, PointFFc.X);
+ lpStruct->Y = (REAL)env->GetFloatField(lpObject, PointFFc.Y);
+ return lpStruct;
+}
+
+void setPointFFields(JNIEnv *env, jobject lpObject, PointF *lpStruct)
+{
+ if (!PointFFc.cached) cachePointFFields(env, lpObject);
+ env->SetFloatField(lpObject, PointFFc.X, (jfloat)lpStruct->X);
+ env->SetFloatField(lpObject, PointFFc.Y, (jfloat)lpStruct->Y);
+}
+#endif
+
+#ifndef NO_Rect
+typedef struct Rect_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID X, Y, Width, Height;
+} Rect_FID_CACHE;
+
+Rect_FID_CACHE RectFc;
+
+void cacheRectFields(JNIEnv *env, jobject lpObject)
+{
+ if (RectFc.cached) return;
+ RectFc.clazz = env->GetObjectClass(lpObject);
+ RectFc.X = env->GetFieldID(RectFc.clazz, "X", "I");
+ RectFc.Y = env->GetFieldID(RectFc.clazz, "Y", "I");
+ RectFc.Width = env->GetFieldID(RectFc.clazz, "Width", "I");
+ RectFc.Height = env->GetFieldID(RectFc.clazz, "Height", "I");
+ RectFc.cached = 1;
+}
+
+Rect *getRectFields(JNIEnv *env, jobject lpObject, Rect *lpStruct)
+{
+ if (!RectFc.cached) cacheRectFields(env, lpObject);
+ lpStruct->X = env->GetIntField(lpObject, RectFc.X);
+ lpStruct->Y = env->GetIntField(lpObject, RectFc.Y);
+ lpStruct->Width = env->GetIntField(lpObject, RectFc.Width);
+ lpStruct->Height = env->GetIntField(lpObject, RectFc.Height);
+ return lpStruct;
+}
+
+void setRectFields(JNIEnv *env, jobject lpObject, Rect *lpStruct)
+{
+ if (!RectFc.cached) cacheRectFields(env, lpObject);
+ env->SetIntField(lpObject, RectFc.X, (jint)lpStruct->X);
+ env->SetIntField(lpObject, RectFc.Y, (jint)lpStruct->Y);
+ env->SetIntField(lpObject, RectFc.Width, (jint)lpStruct->Width);
+ env->SetIntField(lpObject, RectFc.Height, (jint)lpStruct->Height);
+}
+#endif
+
+#ifndef NO_RectF
+typedef struct RectF_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID X, Y, Width, Height;
+} RectF_FID_CACHE;
+
+RectF_FID_CACHE RectFFc;
+
+void cacheRectFFields(JNIEnv *env, jobject lpObject)
+{
+ if (RectFFc.cached) return;
+ RectFFc.clazz = env->GetObjectClass(lpObject);
+ RectFFc.X = env->GetFieldID(RectFFc.clazz, "X", "F");
+ RectFFc.Y = env->GetFieldID(RectFFc.clazz, "Y", "F");
+ RectFFc.Width = env->GetFieldID(RectFFc.clazz, "Width", "F");
+ RectFFc.Height = env->GetFieldID(RectFFc.clazz, "Height", "F");
+ RectFFc.cached = 1;
+}
+
+RectF *getRectFFields(JNIEnv *env, jobject lpObject, RectF *lpStruct)
+{
+ if (!RectFFc.cached) cacheRectFFields(env, lpObject);
+ lpStruct->X = env->GetFloatField(lpObject, RectFFc.X);
+ lpStruct->Y = env->GetFloatField(lpObject, RectFFc.Y);
+ lpStruct->Width = env->GetFloatField(lpObject, RectFFc.Width);
+ lpStruct->Height = env->GetFloatField(lpObject, RectFFc.Height);
+ return lpStruct;
+}
+
+void setRectFFields(JNIEnv *env, jobject lpObject, RectF *lpStruct)
+{
+ if (!RectFFc.cached) cacheRectFFields(env, lpObject);
+ env->SetFloatField(lpObject, RectFFc.X, (jfloat)lpStruct->X);
+ env->SetFloatField(lpObject, RectFFc.Y, (jfloat)lpStruct->Y);
+ env->SetFloatField(lpObject, RectFFc.Width, (jfloat)lpStruct->Width);
+ env->SetFloatField(lpObject, RectFFc.Height, (jfloat)lpStruct->Height);
+}
+#endif
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.h
new file mode 100644
index 0000000000..e7bfb8017e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_structs.h
@@ -0,0 +1,61 @@
+/*******************************************************************************
+* Copyright (c) 2000, 2004 IBM Corporation and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Common Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/cpl-v10.html
+*
+* Contributors:
+* IBM Corporation - initial API and implementation
+*******************************************************************************/
+
+#include "gdip.h"
+
+#ifndef NO_GdiplusStartupInput
+void cacheGdiplusStartupInputFields(JNIEnv *env, jobject lpObject);
+GdiplusStartupInput *getGdiplusStartupInputFields(JNIEnv *env, jobject lpObject, GdiplusStartupInput *lpStruct);
+void setGdiplusStartupInputFields(JNIEnv *env, jobject lpObject, GdiplusStartupInput *lpStruct);
+#define GdiplusStartupInput_sizeof() sizeof(GdiplusStartupInput)
+#else
+#define cacheGdiplusStartupInputFields(a,b)
+#define getGdiplusStartupInputFields(a,b,c) NULL
+#define setGdiplusStartupInputFields(a,b,c)
+#define GdiplusStartupInput_sizeof() 0
+#endif
+
+#ifndef NO_PointF
+void cachePointFFields(JNIEnv *env, jobject lpObject);
+PointF *getPointFFields(JNIEnv *env, jobject lpObject, PointF *lpStruct);
+void setPointFFields(JNIEnv *env, jobject lpObject, PointF *lpStruct);
+#define PointF_sizeof() sizeof(PointF)
+#else
+#define cachePointFFields(a,b)
+#define getPointFFields(a,b,c) NULL
+#define setPointFFields(a,b,c)
+#define PointF_sizeof() 0
+#endif
+
+#ifndef NO_Rect
+void cacheRectFields(JNIEnv *env, jobject lpObject);
+Rect *getRectFields(JNIEnv *env, jobject lpObject, Rect *lpStruct);
+void setRectFields(JNIEnv *env, jobject lpObject, Rect *lpStruct);
+#define Rect_sizeof() sizeof(Rect)
+#else
+#define cacheRectFields(a,b)
+#define getRectFields(a,b,c) NULL
+#define setRectFields(a,b,c)
+#define Rect_sizeof() 0
+#endif
+
+#ifndef NO_RectF
+void cacheRectFFields(JNIEnv *env, jobject lpObject);
+RectF *getRectFFields(JNIEnv *env, jobject lpObject, RectF *lpStruct);
+void setRectFFields(JNIEnv *env, jobject lpObject, RectF *lpStruct);
+#define RectF_sizeof() sizeof(RectF)
+#else
+#define cacheRectFFields(a,b)
+#define getRectFFields(a,b,c) NULL
+#define setRectFFields(a,b,c)
+#define RectF_sizeof() 0
+#endif
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
index e20926197a..da63fdb606 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
@@ -28,6 +28,11 @@ SWT_LIB = $(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll
SWT_LIBS = ole32.lib comctl32.lib user32.lib gdi32.lib comdlg32.lib kernel32.lib shell32.lib oleaut32.lib advapi32.lib imm32.lib winspool.lib oleacc.lib usp10.lib
SWT_OBJS = swt.obj os.obj os_structs.obj os_custom.obj os_stats.obj callback.obj com_structs.obj com.obj com_stats.obj
+GDIP_PREFIX = swt-gdip
+GDIP_LIB = $(GDIP_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll
+GDIP_LIBS = gdi32.lib gdiplus.lib
+GDIP_OBJS = gdip.obj gdip_structs.obj gdip_stats.obj gdip_custom.obj
+
AWT_PREFIX = swt-awt
AWT_LIB = $(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll
AWT_LIBS = $(JAVA_HOME)\jre\bin\jawt.lib
@@ -46,11 +51,14 @@ CFLAGS = -c -W3 -G6 -GD -O1 $(SWT_CDEBUG) -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_
RCFLAGS = -DSWT_FILE_VERSION=\"$(maj_ver).$(min_ver)\" -DSWT_COMMA_VERSION=$(comma_ver)
LFLAGS = /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO $(SWT_LDEBUG) -entry:_DllMainCRTStartup@12 -dll /BASE:0x10000000 /comment:$(pgm_ver_str) /comment:$(copyright) /DLL
-all: $(SWT_LIB) $(AWT_LIB)
+all: $(SWT_LIB) $(AWT_LIB) $(GDIP_LIB)
.c.obj:
cl $(CFLAGS) $*.c
+.cpp.obj:
+ cl $(CFLAGS) $*.cpp
+
$(SWT_LIB): $(SWT_OBJS) swt.res
echo $(LFLAGS) >templrf
echo $(SWT_LIBS) >>templrf
@@ -62,6 +70,17 @@ $(SWT_LIB): $(SWT_OBJS) swt.res
link @templrf
del templrf
+$(GDIP_LIB): $(GDIP_OBJS) swt_gdip.res
+ echo $(LFLAGS) >templrf
+ echo $(GDIP_LIBS) >>templrf
+ echo -machine:IX86 >>templrf
+ echo -subsystem:windows >>templrf
+ echo -out:$(GDIP_LIB) >>templrf
+ echo $(GDIP_OBJS) >>templrf
+ echo swt_gdip.res >>templrf
+ link @templrf
+ del templrf
+
$(AWT_LIB): $(AWT_OBJS) swt_awt.res
echo $(LFLAGS) >templrf
echo $(AWT_LIBS) >>templrf
@@ -76,6 +95,9 @@ $(AWT_LIB): $(AWT_OBJS) swt_awt.res
swt.res:
rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(SWT_LIB)\" -r -fo swt.res swt.rc
+swt_gdip.res:
+ rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(GDIP_LIB)\" -r -fo swt_gdip.res swt_gdip.rc
+
swt_awt.res:
rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(AWT_LIB)\" -r -fo swt_awt.res swt_awt.rc
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_gdip.rc b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_gdip.rc
new file mode 100644
index 0000000000..1a564ca881
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_gdip.rc
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "windows.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION SWT_COMMA_VERSION
+ PRODUCTVERSION 0,0,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40000L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Eclipse Foundation\0"
+ VALUE "FileDescription", "SWT for Windows native library\0"
+ VALUE "FileVersion", SWT_FILE_VERSION
+ VALUE "InternalName", "SWT\0"
+ VALUE "LegalCopyright", "(c) Copyright 2000, 2004 IBM Corp. All Rights Reserved.\0"
+ VALUE "OriginalFilename", SWT_ORG_FILENAME
+ VALUE "ProductName", "Standard Widget Toolkit\0"
+ VALUE "ProductVersion", "0,0,0,0\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java
new file mode 100644
index 0000000000..e8940d1962
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.gdip;
+
+import org.eclipse.swt.internal.*;
+
+public class Gdip extends Platform {
+ static {
+ Library.loadLibrary ("swt-gdip"); //$NON-NLS-1$
+ }
+
+ /** GdiPlus constants */
+ public static final int CombineModeReplace = 0;
+ public static final int CombineModeIntersect = 1;
+ public static final int CombineModeUnion = 2;
+ public static final int CombineModeXor = 3;
+ public static final int CombineModeExclude = 4;
+ public static final int CombineModeComplement = 5;
+ public static final int FillModeAlternate = 0;
+ public static final int FillModeWinding = 0;
+ public static final int DashCapFlat = 0;
+ public static final int DashCapRound = 2;
+ public static final int DashCapTriangle = 3;
+ public static final int DashStyleSolid = 0;
+ public static final int DashStyleDash = 1;
+ public static final int DashStyleDot = 2;
+ public static final int DashStyleDashDot = 3;
+ public static final int DashStyleDashDotDot = 4;
+ public static final int DashStyleCustom = 5;
+ public static final int LineJoinMiter = 0;
+ public static final int LineJoinBevel = 1;
+ public static final int LineJoinRound = 2;
+ public static final int LineCapFlat = 0;
+ public static final int LineCapSquare = 1;
+ public static final int LineCapRound = 2;
+ public static final int MatrixOrderPrepend = 0;
+ public static final int MatrixOrderAppend = 1;
+ public static final int UnitPixel = 2;
+
+
+/** GdiPlus natives */
+public static final native int GdiplusStartup(int[] token, GdiplusStartupInput input, int output);
+public static final native void GdiplusShutdown(int[] token);
+public static final native int Bitmap_new(int hbm, int hpal);
+public static final native void Bitmap_delete(int bitmap);
+public static final native int Graphics_new(int hdc);
+public static final native void Graphics_delete(int graphics);
+public static final native int Graphics_DrawArc(int graphics, int pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
+public static final native int Graphics_DrawEllipse(int graphics, int pen, int x, int y, int width, int height);
+public static final native int Graphics_DrawImage(int graphics, int image, int x, int y);
+public static final native int Graphics_DrawImage(int graphics, int image, Rect destRect, int srcx, int srcy, int srcwidth, int srcheight, int srcUnit, int imageAttributes, int callback, int callbackData);
+public static final native int Graphics_DrawLine(int graphics, int pen, int x1, int y1, int x2, int y2);
+public static final native int Graphics_DrawLines(int graphics, int pen, int[] points, int count);
+public static final native int Graphics_DrawPath(int graphics, int pen, int path);
+public static final native int Graphics_DrawPolygon(int graphics, int pen, int[] points, int count);
+public static final native int Graphics_DrawRectangle(int graphics, int pen, int x, int y, int width, int height);
+public static final native int Graphics_DrawString(int graphics, char[] string, int length, int font, PointF origin, int brush);
+public static final native int Graphics_DrawString(int graphics, char[] string, int length, int font, PointF origin, int format, int brush);
+public static final native int Graphics_FillEllipse(int graphics, int brush, int x, int y, int width, int height);
+public static final native int Graphics_FillPath(int graphics, int brush, int path);
+public static final native int Graphics_FillPie(int graphics, int brush, int x, int y, int width, int height, float startAngle, float sweepAngle);
+public static final native int Graphics_FillPolygon(int graphics, int brush, int[] points, int count, int fillMode);
+public static final native int Graphics_FillRectangle(int graphics, int brush, int x, int y, int width, int height);
+public static final native int Graphics_GetClipBounds(int graphics, RectF rect);
+public static final native int Graphics_GetClipBounds(int graphics, Rect rect);
+public static final native int Graphics_GetInterpolationMode(int graphics);
+public static final native int Graphics_ResetClip(int graphics);
+public static final native int Graphics_SetClip(int graphics, int hrgn, int combineMode);
+public static final native int Graphics_SetClip(int graphics, int path);
+public static final native int Graphics_SetClip(int graphics, RectF rect);
+public static final native int Graphics_SetTransform(int graphics, int matrix);
+public static final native int Graphics_SetInterpolationMode(int graphics, int mode);
+public static final native int Color_new(int argb);
+public static final native void Color_delete(int color);
+public static final native int Font_new(int hdc, int hfont);
+public static final native void Font_delete(int font);
+public static final native int Font_GetFamily(int font, int family);
+public static final native float Font_GetSize(int font);
+public static final native int Font_GetStyle(int font);
+public static final native int FontFamily_new();
+public static final native void FontFamily_delete(int family);
+public static final native int LinearGradientBrush_new(PointF point1, PointF point2, int color1, int color2);
+public static final native void LinearGradientBrush_delete(int brush);
+public static final native int SolidBrush_new(int color);
+public static final native void SolidBrush_delete(int pen);
+public static final native int Pen_new(int color, float width);
+public static final native void Pen_delete(int pen);
+public static final native int Pen_SetDashPattern(int pen, float[] dashArray, int count);
+public static final native int Pen_SetDashStyle(int pen, int dashStyle);
+public static final native int Pen_SetLineCap(int pen, int startCap, int endCap, int dashCap);
+public static final native int Pen_SetLineJoin(int pen, int lineJoin);
+public static final native int Point_new(int x, int y);
+public static final native void Point_delete(int point);
+public static final native int GraphicsPath_new(int brushMode);
+public static final native void GraphicsPath_delete(int path);
+public static final native int GraphicsPath_AddArc(int path, float x, float y, float width, float height, float startAngle, float sweepAngle);
+public static final native int GraphicsPath_AddBezier(int path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
+public static final native int GraphicsPath_AddLine(int path, float x1, float y1, float x2, float y2);
+public static final native int GraphicsPath_AddPath(int path, int addingPath, boolean connect);
+public static final native int GraphicsPath_AddRectangle(int path, RectF rect);
+public static final native int GraphicsPath_AddString(int path, char[] string, int length, int family, int style, float emSize, PointF origin, int format);
+public static final native int GraphicsPath_CloseFigure(int path);
+public static final native int GraphicsPath_GetLastPoint(int path, PointF lastPoint);
+public static final native int Matrix_new(float m11, float m12, float m21, float m22, float dx, float dy);
+public static final native void Matrix_delete(int matrix);
+public static final native int Matrix_GetElements(int matrix, float[] m);
+public static final native int Matrix_Invert(int matrix);
+public static final native boolean Matrix_IsIdentity(int metrix);
+public static final native int Matrix_Multiply(int matrix, int matrix1, int order);
+public static final native int Matrix_Rotate(int matrix, float angle, int order);
+public static final native int Matrix_Scale(int matrix, float scaleX, float scaleY, int order);
+public static final native int Matrix_Shear(int matrix, float shearX, float shearY, int order);
+public static final native int Matrix_TransformPoints(int matrix, PointF pts, int count);
+public static final native int Matrix_TransformPoints(int matrix, float[] pts, int count);
+public static final native int Matrix_Translate(int matrix, float offsetX, float offsetY, int order);
+public static final native int Matrix_SetElements(int matrix, float m11, float m12, float m21, float m22, float dx, float dy);
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/GdiplusStartupInput.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/GdiplusStartupInput.java
new file mode 100644
index 0000000000..e4823f9e8b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/GdiplusStartupInput.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.gdip;
+
+public class GdiplusStartupInput {
+ public int GdiplusVersion;
+ public int DebugEventCallback;
+ public int SuppressBackgroundThread;
+ public int SuppressExternalCodecs;
+ public static final int sizeof = 16;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/PointF.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/PointF.java
new file mode 100644
index 0000000000..e5becd95cb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/PointF.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.gdip;
+
+public class PointF {
+ public float X;
+ public float Y;
+ public static final int sizeof = 8;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Rect.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Rect.java
new file mode 100644
index 0000000000..90bb5d60b1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Rect.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.gdip;
+
+public class Rect {
+ public int X;
+ public int Y;
+ public int Width;
+ public int Height;
+ public static final int sizeof = 16;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/RectF.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/RectF.java
new file mode 100644
index 0000000000..fbbd05dd7c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/RectF.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.gdip;
+
+public class RectF {
+ public float X;
+ public float Y;
+ public float Width;
+ public float Height;
+ public static final int sizeof = 16;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java
index 075e8b6807..36f1ca1535 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Device.java
@@ -12,6 +12,7 @@ package org.eclipse.swt.graphics;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.gdip.*;
import org.eclipse.swt.internal.win32.*;
import org.eclipse.swt.*;
@@ -53,6 +54,9 @@ public abstract class Device implements Drawable {
/* Scripts */
int [] scripts;
+ /* Advanced Graphics */
+ int [] gdipToken;
+
boolean disposed;
/*
@@ -136,6 +140,20 @@ protected void checkDevice () {
if (disposed) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
}
+void checkGDIP() {
+ if (gdipToken != null) return;
+ try {
+ int [] token = new int [1];
+ GdiplusStartupInput input = new GdiplusStartupInput ();
+ input.GdiplusVersion = 1;
+ if (Gdip.GdiplusStartup (token, input, 0) == 0) {
+ gdipToken = token;
+ }
+ } catch (Throwable t) {
+ SWT.error (SWT.ERROR_NO_GRAPHICS_LIBRARY, t);
+ }
+}
+
/**
* Creates the device in the operating system. If the device
* does not have a handle, this method may do nothing depending
@@ -724,6 +742,10 @@ void new_Object (Object object) {
* @see #destroy
*/
protected void release () {
+ if (gdipToken != null) {
+ Gdip.GdiplusShutdown (gdipToken);
+ }
+ gdipToken = null;
scripts = null;
if (hPalette != 0) OS.DeleteObject (hPalette);
hPalette = 0;
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 1cab561180..6bfb213319 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
@@ -12,6 +12,7 @@ package org.eclipse.swt.graphics;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.gdip.*;
import org.eclipse.swt.internal.win32.*;
import org.eclipse.swt.*;
@@ -280,6 +281,82 @@ int createDIB(int width, int height) {
return hDib;
}
+int createGdipBrush() {
+ int colorRef = OS.GetBkColor (handle);
+ int rgb = ((colorRef >> 16) & 0xFF) | (colorRef & 0xFF00) | ((colorRef & 0xFF) << 16);
+ int color = Gdip.Color_new(data.alpha << 24 | rgb);
+ if (color == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ int brush = Gdip.SolidBrush_new(color);
+ if (brush == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ Gdip.Color_delete(color);
+ return brush;
+}
+
+int createGdipPen() {
+ int style, colorRef, width, size, hPen = OS.GetCurrentObject(handle, OS.OBJ_PEN);
+ if ((size = OS.GetObject(hPen, 0, (LOGPEN)null)) == LOGPEN.sizeof) {
+ LOGPEN logPen = new LOGPEN();
+ OS.GetObject(hPen, LOGPEN.sizeof, logPen);
+ colorRef = logPen.lopnColor;
+ width = logPen.x;
+ style = logPen.lopnStyle;
+ } else {
+ EXTLOGPEN logPen = new EXTLOGPEN();
+ if (size <= EXTLOGPEN.sizeof) {
+ OS.GetObject(hPen, size, logPen);
+ } else {
+ int hHeap = OS.GetProcessHeap();
+ int ptr = OS.HeapAlloc(hHeap, OS.HEAP_ZERO_MEMORY, size);
+ OS.GetObject(hPen, size, ptr);
+ OS.MoveMemory(logPen, ptr, EXTLOGPEN.sizeof);
+ OS.HeapFree(hHeap, 0, ptr);
+ }
+ colorRef = logPen.elpColor;
+ width = logPen.elpWidth;
+ style = logPen.elpPenStyle;
+ }
+ int rgb = ((colorRef >> 16) & 0xFF) | (colorRef & 0xFF00) | ((colorRef & 0xFF) << 16);
+ int color = Gdip.Color_new(data.alpha << 24 | rgb);
+ int pen = Gdip.Pen_new(color, width);
+ Gdip.Color_delete(color);
+ int dashStyle = 0;
+ switch (style & OS.PS_STYLE_MASK) {
+ case OS.PS_SOLID: dashStyle = Gdip.DashStyleSolid; break;
+ case OS.PS_DOT: dashStyle = Gdip.DashStyleDot; break;
+ case OS.PS_DASH: dashStyle = Gdip.DashStyleDash; break;
+ case OS.PS_DASHDOT: dashStyle = Gdip.DashStyleDashDot; break;
+ case OS.PS_DASHDOTDOT: dashStyle = Gdip.DashStyleDashDotDot; break;
+ case OS.PS_USERSTYLE: {
+ if (data.dashes != null) {
+ float[] pattern = new float[data.dashes.length];
+ for (int i = 0; i < pattern.length; i++) {
+ pattern[i] = (float)data.dashes[i] / width;
+ }
+ Gdip.Pen_SetDashPattern(pen, pattern, pattern.length);
+ dashStyle = Gdip.DashStyleCustom;
+ } else {
+ dashStyle = Gdip.DashStyleSolid;
+ }
+ }
+ }
+ if (dashStyle != Gdip.DashStyleCustom) Gdip.Pen_SetDashStyle(pen, dashStyle);
+ int joinStyle = 0;
+ switch (style & OS.PS_JOIN_MASK) {
+ case OS.PS_JOIN_MITER: joinStyle = Gdip.LineJoinMiter; break;
+ case OS.PS_JOIN_BEVEL: joinStyle = Gdip.LineJoinBevel; break;
+ case OS.PS_JOIN_ROUND: joinStyle = Gdip.LineJoinRound; break;
+ }
+ Gdip.Pen_SetLineJoin(pen, joinStyle);
+ int dashCap = Gdip.DashCapFlat, capStyle = 0;
+ switch (style & OS.PS_ENDCAP_MASK) {
+ case OS.PS_ENDCAP_FLAT: capStyle = Gdip.LineCapFlat; break;
+ case OS.PS_ENDCAP_ROUND: capStyle = Gdip.LineCapRound; dashCap = Gdip.DashCapRound; break;
+ case OS.PS_ENDCAP_SQUARE: capStyle = Gdip.LineCapSquare; break;
+ }
+ Gdip.Pen_SetLineCap(pen, capStyle, capStyle, dashCap);
+ return pen;
+}
+
/**
* Disposes of the operating system resources associated with
* the graphics context. Applications must dispose of all GCs
@@ -289,6 +366,11 @@ public void dispose() {
if (handle == 0) return;
if (data.device.isDisposed()) return;
+ if (data.gdipGraphics != 0) Gdip.Graphics_delete(data.gdipGraphics);
+ if (data.gdipPen != 0) Gdip.Pen_delete(data.gdipPen);
+ if (data.gdipBrush != 0) Gdip.SolidBrush_delete(data.gdipBrush);
+ data.gdipBrush = data.gdipPen = data.gdipGraphics = 0;
+
/* Select stock pen and brush objects and free resources */
if (data.hPen != 0) {
int nullPen = OS.GetStockObject(OS.NULL_PEN);
@@ -370,6 +452,11 @@ 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;
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ Gdip.Graphics_DrawArc(data.gdipGraphics, data.gdipPen, x, y, width, height, -startAngle, -arcAngle);
+ return;
+ }
/*
* Feature in WinCE. The function Arc is not present in the
* WinCE SDK. The fix is to emulate arc drawing by using
@@ -981,6 +1068,18 @@ 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) {
+ if (data.gdipGraphics != 0) {
+ //TODO - cache bitmap
+ int img = Gdip.Bitmap_new(srcImage.handle, 0);
+ Rect rect = new Rect();
+ rect.X = destX;
+ rect.Y = destY;
+ rect.Width = destWidth;
+ rect.Height = destHeight;
+ Gdip.Graphics_DrawImage(data.gdipGraphics, img, rect, srcX, srcY, srcWidth, srcHeight, Gdip.UnitPixel, 0, 0, 0);
+ Gdip.Bitmap_delete(img);
+ return;
+ }
int srcHdc = OS.CreateCompatibleDC(handle);
int oldSrcBitmap = OS.SelectObject(srcHdc, srcImage.handle);
int rop2 = 0;
@@ -1018,6 +1117,11 @@ 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);
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ Gdip.Graphics_DrawLine(data.gdipGraphics, data.gdipPen, x1, y1, x2, y2);
+ return;
+ }
if (OS.IsWinCE) {
int [] points = new int [] {x1, y1, x2, y2};
OS.Polyline (handle, points, points.length / 2);
@@ -1053,14 +1157,29 @@ 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);
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ Gdip.Graphics_DrawEllipse(data.gdipGraphics, data.gdipPen, x, y, width, height);
+ return;
+ }
// Check performance impact of always setting null brush. If the user has not
// set the background color, we may not have to do this work?
int nullBrush = OS.GetStockObject(OS.NULL_BRUSH);
int oldBrush = OS.SelectObject(handle, nullBrush);
- OS.Ellipse(handle, x,y,x+width+1,y+height+1);
+ OS.Ellipse(handle, x, y, x + width + 1, y + height + 1);
OS.SelectObject(handle,oldBrush);
}
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public void drawPath (Path path) {
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ initGdip(true, false);
+ Gdip.Graphics_DrawPath(data.gdipGraphics, data.gdipPen, path.handle);
+}
+
/**
* Draws a pixel, using the foreground color, at the specified
* point (<code>x</code>, <code>y</code>).
@@ -1103,6 +1222,11 @@ public void drawPoint (int x, int y) {
public void drawPolygon(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ Gdip.Graphics_DrawPolygon(data.gdipGraphics, data.gdipPen, pointArray, pointArray.length / 2);
+ return;
+ }
int nullBrush = OS.GetStockObject(OS.NULL_BRUSH);
int oldBrush = OS.SelectObject(handle, nullBrush);
OS.Polygon(handle, pointArray, pointArray.length / 2);
@@ -1129,6 +1253,11 @@ public void drawPolygon(int[] pointArray) {
public void drawPolyline(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ Gdip.Graphics_DrawLines(data.gdipGraphics, data.gdipPen, pointArray, pointArray.length / 2);
+ return;
+ }
OS.Polyline(handle, pointArray, pointArray.length / 2);
int length = pointArray.length;
if (length >= 2) {
@@ -1155,6 +1284,11 @@ 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);
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ Gdip.Graphics_DrawRectangle(data.gdipGraphics, data.gdipPen, x, y, width, height);
+ return;
+ }
int hOld = OS.SelectObject (handle, OS.GetStockObject (OS.NULL_BRUSH));
OS.Rectangle (handle, x, y, x + width + 1, y + height + 1);
OS.SelectObject (handle, hOld);
@@ -1204,6 +1338,11 @@ public void drawRectangle (Rectangle rect) {
*/
public void drawRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.gdipGraphics != 0) {
+ initGdip(true, false);
+ drawRoundRectangleGdip(data.gdipGraphics, data.gdipPen, x, y, width, height, arcWidth, arcHeight);
+ return;
+ }
if (OS.IsWinCE) {
/*
* Bug in WinCE PPC. On certain devices, RoundRect does not draw
@@ -1250,6 +1389,58 @@ public void drawRoundRectangle (int x, int y, int width, int height, int arcWidt
}
}
+void drawRoundRectangleGdip (int gdipGraphics, int brush, int x, int y, int width, int height, int arcWidth, int arcHeight) {
+ int nx = x;
+ int ny = y;
+ int nw = width;
+ int nh = height;
+ int naw = arcWidth;
+ int nah = arcHeight;
+
+ if (nw < 0) {
+ nw = 0 - nw;
+ nx = nx - nw;
+ }
+ if (nh < 0) {
+ nh = 0 - nh;
+ ny = ny - nh;
+ }
+ if (naw < 0)
+ naw = 0 - naw;
+ if (nah < 0)
+ nah = 0 - nah;
+
+ int naw2 = naw / 2;
+ int nah2 = nah / 2;
+
+ if (nw > naw) {
+ if (nh > nah) {
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx, ny, naw, nah, -90, -90);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx + naw2, ny, nx + nw - naw2, ny);
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx + nw - naw, ny, naw, nah, 0, -90);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx + nw, ny + nah2, nx + nw, ny + nh - nah2);
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx + nw - naw, ny + nh - nah, naw, nah, -270, -90);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx + naw2, ny + nh, nx + nw - naw2, ny + nh);
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx, ny + nh - nah, naw, nah, -180, -90);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx, ny + nah2, nx, ny + nh - nah2);
+ } else {
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx, ny, naw, nh, 90, -180);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx + naw2, ny, nx + nw - naw2, ny);
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx + nw - naw, ny, naw, nh, 270, -180);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx + naw2, ny + nh, nx + nw - naw2, ny + nh);
+ }
+ } else {
+ if (nh > nah) {
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx, ny, nw, nah, 0, -180);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx + nw, ny + nah2, nx + nw, ny + nh - nah2);
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx, ny + nh - nah, nw, nah, -180, -180);
+ Gdip.Graphics_DrawLine(gdipGraphics, brush, nx, ny + nah2, nx, ny + nh - nah2);
+ } else {
+ Gdip.Graphics_DrawArc(gdipGraphics, brush, nx, ny, nw, nh, 0, 360);
+ }
+ }
+}
+
/**
* Draws the given string, using the receiver's current font and
* foreground color. No tab expansion or carriage return processing
@@ -1307,6 +1498,17 @@ public void drawString (String string, int x, int y, boolean isTransparent) {
} else {
rop2 = OS.GetROP2(handle);
}
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ int font = Gdip.Font_new(handle, OS.GetCurrentObject(handle, OS.OBJ_FONT));
+ if (font == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ PointF pt = new PointF();
+ pt.X = x - (Gdip.Font_GetSize(font) / 6);
+ pt.Y = y;
+ Gdip.Graphics_DrawString(data.gdipGraphics, buffer, length, font, pt, data.gdipBrush);
+ Gdip.Font_delete(font);
+ return;
+ }
int oldBkMode = OS.SetBkMode(handle, isTransparent ? OS.TRANSPARENT : OS.OPAQUE);
if (rop2 != OS.R2_XORPEN) {
OS.ExtTextOutW(handle, x, y, 0, null, buffer, length, null);
@@ -1533,7 +1735,6 @@ public boolean equals (Object object) {
*/
public void fillArc (int x, int y, int width, int height, int startAngle, int arcAngle) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
-
if (width < 0) {
x = x + width;
width = -width;
@@ -1542,8 +1743,12 @@ public void fillArc (int x, int y, int width, int height, int startAngle, int ar
y = y + height;
height = -height;
}
-
if (width == 0 || height == 0 || arcAngle == 0) return;
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ Gdip.Graphics_FillPie(data.gdipGraphics, data.gdipBrush, x, y, width, height, -startAngle, -arcAngle);
+ return;
+ }
/*
* Feature in WinCE. The function Pie is not present in the
@@ -1665,7 +1870,31 @@ public void fillGradientRectangle(int x, int y, int width, int height, boolean v
OS.PatBlt(handle, x, y, width, height, dwRop);
return;
}
-
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ PointF p1= new PointF(), p2 = new PointF();
+ p1.X = x;
+ p1.Y = y;
+ if (vertical) {
+ p2.X = p1.X;
+ p2.Y = p1.Y + height;
+ } else {
+ p2.X = p1.X + width;
+ p2.Y = p1.Y;
+ }
+ int rgb = ((fromColor >> 16) & 0xFF) | (fromColor & 0xFF00) | ((fromColor & 0xFF) << 16);
+ int fromGpColor = Gdip.Color_new(data.alpha << 24 | rgb);
+ if (fromGpColor == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ rgb = ((toColor >> 16) & 0xFF) | (toColor & 0xFF00) | ((toColor & 0xFF) << 16);
+ int 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);
+ Gdip.Graphics_FillRectangle(data.gdipGraphics, brush, x, y, width, height);
+ Gdip.LinearGradientBrush_delete(brush);
+ Gdip.Color_delete(fromColor);
+ Gdip.Color_delete(toColor);
+ return;
+ }
/* Use GradientFill if supported, only on Windows 98, 2000 and newer. */
/*
* Bug in Windows: On Windows 2000 when the device is a printer,
@@ -1734,14 +1963,28 @@ public void fillGradientRectangle(int x, int y, int width, int height, boolean v
*/
public void fillOval (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
-
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ Gdip.Graphics_FillEllipse(data.gdipGraphics, data.gdipBrush, x, y, width, height);
+ return;
+ }
/* Assumes that user sets the background color. */
int nullPen = OS.GetStockObject(OS.NULL_PEN);
int oldPen = OS.SelectObject(handle, nullPen);
- OS.Ellipse(handle, x,y,x+width+1,y+height+1);
+ OS.Ellipse(handle, x, y, x + width + 1, y + height + 1);
OS.SelectObject(handle,oldPen);
}
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public void fillPath (Path path) {
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ initGdip(false, true);
+ Gdip.Graphics_FillPath(data.gdipGraphics, data.gdipBrush, path.handle);
+}
+
/**
* Fills the interior of the closed polygon which is defined by the
* specified array of integer coordinates, using the receiver's
@@ -1764,6 +2007,11 @@ public void fillOval (int x, int y, int width, int height) {
public void fillPolygon(int[] pointArray) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, Gdip.FillModeAlternate);
+ return;
+ }
int nullPen = OS.GetStockObject(OS.NULL_PEN);
int oldPen = OS.SelectObject(handle, nullPen);
OS.Polygon(handle, pointArray, pointArray.length / 2);
@@ -1787,6 +2035,11 @@ public void fillPolygon(int[] pointArray) {
*/
public void fillRectangle (int x, int y, int width, int height) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ Gdip.Graphics_FillRectangle(data.gdipGraphics, data.gdipBrush, x, y, width, height);
+ return;
+ }
int rop2 = 0;
if (OS.IsWinCE) {
rop2 = OS.SetROP2(handle, OS.R2_COPYPEN);
@@ -1837,12 +2090,66 @@ public void fillRectangle (Rectangle rect) {
*/
public void fillRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.gdipGraphics != 0) {
+ initGdip(false, true);
+ fillRoundRectangleGdip(data.gdipGraphics, data.gdipBrush, x, y, width, height, arcWidth, arcHeight);
+ return;
+ }
int nullPen = OS.GetStockObject(OS.NULL_PEN);
int oldPen = OS.SelectObject(handle, nullPen);
OS.RoundRect(handle, x,y,x+width+1,y+height+1,arcWidth, arcHeight);
OS.SelectObject(handle,oldPen);
}
+void fillRoundRectangleGdip (int gdipGraphics, int brush, int x, int y, int width, int height, int arcWidth, int arcHeight) {
+ int nx = x;
+ int ny = y;
+ int nw = width;
+ int nh = height;
+ int naw = arcWidth;
+ int nah = arcHeight;
+
+ if (nw < 0) {
+ nw = 0 - nw;
+ nx = nx - nw;
+ }
+ if (nh < 0) {
+ nh = 0 - nh;
+ ny = ny -nh;
+ }
+ if (naw < 0)
+ naw = 0 - naw;
+ if (nah < 0)
+ nah = 0 - nah;
+
+ int naw2 = naw / 2;
+ int nah2 = nah / 2;
+
+ if (nw > naw) {
+ if (nh > nah) {
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx, ny, naw, nah, -90, -90);
+ Gdip.Graphics_FillRectangle(gdipGraphics, brush, nx + naw2, ny, nw - naw2 * 2, nah2);
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx + nw - naw, ny, naw, nah, 0, -90);
+ Gdip.Graphics_FillRectangle(gdipGraphics, brush, nx, ny + nah2, nw, nh - nah2 * 2);
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx + nw - naw, ny + nh - nah, naw, nah, -270, -90);
+ Gdip.Graphics_FillRectangle(gdipGraphics, brush, nx + naw2, ny + nh - nah2, nw - naw2 * 2, nah2);
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx, ny + nh - nah, naw, nah, -180, -90);
+ } else {
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx, ny, naw, nh, -90, -180);
+ Gdip.Graphics_FillRectangle(gdipGraphics, brush, nx + naw2, ny, nw - naw2 * 2, nh);
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx + nw - naw, ny, naw, nh, -270, -180);
+ }
+ } else {
+ if (nh > nah) {
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx, ny, nw, nah, 0, -180);
+ Gdip.Graphics_FillRectangle(gdipGraphics, brush, nx, ny + nah2, nw, nh - nah2 * 2);
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx, ny + nh - nah, nw, nah, -180, -180);
+ } else {
+ Gdip.Graphics_FillPie(gdipGraphics, brush, nx, ny, nw, nh, 0, 360);
+ }
+ }
+}
+
/**
* Returns the <em>advance width</em> of the specified character in
* the font which is currently selected into the receiver.
@@ -1875,6 +2182,14 @@ public int getAdvanceWidth(char ch) {
return width[0];
}
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public int getAlpha() {
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.alpha;
+}
+
/**
* Returns the background color.
*
@@ -1960,6 +2275,7 @@ public Rectangle getClipping() {
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the region is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the region is disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
@@ -1968,6 +2284,7 @@ public Rectangle getClipping() {
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 result = OS.GetClipRgn (handle, region.handle);
if (result != 1) {
RECT rect = new RECT();
@@ -2262,6 +2579,16 @@ public int getStyle () {
return data.style;
}
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public void getTransform(Transform transform) {
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ float[] xform = new float[6];
+ OS.GetWorldTransform(handle, xform);
+ transform.setElements(xform[0], xform[1], xform[2], xform[3], xform[4], xform[5]);
+}
+
/**
* Returns <code>true</code> if this GC is drawing in the mode
* where the resulting color in the destination is the
@@ -2288,6 +2615,15 @@ public boolean getXORMode() {
return rop2 == OS.R2_XORPEN;
}
+void initGdip(boolean draw, boolean fill) {
+ data.device.checkGDIP();
+ int gdipGraphics = data.gdipGraphics;
+ if (gdipGraphics == 0) gdipGraphics = data.gdipGraphics = Gdip.Graphics_new(handle);
+ if (gdipGraphics == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ if (draw && data.gdipPen == 0) data.gdipPen = createGdipPen();
+ if (fill && data.gdipBrush == 0) data.gdipBrush = createGdipBrush();
+}
+
void init(Drawable drawable, GCData data, int hDC) {
int foreground = data.foreground;
if (foreground != -1 && OS.GetTextColor(hDC) != foreground) {
@@ -2367,7 +2703,6 @@ public int hashCode () {
*/
public boolean isClipped() {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- if (data.hwnd != 0 && data.ps != null) return true;
int region = OS.CreateRectRgn(0, 0, 0, 0);
int result = OS.GetClipRgn(handle, region);
OS.DeleteObject(region);
@@ -2388,6 +2723,28 @@ public boolean isDisposed() {
return handle == 0;
}
+boolean isIdentity(float[] xform) {
+ return xform[0] == 1 && xform[1] == 0 && xform[2] == 0 &&
+ xform[3] == 1 && xform[4] == 0 && xform[5] == 0;
+}
+
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public void setAlpha(int alpha) {
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ initGdip(false, false);
+ data.alpha = alpha & 0xFF;
+ if (data.gdipPen != 0) {
+ Gdip.Pen_delete(data.gdipPen);
+ data.gdipPen = 0;
+ }
+ if (data.gdipBrush != 0) {
+ Gdip.SolidBrush_delete(data.gdipBrush);
+ data.gdipBrush = 0;
+ }
+}
+
/**
* Sets the background color. The background color is used
* for fill operations and as the background color when text
@@ -2414,6 +2771,35 @@ public void setBackground (Color color) {
OS.SelectObject (handle, newBrush);
if (data.hBrush != 0) OS.DeleteObject (data.hBrush);
data.hBrush = newBrush;
+ if (data.gdipBrush != 0) {
+ Gdip.SolidBrush_delete(data.gdipBrush);
+ data.gdipBrush = 0;
+ }
+}
+
+void setClipping(int clipRgn) {
+ int hRgn = clipRgn;
+ if (hRgn != 0) {
+ float[] xform = new float[6];
+ OS.GetWorldTransform(handle, xform);
+ if (!isIdentity(xform)) {
+ int count = OS.GetRegionData(hRgn, 0, null);
+ int[] lpRgnData = new int[count / 4];
+ OS.GetRegionData(hRgn, count, lpRgnData);
+ hRgn = OS.ExtCreateRegion(xform, count, lpRgnData);
+ }
+ }
+ OS.SelectClipRgn (handle, hRgn);
+ if (data.gdipGraphics != 0) {
+ if (hRgn != 0) {
+ Gdip.Graphics_SetClip(data.gdipGraphics, hRgn, Gdip.CombineModeReplace);
+ } else {
+ Gdip.Graphics_ResetClip(data.gdipGraphics);
+ }
+ }
+ if (hRgn != 0 && hRgn != clipRgn) {
+ OS.DeleteObject(hRgn);
+ }
}
/**
@@ -2432,9 +2818,19 @@ public void setBackground (Color color) {
*/
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);
- OS.SelectClipRgn (handle, hRgn);
- OS.DeleteObject (hRgn);
+ int hRgn = OS.CreateRectRgn(x, y, x + width, y + height);
+ setClipping(hRgn);
+ OS.DeleteObject(hRgn);
+}
+
+public void setClipping (Path path) {
+ if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path != null && path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ initGdip(false, false);
+ setClipping(0);
+ if (path != null) {
+ Gdip.Graphics_SetClip(data.gdipGraphics, path.handle);
+ }
}
/**
@@ -2451,9 +2847,9 @@ public void setClipping (int x, int y, int width, int height) {
public void setClipping (Rectangle rect) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (rect == null) {
- OS.SelectClipRgn (handle, 0);
+ setClipping(0);
} else {
- setClipping (rect.x, rect.y, rect.width, rect.height);
+ setClipping(rect.x, rect.y, rect.width, rect.height);
}
}
@@ -2463,16 +2859,18 @@ public void setClipping (Rectangle rect) {
* by the argument.
*
* @param region the clipping region.
- *
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
+ * </ul>
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void setClipping (Region region) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
- int hRegion = 0;
- if (region != null) hRegion = region.handle;
- OS.SelectClipRgn (handle, hRegion);
+ if (region != null && region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ setClipping(region != null ? region.handle : 0);
}
/**
@@ -2757,6 +3155,10 @@ void setPen(int newColor, int newWidth, int lineStyle, int capStyle, int joinSty
if (data.hPen != 0) OS.DeleteObject(data.hPen);
data.hPen = newPen;
data.lineWidth = width;
+ if (data.gdipPen != 0) {
+ Gdip.Pen_delete(data.gdipPen);
+ data.gdipPen = 0;
+ }
}
/**
@@ -2779,6 +3181,24 @@ public void setXORMode(boolean xor) {
}
/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public void setTransform(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;
+ if (gdipGraphics == 0) {
+ OS.SetGraphicsMode(handle, OS.GM_ADVANCED);
+ float[] elements = new float[6];
+ transform.getElements(elements);
+ OS.SetWorldTransform(handle, elements);
+ } else {
+ Gdip.Graphics_SetTransform(gdipGraphics, transform.handle);
+ }
+}
+
+/**
* Returns the extent of the given string. No tab
* expansion or carriage return processing will be performed.
* <p>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
index 85c000952d..3b4e62aaa8 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java
@@ -39,4 +39,8 @@ public final class GCData {
public int hwnd;
public PAINTSTRUCT ps;
public int layout = -1;
+ public int alpha = 0xFF;
+ public int gdipGraphics;
+ public int gdipPen;
+ public int gdipBrush;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java
new file mode 100644
index 0000000000..736e38ad94
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Path.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.gdip.*;
+
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public class Path {
+
+ /**
+ * the handle to the OS path resource
+ * (Warning: This field is platform dependent)
+ */
+ public int handle;
+
+ /**
+ * the device where this font was created
+ */
+ Device device;
+
+ PointF currentPoint = new PointF();
+
+public Path (Device device) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ device.checkGDIP();
+ handle = Gdip.GraphicsPath_new(Gdip.FillModeAlternate);
+ if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ if (device.tracking) device.new_Object(this);
+}
+
+public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ if (width == 0 || height == 0 || arcAngle == 0) return;
+ Gdip.GraphicsPath_AddArc(handle, x, y, width, height, -startAngle, -arcAngle);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+}
+
+public void addPath(Path path) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ //TODO - expose connect?
+ Gdip.GraphicsPath_AddPath(handle, path.handle, false);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+}
+
+public void addRectangle(float x, float y, float width, float height) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ RectF rect = new RectF();
+ rect.X = x;
+ rect.Y = y;
+ rect.Width = width;
+ rect.Height = height;
+ Gdip.GraphicsPath_AddRectangle(handle, rect);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+}
+
+public void addString(String string, float x, float y, Font font) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ int length = string.length();
+ char[] buffer = new char[length];
+ string.getChars(0, length, buffer, 0);
+ int hDC = device.internal_new_GC(null);
+ int gdipFont = Gdip.Font_new(hDC, font.handle);
+ PointF point = new PointF();
+ point.X = x - (Gdip.Font_GetSize(gdipFont) / 6);
+ point.Y = y;
+ int family = Gdip.FontFamily_new();
+ Gdip.Font_GetFamily(gdipFont, family);
+ int style = Gdip.Font_GetStyle(gdipFont);
+ float size = Gdip.Font_GetSize(gdipFont);
+ Gdip.GraphicsPath_AddString(handle, buffer, length, family, style, size, point, 0);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+ Gdip.FontFamily_delete(family);
+ Gdip.Font_delete(gdipFont);
+ device.internal_dispose_GC(hDC, null);
+}
+
+public void close() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.GraphicsPath_CloseFigure(handle);
+}
+
+public void curveTo(float cx1, float cy1, float cx2, float cy2, float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.GraphicsPath_AddBezier(handle, currentPoint.X, currentPoint.Y, cx1, cy1, cx2, cy2, x, y);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+}
+
+public void dispose() {
+ if (handle == 0) return;
+ if (device.isDisposed()) return;
+ Gdip.GraphicsPath_delete(handle);
+ handle = 0;
+ if (device.tracking) device.dispose_Object(this);
+ device = null;
+}
+
+public void getCurrentPoint(float[] point) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (point == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (point.length < 2) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ point[0] = currentPoint.X;
+ point[1] = currentPoint.Y;
+}
+
+public void lineTo(float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.GraphicsPath_AddLine(handle, currentPoint.X, currentPoint.Y, x, y);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+}
+
+public boolean isDisposed() {
+ return handle == 0;
+}
+
+public void moveTo(float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ currentPoint.X = x;
+ currentPoint.Y = y;
+}
+
+public void quadTo(float cx, float cy, float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.GraphicsPath_AddBezier(handle, currentPoint.X, currentPoint.Y, cx, cy, cx, cy, x, y);
+ Gdip.GraphicsPath_GetLastPoint(handle, currentPoint);
+}
+
+public String toString() {
+ if (isDisposed()) return "Path {*DISPOSED*}";
+ return "Path {" + handle + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Transform.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Transform.java
new file mode 100644
index 0000000000..b77f1c736c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Transform.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.gdip.*;
+
+/**
+ * WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
+ */
+public class Transform {
+ /**
+ * the handle to the OS path resource
+ * (Warning: This field is platform dependent)
+ */
+ public int handle;
+
+ /**
+ * the device where this font was created
+ */
+ Device device;
+
+public Transform (Device device) {
+ this(device, 1, 0, 0, 1, 0, 0);
+}
+
+public Transform(Device device, float[] elements) {
+ this (device, checkTransform(elements)[0], elements[1], elements[2], elements[3], elements[4], elements[5]);
+}
+
+public Transform (Device device, float m11, float m12, float m21, float m22, float dx, float dy) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ device.checkGDIP();
+ handle = Gdip.Matrix_new(m11, m12, m21, m22, dx, dy);
+ if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ if (device.tracking) device.new_Object(this);
+}
+
+static float[] checkTransform(float[] elements) {
+ if (elements == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ return elements;
+}
+
+public void dispose() {
+ if (handle == 0) return;
+ if (device.isDisposed()) return;
+ Gdip.Matrix_delete(handle);
+ handle = 0;
+ if (device.tracking) device.dispose_Object(this);
+ device = null;
+}
+
+public void getElements(float[] elements) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (elements == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ Gdip.Matrix_GetElements(handle, elements);
+}
+
+public void invert() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (Gdip.Matrix_Invert(handle) != 0) SWT.error(SWT.ERROR_CANNOT_INVERT_MATRIX);
+}
+
+public boolean isDisposed() {
+ return handle == 0;
+}
+
+public boolean isIdentity() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return Gdip.Matrix_IsIdentity(handle);
+}
+
+public void multiply(Transform matrix) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (matrix == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (matrix.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ Gdip.Matrix_Multiply(handle, matrix.handle, Gdip.MatrixOrderPrepend);
+}
+
+public void rotate(float angle) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.Matrix_Rotate(handle, angle, Gdip.MatrixOrderPrepend);
+}
+
+public void scale(float scaleX, float scaleY) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.Matrix_Scale(handle, scaleX, scaleY, Gdip.MatrixOrderPrepend);
+}
+
+public void setElements(float m11, float m12, float m21, float m22, float dx, float dy) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.Matrix_SetElements(handle, m11, m12, m21, m22, dx, dy);
+}
+
+public void transform(float[] pointArray) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ Gdip.Matrix_TransformPoints(handle, pointArray, pointArray.length / 2);
+}
+
+public void translate(float offsetX, float offsetY) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ Gdip.Matrix_Translate(handle, offsetX, offsetY, Gdip.MatrixOrderPrepend);
+}
+
+public String toString() {
+ if (isDisposed()) return "Transform {*DISPOSED*}";
+ float[] elements = new float[6];
+ getElements(elements);
+ return "Transform {" + elements [0] + "," + elements [1] + "," +elements [2] + "," +elements [3] + "," +elements [4] + "," +elements [5] + "}";
+}
+
+}

Back to the top