From e6ab059a12bdec28dd0ae75b6cb2e03875a64176 Mon Sep 17 00:00:00 2001 From: Laurent Michalkovic Date: Thu, 21 Jun 2012 15:06:24 +0200 Subject: [PATCH] d2d/dw support tests --- .../org.eclipse.swt.internal.d2d.properties | 57 ++ .../org.eclipse.swt.internal.dw.properties | 57 ++ .../Eclipse SWT PI/win32/library/d2d.cpp | 479 +++++++++++++++ .../Eclipse SWT PI/win32/library/d2d.h | 42 ++ .../Eclipse SWT PI/win32/library/d2d_custom.cpp | 100 ++++ .../Eclipse SWT PI/win32/library/d2d_custom.h | 11 + .../Eclipse SWT PI/win32/library/d2d_stats.c | 77 +++ .../Eclipse SWT PI/win32/library/d2d_stats.cpp | 105 ++++ .../Eclipse SWT PI/win32/library/d2d_stats.h | 80 +++ .../Eclipse SWT PI/win32/library/d2d_structs.cpp | 475 +++++++++++++++ .../Eclipse SWT PI/win32/library/d2d_structs.h | 145 +++++ .../Eclipse SWT PI/win32/library/dw.cpp | 68 +++ .../Eclipse SWT PI/win32/library/dw.h | 57 ++ .../Eclipse SWT PI/win32/library/dw_custom.cpp | 48 ++ .../Eclipse SWT PI/win32/library/dw_custom.h | 13 + .../Eclipse SWT PI/win32/library/dw_stats.cpp | 46 ++ .../Eclipse SWT PI/win32/library/dw_stats.h | 32 + .../Eclipse SWT PI/win32/library/dw_structs.h | 13 + .../Eclipse SWT PI/win32/library/make_common.mak | 14 + .../Eclipse SWT PI/win32/library/make_win32.mak | 17 + .../Eclipse SWT PI/win32/library/swt_d2d.rc | 45 ++ .../swt/internal/d2d/D2D1_BRUSH_PROPERTIES.java | 30 + .../org/eclipse/swt/internal/d2d/D2D1_COLOR_F.java | 19 + .../swt/internal/d2d/D2D1_MATRIX_3X2_F.java | 87 +++ .../swt/internal/d2d/D2D1_PIXEL_FORMAT.java | 20 + .../eclipse/swt/internal/d2d/D2D1_POINT_2F.java | 17 + .../org/eclipse/swt/internal/d2d/D2D1_RECT_F.java | 20 + .../d2d/D2D1_RENDER_TARGET_PROPERTIES.java | 28 + .../swt/internal/d2d/D2D1_ROUNDED_RECT.java | 25 + .../org/eclipse/swt/internal/d2d/D2D1_SIZE_F.java | 18 + .../internal/d2d/D2D1_STROKE_STYLE_PROPERTIES.java | 30 + .../win32/org/eclipse/swt/internal/d2d/D2d.java | 616 ++++++++++++++++++++ .../org/eclipse/swt/internal/d2d/ID2D1Bitmap.java | 20 + .../eclipse/swt/internal/d2d/ID2D1BitmapBrush.java | 21 + .../org/eclipse/swt/internal/d2d/ID2D1Brush.java | 30 + .../swt/internal/d2d/ID2D1DCRenderTarget.java | 24 + .../org/eclipse/swt/internal/d2d/ID2D1Factory.java | 35 ++ .../internal/d2d/ID2D1GdiInteropRenderTarget.java | 29 + .../swt/internal/d2d/ID2D1HwndRenderTarget.java | 24 + .../org/eclipse/swt/internal/d2d/ID2D1Layer.java | 20 + .../swt/internal/d2d/ID2D1RenderTarget.java | 138 +++++ .../eclipse/swt/internal/d2d/ID2D1Resource.java | 28 + .../swt/internal/d2d/ID2D1SolidColorBrush.java | 30 + .../eclipse/swt/internal/d2d/ID2D1StrokeStyle.java | 52 ++ .../org/eclipse/swt/internal/d2d/IUnknown.java | 40 ++ .../win32/org/eclipse/swt/internal/d2d/RECT.java | 19 + .../win32/org/eclipse/swt/internal/dw/DW.java | 160 +++++ .../eclipse/swt/internal/dw/DWRITE_TEXT_RANGE.java | 8 + .../eclipse/swt/internal/dw/IDWriteFactory.java | 38 ++ .../swt/internal/dw/IDWriteFontCollection.java | 14 + .../eclipse/swt/internal/dw/IDWriteTextFormat.java | 22 + .../eclipse/swt/internal/dw/IDWriteTextLayout.java | 14 + 52 files changed, 3657 insertions(+), 0 deletions(-) create mode 100755 bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.d2d.properties create mode 100755 bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.dw.properties create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.c create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.cpp create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_structs.h create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_common.mak mode change 100644 => 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_d2d.rc create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_BRUSH_PROPERTIES.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_COLOR_F.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_MATRIX_3X2_F.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_PIXEL_FORMAT.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_POINT_2F.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RECT_F.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RENDER_TARGET_PROPERTIES.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_ROUNDED_RECT.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_SIZE_F.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_STROKE_STYLE_PROPERTIES.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2d.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Bitmap.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1BitmapBrush.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Brush.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1DCRenderTarget.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Factory.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1GdiInteropRenderTarget.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1HwndRenderTarget.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Layer.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1RenderTarget.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Resource.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1SolidColorBrush.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1StrokeStyle.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/IUnknown.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/RECT.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DW.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DWRITE_TEXT_RANGE.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFactory.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFontCollection.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextFormat.java create mode 100755 bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextLayout.java diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.d2d.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.d2d.properties new file mode 100755 index 0000000..c4978ec --- /dev/null +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.d2d.properties @@ -0,0 +1,57 @@ +############################################################################### +# Copyright (c) 2004, 2009 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +swt_copyright=/*******************************************************************************\n \ +* Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n \ +* All rights reserved. This program and the accompanying materials\n \ +* are made available under the terms of the Eclipse Public License v1.0\n \ +* which accompanies this distribution, and is available at\n \ +* http://www.eclipse.org/legal/epl-v10.html\n \ +*\n \ +* Contributors:\n \ +* IBM Corporation - initial API and implementation\n \ +*******************************************************************************/\n +swt_properties_copyright=###############################################################################\n\ +# Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n\ +# All rights reserved. This program and the accompanying materials\n\ +# are made available under the terms of the Eclipse Public License v1.0\n\ +# which accompanies this distribution, and is available at\n\ +# http://www.eclipse.org/legal/epl-v10.html\n\ +#\n\ +# Contributors:\n\ +# IBM Corporation - initial API and implementation\n\ +############################################################################### +swt_main_classes=\ +org.eclipse.swt.internal.d2d.D2d,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\ +org.eclipse.swt.internal.dw.DW,../org.eclipse.swt/Eclipse SWT PI/win32/library/ +#org.eclipse.swt.internal.accessibility.gtk.ATK,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\ +#org.eclipse.swt.internal.carbon.OS,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\ +#org.eclipse.swt.internal.cde.CDE,../org.eclipse.swt/Eclipse SWT Program/cde/library/,\ +#org.eclipse.swt.internal.gnome.GNOME,../org.eclipse.swt/Eclipse SWT Program/gnome/library/,\ +#org.eclipse.swt.internal.gtk.GTK,../org.eclipse.swt/Eclipse SWT PI/motif_gtk/library/,\ +#org.eclipse.swt.internal.gtk.OS,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\ +#org.eclipse.swt.internal.motif.OS,../org.eclipse.swt/Eclipse SWT PI/motif/library/,\ +#org.eclipse.swt.internal.mozilla.XPCOM,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\ +#org.eclipse.swt.internal.mozilla.init.XPCOMInit,../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.gdip.Gdip,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\ +#org.eclipse.swt.internal.cairo.Cairo,../org.eclipse.swt/Eclipse SWT PI/cairo/library/,\ +#org.eclipse.swt.internal.opengl.glx.GLX,../org.eclipse.swt/Eclipse SWT OpenGL/glx/library/,\ +#org.eclipse.swt.internal.opengl.win32.WGL,../org.eclipse.swt/Eclipse SWT OpenGL/win32/library/,\ +#org.eclipse.swt.internal.opengl.carbon.AGL,../org.eclipse.swt/Eclipse SWT OpenGL/carbon/library/,\ +#org.eclipse.swt.internal.C,../org.eclipse.swt/Eclipse SWT PI/common/library/,\ +#org.eclipse.swt.internal.wpf.OS,../org.eclipse.swt/Eclipse SWT PI/wpf/library/,\ +#org.eclipse.swt.internal.win32.Win32,../org.eclipse.swt/Eclipse SWT PI/wpf_win32/library/,\ +#org.eclipse.swt.internal.cocoa.Cocoa,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\ +#org.eclipse.swt.internal.cocoa.OS,../org.eclipse.swt/Eclipse SWT PI/cocoa/library/,\ +#org.eclipse.swt.internal.webkit.WebKitGTK,../org.eclipse.swt/Eclipse SWT WebKit/gtk/library/,\ +#org.eclipse.swt.internal.webkit.WebKit_win32,../org.eclipse.swt/Eclipse SWT WebKit/win32/library/ diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.dw.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.dw.properties new file mode 100755 index 0000000..c4978ec --- /dev/null +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.dw.properties @@ -0,0 +1,57 @@ +############################################################################### +# Copyright (c) 2004, 2009 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +swt_copyright=/*******************************************************************************\n \ +* Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n \ +* All rights reserved. This program and the accompanying materials\n \ +* are made available under the terms of the Eclipse Public License v1.0\n \ +* which accompanies this distribution, and is available at\n \ +* http://www.eclipse.org/legal/epl-v10.html\n \ +*\n \ +* Contributors:\n \ +* IBM Corporation - initial API and implementation\n \ +*******************************************************************************/\n +swt_properties_copyright=###############################################################################\n\ +# Copyright (c) 2000, %END_YEAR IBM Corporation and others.\n\ +# All rights reserved. This program and the accompanying materials\n\ +# are made available under the terms of the Eclipse Public License v1.0\n\ +# which accompanies this distribution, and is available at\n\ +# http://www.eclipse.org/legal/epl-v10.html\n\ +#\n\ +# Contributors:\n\ +# IBM Corporation - initial API and implementation\n\ +############################################################################### +swt_main_classes=\ +org.eclipse.swt.internal.d2d.D2d,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\ +org.eclipse.swt.internal.dw.DW,../org.eclipse.swt/Eclipse SWT PI/win32/library/ +#org.eclipse.swt.internal.accessibility.gtk.ATK,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\ +#org.eclipse.swt.internal.carbon.OS,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\ +#org.eclipse.swt.internal.cde.CDE,../org.eclipse.swt/Eclipse SWT Program/cde/library/,\ +#org.eclipse.swt.internal.gnome.GNOME,../org.eclipse.swt/Eclipse SWT Program/gnome/library/,\ +#org.eclipse.swt.internal.gtk.GTK,../org.eclipse.swt/Eclipse SWT PI/motif_gtk/library/,\ +#org.eclipse.swt.internal.gtk.OS,../org.eclipse.swt/Eclipse SWT PI/gtk/library/,\ +#org.eclipse.swt.internal.motif.OS,../org.eclipse.swt/Eclipse SWT PI/motif/library/,\ +#org.eclipse.swt.internal.mozilla.XPCOM,../org.eclipse.swt/Eclipse SWT Mozilla/common/library/,\ +#org.eclipse.swt.internal.mozilla.init.XPCOMInit,../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.gdip.Gdip,../org.eclipse.swt/Eclipse SWT PI/win32/library/,\ +#org.eclipse.swt.internal.cairo.Cairo,../org.eclipse.swt/Eclipse SWT PI/cairo/library/,\ +#org.eclipse.swt.internal.opengl.glx.GLX,../org.eclipse.swt/Eclipse SWT OpenGL/glx/library/,\ +#org.eclipse.swt.internal.opengl.win32.WGL,../org.eclipse.swt/Eclipse SWT OpenGL/win32/library/,\ +#org.eclipse.swt.internal.opengl.carbon.AGL,../org.eclipse.swt/Eclipse SWT OpenGL/carbon/library/,\ +#org.eclipse.swt.internal.C,../org.eclipse.swt/Eclipse SWT PI/common/library/,\ +#org.eclipse.swt.internal.wpf.OS,../org.eclipse.swt/Eclipse SWT PI/wpf/library/,\ +#org.eclipse.swt.internal.win32.Win32,../org.eclipse.swt/Eclipse SWT PI/wpf_win32/library/,\ +#org.eclipse.swt.internal.cocoa.Cocoa,../org.eclipse.swt/Eclipse SWT PI/carbon/library/,\ +#org.eclipse.swt.internal.cocoa.OS,../org.eclipse.swt/Eclipse SWT PI/cocoa/library/,\ +#org.eclipse.swt.internal.webkit.WebKitGTK,../org.eclipse.swt/Eclipse SWT WebKit/gtk/library/,\ +#org.eclipse.swt.internal.webkit.WebKit_win32,../org.eclipse.swt/Eclipse SWT WebKit/win32/library/ diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.cpp new file mode 100755 index 0000000..f8a045d --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.cpp @@ -0,0 +1,479 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "d2d_structs.h" +#include "d2d_stats.h" + +#ifndef D2d_NATIVE +#define D2d_NATIVE(func) Java_org_eclipse_swt_internal_d2d_D2d_##func +#endif + +#ifndef NO_D2D1MakeRotateMatrix +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(D2D1MakeRotateMatrix)(JNIEnv *env, jclass that, jfloat arg0, jobject arg1, jobject arg2); +JNIEXPORT void JNICALL D2d_NATIVE(D2D1MakeRotateMatrix) + (JNIEnv *env, jclass that, jfloat arg0, jobject arg1, jobject arg2) +{ + D2D1_POINT_2F _arg1, *lparg1=NULL; + D2D1_MATRIX_3X2_F _arg2, *lparg2=NULL; + D2d_NATIVE_ENTER(env, that, D2D1MakeRotateMatrix_FUNC); + if (arg1) if ((lparg1 = getD2D1_POINT_2FFields(env, arg1, &_arg1)) == NULL) goto fail; + if (arg2) if ((lparg2 = getD2D1_MATRIX_3X2_FFields(env, arg2, &_arg2)) == NULL) goto fail; + D2D1MakeRotateMatrix((FLOAT)arg0, *lparg1, (D2D1_MATRIX_3X2_F*)lparg2); +fail: + if (arg2 && lparg2) setD2D1_MATRIX_3X2_FFields(env, arg2, lparg2); + if (arg1 && lparg1) setD2D1_POINT_2FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, D2D1MakeRotateMatrix_FUNC); +} +#endif + +#ifndef NO_D2D1_1BRUSH_1PROPERTIES_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1BRUSH_1PROPERTIES_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1BRUSH_1PROPERTIES_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1BRUSH_1PROPERTIES_1sizeof_FUNC); + rc = (jint)D2D1_BRUSH_PROPERTIES_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1BRUSH_1PROPERTIES_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1COLOR_1F_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1COLOR_1F_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1COLOR_1F_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1COLOR_1F_1sizeof_FUNC); + rc = (jint)D2D1_COLOR_F_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1COLOR_1F_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1MATRIX_13X2_1F_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1MATRIX_13X2_1F_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1MATRIX_13X2_1F_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1MATRIX_13X2_1F_1sizeof_FUNC); + rc = (jint)D2D1_MATRIX_3X2_F_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1MATRIX_13X2_1F_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1PIXEL_1FORMAT_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1PIXEL_1FORMAT_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1PIXEL_1FORMAT_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1PIXEL_1FORMAT_1sizeof_FUNC); + rc = (jint)D2D1_PIXEL_FORMAT_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1PIXEL_1FORMAT_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1POINT_12F_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1POINT_12F_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1POINT_12F_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1POINT_12F_1sizeof_FUNC); + rc = (jint)D2D1_POINT_2F_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1POINT_12F_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1RECT_1F_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RECT_1F_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RECT_1F_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1RECT_1F_1sizeof_FUNC); + rc = (jint)D2D1_RECT_F_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1RECT_1F_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof_FUNC); + rc = (jint)D2D1_RENDER_TARGET_PROPERTIES_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1ROUNDED_1RECT_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1ROUNDED_1RECT_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1ROUNDED_1RECT_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1ROUNDED_1RECT_1sizeof_FUNC); + rc = (jint)D2D1_ROUNDED_RECT_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1ROUNDED_1RECT_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1SIZE_1F_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1SIZE_1F_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1SIZE_1F_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1SIZE_1F_1sizeof_FUNC); + rc = (jint)D2D1_SIZE_F_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1SIZE_1F_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof)(JNIEnv *env, jclass that); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof) + (JNIEnv *env, jclass that) +{ + jint rc = 0; + D2d_NATIVE_ENTER(env, that, D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof_FUNC); + rc = (jint)D2D1_STROKE_STYLE_PROPERTIES_sizeof(); + D2d_NATIVE_EXIT(env, that, D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1Brush_1SetOpacity +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1SetOpacity)(JNIEnv *env, jclass that, jintLong arg0, jfloat arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1SetOpacity) + (JNIEnv *env, jclass that, jintLong arg0, jfloat arg1) +{ + D2d_NATIVE_ENTER(env, that, ID2D1Brush_1SetOpacity_FUNC); + ((ID2D1Brush*)arg0)->SetOpacity(arg1); + D2d_NATIVE_EXIT(env, that, ID2D1Brush_1SetOpacity_FUNC); +} +#endif + +#ifndef NO_ID2D1DCRenderTarget_1BindDC +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1DCRenderTarget_1BindDC)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2); +JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1DCRenderTarget_1BindDC) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2) +{ + RECT _arg2, *lparg2=NULL; + jint rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1DCRenderTarget_1BindDC_FUNC); + if (arg2) if ((lparg2 = getRECTFields(env, arg2, &_arg2)) == NULL) goto fail; + rc = (jint)((ID2D1DCRenderTarget *)arg0)->BindDC((HDC)arg1, (CONST RECT *)lparg2); +fail: + if (arg2 && lparg2) setRECTFields(env, arg2, lparg2); + D2d_NATIVE_EXIT(env, that, ID2D1DCRenderTarget_1BindDC_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1Factory_1CreateDCRenderTarget +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateDCRenderTarget)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLongArray arg2); +JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateDCRenderTarget) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLongArray arg2) +{ + D2D1_RENDER_TARGET_PROPERTIES _arg1, *lparg1=NULL; + jintLong *lparg2=NULL; + jint rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1Factory_1CreateDCRenderTarget_FUNC); + if (arg1) if ((lparg1 = getD2D1_RENDER_TARGET_PROPERTIESFields(env, arg1, &_arg1)) == NULL) goto fail; + if (arg2) if ((lparg2 = env->GetIntLongArrayElements(arg2, NULL)) == NULL) goto fail; + rc = (jint)((ID2D1Factory *)arg0)->CreateDCRenderTarget(lparg1, (ID2D1DCRenderTarget**)lparg2); +fail: + if (arg2 && lparg2) env->ReleaseIntLongArrayElements(arg2, lparg2, 0); + if (arg1 && lparg1) setD2D1_RENDER_TARGET_PROPERTIESFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1Factory_1CreateDCRenderTarget_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1Factory_1CreateStrokeStyle +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateStrokeStyle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jfloatArray arg2, jint arg3, jintLongArray arg4); +JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1Factory_1CreateStrokeStyle) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jfloatArray arg2, jint arg3, jintLongArray arg4) +{ + D2D1_STROKE_STYLE_PROPERTIES _arg1, *lparg1=NULL; + jfloat *lparg2=NULL; + jintLong *lparg4=NULL; + jint rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1Factory_1CreateStrokeStyle_FUNC); + if (arg1) if ((lparg1 = getD2D1_STROKE_STYLE_PROPERTIESFields(env, arg1, &_arg1)) == NULL) goto fail; + if (arg2) if ((lparg2 = env->GetFloatArrayElements(arg2, NULL)) == NULL) goto fail; + if (arg4) if ((lparg4 = env->GetIntLongArrayElements(arg4, NULL)) == NULL) goto fail; + rc = (jint)((ID2D1Factory *)arg0)->CreateStrokeStyle(lparg1, (CONST FLOAT*)lparg2, arg3, (ID2D1StrokeStyle**)lparg4); +fail: + if (arg4 && lparg4) env->ReleaseIntLongArrayElements(arg4, lparg4, 0); + if (arg2 && lparg2) env->ReleaseFloatArrayElements(arg2, lparg2, 0); + if (arg1 && lparg1) setD2D1_STROKE_STYLE_PROPERTIESFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1Factory_1CreateStrokeStyle_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1GdiInteropRenderTarget_1GetDC +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1GetDC)(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLongArray arg2); +JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1GetDC) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLongArray arg2) +{ + jintLong *lparg2=NULL; + jint rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1GdiInteropRenderTarget_1GetDC_FUNC); + if (arg2) if ((lparg2 = env->GetIntLongArrayElements(arg2, NULL)) == NULL) goto fail; + rc = (jint)((ID2D1GdiInteropRenderTarget *)arg0)->GetDC((D2D1_DC_INITIALIZE_MODE)arg1, (HDC *)lparg2); +fail: + if (arg2 && lparg2) env->ReleaseIntLongArrayElements(arg2, lparg2, 0); + D2d_NATIVE_EXIT(env, that, ID2D1GdiInteropRenderTarget_1GetDC_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1GdiInteropRenderTarget_1ReleaseDC +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1ReleaseDC)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1); +JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1GdiInteropRenderTarget_1ReleaseDC) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + RECT _arg1, *lparg1=NULL; + jint rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1GdiInteropRenderTarget_1ReleaseDC_FUNC); + if (arg1) if ((lparg1 = getRECTFields(env, arg1, &_arg1)) == NULL) goto fail; + rc = (jint)((ID2D1GdiInteropRenderTarget *)arg0)->ReleaseDC(lparg1); +fail: + if (arg1 && lparg1) setRECTFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1GdiInteropRenderTarget_1ReleaseDC_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1HwndRenderTarget_1GetHwnd +extern "C" JNIEXPORT jintLong JNICALL D2d_NATIVE(ID2D1HwndRenderTarget_1GetHwnd)(JNIEnv *env, jclass that, jintLong arg0); +JNIEXPORT jintLong JNICALL D2d_NATIVE(ID2D1HwndRenderTarget_1GetHwnd) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jintLong rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1HwndRenderTarget_1GetHwnd_FUNC); + rc = (jintLong)((ID2D1HwndRenderTarget *)arg0)->GetHwnd(); + D2d_NATIVE_EXIT(env, that, ID2D1HwndRenderTarget_1GetHwnd_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1RenderTarget_1BeginDraw +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1BeginDraw)(JNIEnv *env, jclass that, jintLong arg0); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1BeginDraw) + (JNIEnv *env, jclass that, jintLong arg0) +{ + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1BeginDraw_FUNC); + ((ID2D1RenderTarget *)arg0)->BeginDraw(); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1BeginDraw_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1Clear +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1Clear)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1Clear) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + D2D1_COLOR_F _arg1, *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1Clear_FUNC); + if (arg1) if ((lparg1 = getD2D1_COLOR_FFields(env, arg1, &_arg1)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->Clear(lparg1); +fail: + if (arg1 && lparg1) setD2D1_COLOR_FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1Clear_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1CreateSolidColorBrush +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1RenderTarget_1CreateSolidColorBrush)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLongArray arg3); +JNIEXPORT jint JNICALL D2d_NATIVE(ID2D1RenderTarget_1CreateSolidColorBrush) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLongArray arg3) +{ + D2D1_COLOR_F _arg1, *lparg1=NULL; + D2D1_BRUSH_PROPERTIES _arg2, *lparg2=NULL; + jintLong *lparg3=NULL; + jint rc = 0; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1CreateSolidColorBrush_FUNC); + if (arg1) if ((lparg1 = getD2D1_COLOR_FFields(env, arg1, &_arg1)) == NULL) goto fail; + if (arg2) if ((lparg2 = getD2D1_BRUSH_PROPERTIESFields(env, arg2, &_arg2)) == NULL) goto fail; + if (arg3) if ((lparg3 = env->GetIntLongArrayElements(arg3, NULL)) == NULL) goto fail; + rc = (jint)((ID2D1RenderTarget *)arg0)->CreateSolidColorBrush(lparg1, lparg2, (ID2D1SolidColorBrush**)lparg3); +fail: + if (arg3 && lparg3) env->ReleaseIntLongArrayElements(arg3, lparg3, 0); + if (arg1 && lparg1) setD2D1_COLOR_FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1CreateSolidColorBrush_FUNC); + return rc; +} +#endif + +#ifndef NO_ID2D1RenderTarget_1DrawLine +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawLine)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLong arg3, jfloat arg4, jintLong arg5); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawLine) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jobject arg2, jintLong arg3, jfloat arg4, jintLong arg5) +{ + D2D1_POINT_2F _arg1, *lparg1=NULL; + D2D1_POINT_2F _arg2, *lparg2=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawLine_FUNC); + if (arg1) if ((lparg1 = getD2D1_POINT_2FFields(env, arg1, &_arg1)) == NULL) goto fail; + if (arg2) if ((lparg2 = getD2D1_POINT_2FFields(env, arg2, &_arg2)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->DrawLine(*lparg1, *lparg2, (ID2D1Brush *)arg3, (FLOAT)arg4, (ID2D1StrokeStyle *)arg5); +fail: + if (arg2 && lparg2) setD2D1_POINT_2FFields(env, arg2, lparg2); + if (arg1 && lparg1) setD2D1_POINT_2FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawLine_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1DrawRectangle +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRectangle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRectangle) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4) +{ + D2D1_RECT_F _arg1, *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawRectangle_FUNC); + if (arg1) if ((lparg1 = getD2D1_RECT_FFields(env, arg1, &_arg1)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->DrawRectangle(lparg1, (ID2D1Brush *)arg2, (FLOAT)arg3, (ID2D1StrokeStyle *)arg4); +fail: + if (arg1 && lparg1) setD2D1_RECT_FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawRectangle_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1DrawRoundedRectangle +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRoundedRectangle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawRoundedRectangle) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2, jfloat arg3, jintLong arg4) +{ + D2D1_ROUNDED_RECT _arg1, *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawRoundedRectangle_FUNC); + if (arg1) if ((lparg1 = getD2D1_ROUNDED_RECTFields(env, arg1, &_arg1)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->DrawRoundedRectangle((D2D1_ROUNDED_RECT *)lparg1, (ID2D1Brush *)arg2, arg3, (ID2D1StrokeStyle *)arg4); +fail: + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawRoundedRectangle_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1DrawText +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawText)(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jintLong arg3, jobject arg4, jintLong arg5, jint arg6, jint arg7); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1DrawText) + (JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jint arg2, jintLong arg3, jobject arg4, jintLong arg5, jint arg6, jint arg7) +{ + jchar *lparg1=NULL; + D2D1_RECT_F _arg4, *lparg4=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1DrawText_FUNC); + if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail; + if (arg4) if ((lparg4 = getD2D1_RECT_FFields(env, arg4, &_arg4)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->DrawText((const WCHAR *)lparg1, (UINT)arg2, (IDWriteTextFormat*)arg3, lparg4, (ID2D1Brush *)arg5, (D2D1_DRAW_TEXT_OPTIONS)arg6, (DWRITE_MEASURING_MODE)arg7); +fail: + if (arg4 && lparg4) setD2D1_RECT_FFields(env, arg4, lparg4); + if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1DrawText_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1EndDraw +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1EndDraw)(JNIEnv *env, jclass that, jintLong arg0); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1EndDraw) + (JNIEnv *env, jclass that, jintLong arg0) +{ + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1EndDraw_FUNC); + ((ID2D1RenderTarget *)arg0)->EndDraw(); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1EndDraw_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1FillRectangle +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1FillRectangle)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1FillRectangle) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2) +{ + D2D1_RECT_F _arg1, *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1FillRectangle_FUNC); + if (arg1) if ((lparg1 = getD2D1_RECT_FFields(env, arg1, &_arg1)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->FillRectangle(lparg1, (ID2D1Brush *)arg2); +fail: + if (arg1 && lparg1) setD2D1_RECT_FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1FillRectangle_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1SetAntialiasMode +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetAntialiasMode)(JNIEnv *env, jclass that, jintLong arg0, jint arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetAntialiasMode) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1SetAntialiasMode_FUNC); + ((ID2D1RenderTarget *)arg0)->SetAntialiasMode((D2D1_ANTIALIAS_MODE)arg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1SetAntialiasMode_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1SetTextAntialiasMode +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTextAntialiasMode)(JNIEnv *env, jclass that, jintLong arg0, jint arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTextAntialiasMode) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1SetTextAntialiasMode_FUNC); + ((ID2D1RenderTarget *)arg0)->SetTextAntialiasMode((D2D1_TEXT_ANTIALIAS_MODE)arg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1SetTextAntialiasMode_FUNC); +} +#endif + +#ifndef NO_ID2D1RenderTarget_1SetTransform +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTransform)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1RenderTarget_1SetTransform) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + D2D1_MATRIX_3X2_F _arg1, *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1RenderTarget_1SetTransform_FUNC); + if (arg1) if ((lparg1 = getD2D1_MATRIX_3X2_FFields(env, arg1, &_arg1)) == NULL) goto fail; + ((ID2D1RenderTarget *)arg0)->SetTransform(lparg1); +fail: + if (arg1 && lparg1) setD2D1_MATRIX_3X2_FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1RenderTarget_1SetTransform_FUNC); +} +#endif + +#ifndef NO_ID2D1SolidColorBrush_1SetColor +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1SetColor)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1SetColor) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + D2D1_COLOR_F _arg1, *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1SolidColorBrush_1SetColor_FUNC); + if (arg1) if ((lparg1 = getD2D1_COLOR_FFields(env, arg1, &_arg1)) == NULL) goto fail; + ((ID2D1SolidColorBrush*)arg0)->SetColor(lparg1); +fail: + D2d_NATIVE_EXIT(env, that, ID2D1SolidColorBrush_1SetColor_FUNC); +} +#endif + +#ifndef ID2D1RenderTarget_NATIVE +#define ID2D1RenderTarget_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1RenderTarget_##func +#endif + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.h new file mode 100755 index 0000000..0691935 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d.h @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#ifndef INC_d2d_H +#define INC_d2d_H + +#include +#include +#include +#include "d2d_custom.h" + +#define D2D_LOAD_FUNCTION LOAD_FUNCTION + +#define NATIVE_TRY(env, that, func) \ + __try { +#define NATIVE_CATCH(env, that, func) \ + } __except(EXCEPTION_EXECUTE_HANDLER) { \ + jclass expClass = (*env)->FindClass(env, "org/eclipse/swt/SWTError"); \ + if (expClass) { \ + char buffer[256]; \ + PRINT_CODE(buffer, 256, "cought native exception: 0x%x", GetExceptionCode()) \ + (*env)->ThrowNew(env, expClass, buffer); \ + } \ + } + +#define D2d_NATIVE_ENTER_TRY(env, that, func) \ + D2d_NATIVE_ENTER(env, that, func); \ + NATIVE_TRY(env, that, func); +#define D2d_NATIVE_EXIT_CATCH(env, that, func) \ + NATIVE_CATCH(env, that, func); \ + D2d_NATIVE_EXIT(env, that, func); + + +#endif /* INC_d2d_H */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.cpp new file mode 100755 index 0000000..c531250 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.cpp @@ -0,0 +1,100 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "d2d_structs.h" +#include "d2d_stats.h" + +#define D2d_NATIVE(func) Java_org_eclipse_swt_internal_d2d_D2d_##func + +#ifndef NO_D2D1CreateFactory +#ifdef JNI64 +#else +#endif +extern "C" JNIEXPORT jint JNICALL D2d_NATIVE(D2D1CreateFactory)(JNIEnv *env, jclass that, jintLongArray arg0); +JNIEXPORT jint JNICALL D2d_NATIVE(D2D1CreateFactory) + (JNIEnv *env, jclass that, jintLongArray arg0) +{ + jintLong *lparg0=NULL; + jint rc = 0; +// D2d_NATIVE_ENTER() + if (arg0) if ((lparg0 = env->GetIntLongArrayElements(arg0, NULL)) == NULL) goto fail; + ID2D1Factory* m_pD2DFactory; + rc = (jint) D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, /*(ID2D1Factory**)&lparg0*/&m_pD2DFactory); + if (rc == S_OK) { + lparg0[0] = (jintLong)m_pD2DFactory; + } +fail: + if (arg0 && lparg0) env->ReleaseIntLongArrayElements(arg0, lparg0, 0); +// D2d_NATIVE_EXIT() + return rc; +} +#endif + +#ifndef ID2D1RenderTarget_NATIVE +#define ID2D1RenderTarget_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1RenderTarget_##func +#endif + +#ifndef NO_ID2D1RenderTarget_1GetSize +extern "C" JNIEXPORT void JNICALL ID2D1RenderTarget_NATIVE(ID2D1RenderTarget_1GetSize)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1); +JNIEXPORT void JNICALL ID2D1RenderTarget_NATIVE(ID2D1RenderTarget_1GetSize) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + D2D1_SIZE_F _arg1, *lparg1=NULL; + D2D1_SIZE_F s; + ID2D1RenderTarget_NATIVE_ENTER(env, that, ID2D1RenderTarget_1GetSize_FUNC); + if (arg1) if ((lparg1 = &_arg1) == NULL) goto fail; + s = ((ID2D1RenderTarget *)arg0)->GetSize(); + lparg1 = &s; +fail: + if (arg1 && lparg1) setD2D1_SIZE_FFields(env, arg1, lparg1); + ID2D1RenderTarget_NATIVE_EXIT(env, that, ID2D1RenderTarget_1GetSize_FUNC); +} +#endif + +//#ifndef ID2D1Brush_NATIVE +//#define ID2D1Brush_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1Brush_##func +//#endif + +#ifndef NO_ID2D1Brush_1GetOpacity +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1GetOpacity)(JNIEnv *env, jclass that, jintLong arg0, jfloatArray arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1Brush_1GetOpacity) + (JNIEnv *env, jclass that, jintLong arg0, jfloatArray arg1) +{ + jfloat *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1Brush_1GetOpacity_FUNC); + if (arg1) if ((lparg1 = env->GetFloatArrayElements(arg1, NULL)) == NULL) goto fail; + FLOAT opacity = ((ID2D1Brush*)arg0)->GetOpacity(); + *lparg1 = opacity; +fail: + if (arg1 && lparg1) env->ReleaseFloatArrayElements(arg1, lparg1, 0); + D2d_NATIVE_EXIT(env, that, ID2D1Brush_1GetOpacity_FUNC); +} +#endif + +//#ifndef ID2D1SolidColorBrush_NATIVE +//#define ID2D1SolidColorBrush_NATIVE(func) Java_org_eclipse_swt_internal_d2d_ID2D1SolidColorBrush_##func +//#endif + +#ifndef NO_ID2D1SolidColorBrush_1GetColor +extern "C" JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1GetColor)(JNIEnv *env, jclass that, jintLong arg0, jobject arg1); +JNIEXPORT void JNICALL D2d_NATIVE(ID2D1SolidColorBrush_1GetColor) + (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) +{ + D2D1_COLOR_F *lparg1=NULL; + D2d_NATIVE_ENTER(env, that, ID2D1SolidColorBrush_1GetColor_FUNC); + D2D1_COLOR_F _arg1 = ((ID2D1SolidColorBrush*)arg0)->GetColor(); + lparg1=&_arg1; + if (arg1 && lparg1) setD2D1_COLOR_FFields(env, arg1, lparg1); + D2d_NATIVE_EXIT(env, that, ID2D1SolidColorBrush_1GetColor_FUNC); +} +#endif + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.h new file mode 100755 index 0000000..7816d43 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_custom.h @@ -0,0 +1,11 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.c new file mode 100755 index 0000000..cbd8a02 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.c @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "d2d_stats.h" + +#ifdef NATIVE_STATS + +int D2d_nativeFunctionCount = 4; +int D2d_nativeFunctionCallCount[4]; +char * D2d_nativeFunctionNames[] = { + "D2D1CreateFactory", + "D2D1_1PIXEL_1FORMAT_1sizeof", + "D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof", + "VtblCall", +}; + +#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func + +JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCount) + (JNIEnv *env, jclass that) +{ + return D2d_nativeFunctionCount; +} + +JNIEXPORT jstring JNICALL STATS_NATIVE(D2d_1GetFunctionName) + (JNIEnv *env, jclass that, jint index) +{ + return (*env)->NewStringUTF(env, D2d_nativeFunctionNames[index]); +} + +JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCallCount) + (JNIEnv *env, jclass that, jint index) +{ + return D2d_nativeFunctionCallCount[index]; +} + +#endif +#ifdef NATIVE_STATS + +int ID2D1RenderTarget_nativeFunctionCount = 3; +int ID2D1RenderTarget_nativeFunctionCallCount[3]; +char * ID2D1RenderTarget_nativeFunctionNames[] = { + "ID2D1RenderTarget_1BeginDraw", + "ID2D1RenderTarget_1Clear", + "ID2D1RenderTarget_1EndDraw", +}; + +#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func + +JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCount) + (JNIEnv *env, jclass that) +{ + return ID2D1RenderTarget_nativeFunctionCount; +} + +JNIEXPORT jstring JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionName) + (JNIEnv *env, jclass that, jint index) +{ + return (*env)->NewStringUTF(env, ID2D1RenderTarget_nativeFunctionNames[index]); +} + +JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCallCount) + (JNIEnv *env, jclass that, jint index) +{ + return ID2D1RenderTarget_nativeFunctionCallCount[index]; +} + +#endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.cpp new file mode 100755 index 0000000..6fdd994 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.cpp @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "d2d_stats.h" + +#ifdef NATIVE_STATS + +int D2d_nativeFunctionCount = 34; +int D2d_nativeFunctionCallCount[34]; +char * D2d_nativeFunctionNames[] = { + "D2D1CreateFactory", + "D2D1MakeRotateMatrix", + "D2D1_1BRUSH_1PROPERTIES_1sizeof", + "D2D1_1COLOR_1F_1sizeof", + "D2D1_1MATRIX_13X2_1F_1sizeof", + "D2D1_1PIXEL_1FORMAT_1sizeof", + "D2D1_1POINT_12F_1sizeof", + "D2D1_1RECT_1F_1sizeof", + "D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof", + "D2D1_1ROUNDED_1RECT_1sizeof", + "D2D1_1SIZE_1F_1sizeof", + "D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof", + "ID2D1Brush_1GetOpacity", + "ID2D1Brush_1SetOpacity", + "ID2D1DCRenderTarget_1BindDC", + "ID2D1Factory_1CreateDCRenderTarget", + "ID2D1Factory_1CreateStrokeStyle", + "ID2D1GdiInteropRenderTarget_1GetDC", + "ID2D1GdiInteropRenderTarget_1ReleaseDC", + "ID2D1HwndRenderTarget_1GetHwnd", + "ID2D1RenderTarget_1BeginDraw", + "ID2D1RenderTarget_1Clear", + "ID2D1RenderTarget_1CreateSolidColorBrush", + "ID2D1RenderTarget_1DrawLine", + "ID2D1RenderTarget_1DrawRectangle", + "ID2D1RenderTarget_1DrawRoundedRectangle", + "ID2D1RenderTarget_1DrawText", + "ID2D1RenderTarget_1EndDraw", + "ID2D1RenderTarget_1FillRectangle", + "ID2D1RenderTarget_1SetAntialiasMode", + "ID2D1RenderTarget_1SetTextAntialiasMode", + "ID2D1RenderTarget_1SetTransform", + "ID2D1SolidColorBrush_1GetColor", + "ID2D1SolidColorBrush_1SetColor", +}; + +#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func + +JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCount) + (JNIEnv *env, jclass that) +{ + return D2d_nativeFunctionCount; +} + +JNIEXPORT jstring JNICALL STATS_NATIVE(D2d_1GetFunctionName) + (JNIEnv *env, jclass that, jint index) +{ + return env->NewStringUTF(D2d_nativeFunctionNames[index]); +} + +JNIEXPORT jint JNICALL STATS_NATIVE(D2d_1GetFunctionCallCount) + (JNIEnv *env, jclass that, jint index) +{ + return D2d_nativeFunctionCallCount[index]; +} + +#endif +#ifdef NATIVE_STATS + +int ID2D1RenderTarget_nativeFunctionCount = 1; +int ID2D1RenderTarget_nativeFunctionCallCount[1]; +char * ID2D1RenderTarget_nativeFunctionNames[] = { + "ID2D1RenderTarget_1GetSize", +}; + +#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func + +JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCount) + (JNIEnv *env, jclass that) +{ + return ID2D1RenderTarget_nativeFunctionCount; +} + +JNIEXPORT jstring JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionName) + (JNIEnv *env, jclass that, jint index) +{ + return env->NewStringUTF(ID2D1RenderTarget_nativeFunctionNames[index]); +} + +JNIEXPORT jint JNICALL STATS_NATIVE(ID2D1RenderTarget_1GetFunctionCallCount) + (JNIEnv *env, jclass that, jint index) +{ + return ID2D1RenderTarget_nativeFunctionCallCount[index]; +} + +#endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.h new file mode 100755 index 0000000..2a80fcb --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_stats.h @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#ifdef NATIVE_STATS +extern int D2d_nativeFunctionCount; +extern int D2d_nativeFunctionCallCount[]; +extern char* D2d_nativeFunctionNames[]; +#define D2d_NATIVE_ENTER(env, that, func) D2d_nativeFunctionCallCount[func]++; +#define D2d_NATIVE_EXIT(env, that, func) +#else +#ifndef D2d_NATIVE_ENTER +#define D2d_NATIVE_ENTER(env, that, func) +#endif +#ifndef D2d_NATIVE_EXIT +#define D2d_NATIVE_EXIT(env, that, func) +#endif +#endif + +typedef enum { + D2D1CreateFactory_FUNC, + D2D1MakeRotateMatrix_FUNC, + D2D1_1BRUSH_1PROPERTIES_1sizeof_FUNC, + D2D1_1COLOR_1F_1sizeof_FUNC, + D2D1_1MATRIX_13X2_1F_1sizeof_FUNC, + D2D1_1PIXEL_1FORMAT_1sizeof_FUNC, + D2D1_1POINT_12F_1sizeof_FUNC, + D2D1_1RECT_1F_1sizeof_FUNC, + D2D1_1RENDER_1TARGET_1PROPERTIES_1sizeof_FUNC, + D2D1_1ROUNDED_1RECT_1sizeof_FUNC, + D2D1_1SIZE_1F_1sizeof_FUNC, + D2D1_1STROKE_1STYLE_1PROPERTIES_1sizeof_FUNC, + ID2D1Brush_1GetOpacity_FUNC, + ID2D1Brush_1SetOpacity_FUNC, + ID2D1DCRenderTarget_1BindDC_FUNC, + ID2D1Factory_1CreateDCRenderTarget_FUNC, + ID2D1Factory_1CreateStrokeStyle_FUNC, + ID2D1GdiInteropRenderTarget_1GetDC_FUNC, + ID2D1GdiInteropRenderTarget_1ReleaseDC_FUNC, + ID2D1HwndRenderTarget_1GetHwnd_FUNC, + ID2D1RenderTarget_1BeginDraw_FUNC, + ID2D1RenderTarget_1Clear_FUNC, + ID2D1RenderTarget_1CreateSolidColorBrush_FUNC, + ID2D1RenderTarget_1DrawLine_FUNC, + ID2D1RenderTarget_1DrawRectangle_FUNC, + ID2D1RenderTarget_1DrawRoundedRectangle_FUNC, + ID2D1RenderTarget_1DrawText_FUNC, + ID2D1RenderTarget_1EndDraw_FUNC, + ID2D1RenderTarget_1FillRectangle_FUNC, + ID2D1RenderTarget_1SetAntialiasMode_FUNC, + ID2D1RenderTarget_1SetTextAntialiasMode_FUNC, + ID2D1RenderTarget_1SetTransform_FUNC, + ID2D1SolidColorBrush_1GetColor_FUNC, + ID2D1SolidColorBrush_1SetColor_FUNC, +} D2d_FUNCS; +#ifdef NATIVE_STATS +extern int ID2D1RenderTarget_nativeFunctionCount; +extern int ID2D1RenderTarget_nativeFunctionCallCount[]; +extern char* ID2D1RenderTarget_nativeFunctionNames[]; +#define ID2D1RenderTarget_NATIVE_ENTER(env, that, func) ID2D1RenderTarget_nativeFunctionCallCount[func]++; +#define ID2D1RenderTarget_NATIVE_EXIT(env, that, func) +#else +#ifndef ID2D1RenderTarget_NATIVE_ENTER +#define ID2D1RenderTarget_NATIVE_ENTER(env, that, func) +#endif +#ifndef ID2D1RenderTarget_NATIVE_EXIT +#define ID2D1RenderTarget_NATIVE_EXIT(env, that, func) +#endif +#endif + +typedef enum { + ID2D1RenderTarget_1GetSize_FUNC, +} ID2D1RenderTarget_FUNCS; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.cpp new file mode 100755 index 0000000..f3d5036 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.cpp @@ -0,0 +1,475 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "d2d_structs.h" + +#ifndef NO_D2D1_BRUSH_PROPERTIES +typedef struct D2D1_BRUSH_PROPERTIES_FID_CACHE { + int cached; + jclass clazz; + jfieldID opacity, transform__11, transform__12, transform__21, transform__22, transform__31, transform__32; +} D2D1_BRUSH_PROPERTIES_FID_CACHE; + +D2D1_BRUSH_PROPERTIES_FID_CACHE D2D1_BRUSH_PROPERTIESFc; + +void cacheD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_BRUSH_PROPERTIESFc.cached) return; + D2D1_BRUSH_PROPERTIESFc.clazz = env->GetObjectClass(lpObject); + D2D1_BRUSH_PROPERTIESFc.opacity = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "opacity", "F"); + D2D1_BRUSH_PROPERTIESFc.transform__11 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__11", "F"); + D2D1_BRUSH_PROPERTIESFc.transform__12 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__12", "F"); + D2D1_BRUSH_PROPERTIESFc.transform__21 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__21", "F"); + D2D1_BRUSH_PROPERTIESFc.transform__22 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__22", "F"); + D2D1_BRUSH_PROPERTIESFc.transform__31 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__31", "F"); + D2D1_BRUSH_PROPERTIESFc.transform__32 = env->GetFieldID(D2D1_BRUSH_PROPERTIESFc.clazz, "transform__32", "F"); + D2D1_BRUSH_PROPERTIESFc.cached = 1; +} + +D2D1_BRUSH_PROPERTIES *getD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct) +{ + if (!D2D1_BRUSH_PROPERTIESFc.cached) cacheD2D1_BRUSH_PROPERTIESFields(env, lpObject); + lpStruct->opacity = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.opacity); + lpStruct->transform._11 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__11); + lpStruct->transform._12 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__12); + lpStruct->transform._21 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__21); + lpStruct->transform._22 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__22); + lpStruct->transform._31 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__31); + lpStruct->transform._32 = (FLOAT)env->GetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__32); + return lpStruct; +} + +void setD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct) +{ + if (!D2D1_BRUSH_PROPERTIESFc.cached) cacheD2D1_BRUSH_PROPERTIESFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.opacity, (jfloat)lpStruct->opacity); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__11, (jfloat)lpStruct->transform._11); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__12, (jfloat)lpStruct->transform._12); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__21, (jfloat)lpStruct->transform._21); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__22, (jfloat)lpStruct->transform._22); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__31, (jfloat)lpStruct->transform._31); + env->SetFloatField(lpObject, D2D1_BRUSH_PROPERTIESFc.transform__32, (jfloat)lpStruct->transform._32); +} +#endif + +#ifndef NO_D2D1_COLOR_F +typedef struct D2D1_COLOR_F_FID_CACHE { + int cached; + jclass clazz; + jfieldID r, g, b, a; +} D2D1_COLOR_F_FID_CACHE; + +D2D1_COLOR_F_FID_CACHE D2D1_COLOR_FFc; + +void cacheD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_COLOR_FFc.cached) return; + D2D1_COLOR_FFc.clazz = env->GetObjectClass(lpObject); + D2D1_COLOR_FFc.r = env->GetFieldID(D2D1_COLOR_FFc.clazz, "r", "F"); + D2D1_COLOR_FFc.g = env->GetFieldID(D2D1_COLOR_FFc.clazz, "g", "F"); + D2D1_COLOR_FFc.b = env->GetFieldID(D2D1_COLOR_FFc.clazz, "b", "F"); + D2D1_COLOR_FFc.a = env->GetFieldID(D2D1_COLOR_FFc.clazz, "a", "F"); + D2D1_COLOR_FFc.cached = 1; +} + +D2D1_COLOR_F *getD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct) +{ + if (!D2D1_COLOR_FFc.cached) cacheD2D1_COLOR_FFields(env, lpObject); + lpStruct->r = env->GetFloatField(lpObject, D2D1_COLOR_FFc.r); + lpStruct->g = env->GetFloatField(lpObject, D2D1_COLOR_FFc.g); + lpStruct->b = env->GetFloatField(lpObject, D2D1_COLOR_FFc.b); + lpStruct->a = env->GetFloatField(lpObject, D2D1_COLOR_FFc.a); + return lpStruct; +} + +void setD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct) +{ + if (!D2D1_COLOR_FFc.cached) cacheD2D1_COLOR_FFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_COLOR_FFc.r, (jfloat)lpStruct->r); + env->SetFloatField(lpObject, D2D1_COLOR_FFc.g, (jfloat)lpStruct->g); + env->SetFloatField(lpObject, D2D1_COLOR_FFc.b, (jfloat)lpStruct->b); + env->SetFloatField(lpObject, D2D1_COLOR_FFc.a, (jfloat)lpStruct->a); +} +#endif + +#ifndef NO_D2D1_MATRIX_3X2_F +typedef struct D2D1_MATRIX_3X2_F_FID_CACHE { + int cached; + jclass clazz; + jfieldID _11, _12, _21, _22, _31, _32; +} D2D1_MATRIX_3X2_F_FID_CACHE; + +D2D1_MATRIX_3X2_F_FID_CACHE D2D1_MATRIX_3X2_FFc; + +void cacheD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_MATRIX_3X2_FFc.cached) return; + D2D1_MATRIX_3X2_FFc.clazz = env->GetObjectClass(lpObject); + D2D1_MATRIX_3X2_FFc._11 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_11", "F"); + D2D1_MATRIX_3X2_FFc._12 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_12", "F"); + D2D1_MATRIX_3X2_FFc._21 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_21", "F"); + D2D1_MATRIX_3X2_FFc._22 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_22", "F"); + D2D1_MATRIX_3X2_FFc._31 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_31", "F"); + D2D1_MATRIX_3X2_FFc._32 = env->GetFieldID(D2D1_MATRIX_3X2_FFc.clazz, "_32", "F"); + D2D1_MATRIX_3X2_FFc.cached = 1; +} + +D2D1_MATRIX_3X2_F *getD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct) +{ + if (!D2D1_MATRIX_3X2_FFc.cached) cacheD2D1_MATRIX_3X2_FFields(env, lpObject); + lpStruct->_11 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._11); + lpStruct->_12 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._12); + lpStruct->_21 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._21); + lpStruct->_22 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._22); + lpStruct->_31 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._31); + lpStruct->_32 = env->GetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._32); + return lpStruct; +} + +void setD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct) +{ + if (!D2D1_MATRIX_3X2_FFc.cached) cacheD2D1_MATRIX_3X2_FFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._11, (jfloat)lpStruct->_11); + env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._12, (jfloat)lpStruct->_12); + env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._21, (jfloat)lpStruct->_21); + env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._22, (jfloat)lpStruct->_22); + env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._31, (jfloat)lpStruct->_31); + env->SetFloatField(lpObject, D2D1_MATRIX_3X2_FFc._32, (jfloat)lpStruct->_32); +} +#endif + +#ifndef NO_D2D1_PIXEL_FORMAT +typedef struct D2D1_PIXEL_FORMAT_FID_CACHE { + int cached; + jclass clazz; + jfieldID format, alphaMode; +} D2D1_PIXEL_FORMAT_FID_CACHE; + +D2D1_PIXEL_FORMAT_FID_CACHE D2D1_PIXEL_FORMATFc; + +void cacheD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_PIXEL_FORMATFc.cached) return; + D2D1_PIXEL_FORMATFc.clazz = env->GetObjectClass(lpObject); + D2D1_PIXEL_FORMATFc.format = env->GetFieldID(D2D1_PIXEL_FORMATFc.clazz, "format", "I"); + D2D1_PIXEL_FORMATFc.alphaMode = env->GetFieldID(D2D1_PIXEL_FORMATFc.clazz, "alphaMode", "I"); + D2D1_PIXEL_FORMATFc.cached = 1; +} + +D2D1_PIXEL_FORMAT *getD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct) +{ + if (!D2D1_PIXEL_FORMATFc.cached) cacheD2D1_PIXEL_FORMATFields(env, lpObject); + lpStruct->format = (DXGI_FORMAT)env->GetIntField(lpObject, D2D1_PIXEL_FORMATFc.format); + lpStruct->alphaMode = (D2D1_ALPHA_MODE)env->GetIntField(lpObject, D2D1_PIXEL_FORMATFc.alphaMode); + return lpStruct; +} + +void setD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct) +{ + if (!D2D1_PIXEL_FORMATFc.cached) cacheD2D1_PIXEL_FORMATFields(env, lpObject); + env->SetIntField(lpObject, D2D1_PIXEL_FORMATFc.format, (jint)lpStruct->format); + env->SetIntField(lpObject, D2D1_PIXEL_FORMATFc.alphaMode, (jint)lpStruct->alphaMode); +} +#endif + +#ifndef NO_D2D1_POINT_2F +typedef struct D2D1_POINT_2F_FID_CACHE { + int cached; + jclass clazz; + jfieldID x, y; +} D2D1_POINT_2F_FID_CACHE; + +D2D1_POINT_2F_FID_CACHE D2D1_POINT_2FFc; + +void cacheD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_POINT_2FFc.cached) return; + D2D1_POINT_2FFc.clazz = env->GetObjectClass(lpObject); + D2D1_POINT_2FFc.x = env->GetFieldID(D2D1_POINT_2FFc.clazz, "x", "F"); + D2D1_POINT_2FFc.y = env->GetFieldID(D2D1_POINT_2FFc.clazz, "y", "F"); + D2D1_POINT_2FFc.cached = 1; +} + +D2D1_POINT_2F *getD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct) +{ + if (!D2D1_POINT_2FFc.cached) cacheD2D1_POINT_2FFields(env, lpObject); + lpStruct->x = env->GetFloatField(lpObject, D2D1_POINT_2FFc.x); + lpStruct->y = env->GetFloatField(lpObject, D2D1_POINT_2FFc.y); + return lpStruct; +} + +void setD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct) +{ + if (!D2D1_POINT_2FFc.cached) cacheD2D1_POINT_2FFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_POINT_2FFc.x, (jfloat)lpStruct->x); + env->SetFloatField(lpObject, D2D1_POINT_2FFc.y, (jfloat)lpStruct->y); +} +#endif + +#ifndef NO_D2D1_RECT_F +typedef struct D2D1_RECT_F_FID_CACHE { + int cached; + jclass clazz; + jfieldID left, top, right, bottom; +} D2D1_RECT_F_FID_CACHE; + +D2D1_RECT_F_FID_CACHE D2D1_RECT_FFc; + +void cacheD2D1_RECT_FFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_RECT_FFc.cached) return; + D2D1_RECT_FFc.clazz = env->GetObjectClass(lpObject); + D2D1_RECT_FFc.left = env->GetFieldID(D2D1_RECT_FFc.clazz, "left", "F"); + D2D1_RECT_FFc.top = env->GetFieldID(D2D1_RECT_FFc.clazz, "top", "F"); + D2D1_RECT_FFc.right = env->GetFieldID(D2D1_RECT_FFc.clazz, "right", "F"); + D2D1_RECT_FFc.bottom = env->GetFieldID(D2D1_RECT_FFc.clazz, "bottom", "F"); + D2D1_RECT_FFc.cached = 1; +} + +D2D1_RECT_F *getD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct) +{ + if (!D2D1_RECT_FFc.cached) cacheD2D1_RECT_FFields(env, lpObject); + lpStruct->left = env->GetFloatField(lpObject, D2D1_RECT_FFc.left); + lpStruct->top = env->GetFloatField(lpObject, D2D1_RECT_FFc.top); + lpStruct->right = env->GetFloatField(lpObject, D2D1_RECT_FFc.right); + lpStruct->bottom = env->GetFloatField(lpObject, D2D1_RECT_FFc.bottom); + return lpStruct; +} + +void setD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct) +{ + if (!D2D1_RECT_FFc.cached) cacheD2D1_RECT_FFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_RECT_FFc.left, (jfloat)lpStruct->left); + env->SetFloatField(lpObject, D2D1_RECT_FFc.top, (jfloat)lpStruct->top); + env->SetFloatField(lpObject, D2D1_RECT_FFc.right, (jfloat)lpStruct->right); + env->SetFloatField(lpObject, D2D1_RECT_FFc.bottom, (jfloat)lpStruct->bottom); +} +#endif + +#ifndef NO_D2D1_RENDER_TARGET_PROPERTIES +typedef struct D2D1_RENDER_TARGET_PROPERTIES_FID_CACHE { + int cached; + jclass clazz; + jfieldID type, pixelFormat_format, pixelFormat_alphaMode, dpiX, dpiY, usage, minLevel; +} D2D1_RENDER_TARGET_PROPERTIES_FID_CACHE; + +D2D1_RENDER_TARGET_PROPERTIES_FID_CACHE D2D1_RENDER_TARGET_PROPERTIESFc; + +void cacheD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_RENDER_TARGET_PROPERTIESFc.cached) return; + D2D1_RENDER_TARGET_PROPERTIESFc.clazz = env->GetObjectClass(lpObject); + D2D1_RENDER_TARGET_PROPERTIESFc.type = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "type", "I"); + D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_format = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "pixelFormat_format", "I"); + D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_alphaMode = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "pixelFormat_alphaMode", "I"); + D2D1_RENDER_TARGET_PROPERTIESFc.dpiX = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "dpiX", "F"); + D2D1_RENDER_TARGET_PROPERTIESFc.dpiY = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "dpiY", "F"); + D2D1_RENDER_TARGET_PROPERTIESFc.usage = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "usage", "I"); + D2D1_RENDER_TARGET_PROPERTIESFc.minLevel = env->GetFieldID(D2D1_RENDER_TARGET_PROPERTIESFc.clazz, "minLevel", "I"); + D2D1_RENDER_TARGET_PROPERTIESFc.cached = 1; +} + +D2D1_RENDER_TARGET_PROPERTIES *getD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct) +{ + if (!D2D1_RENDER_TARGET_PROPERTIESFc.cached) cacheD2D1_RENDER_TARGET_PROPERTIESFields(env, lpObject); + lpStruct->type = (D2D1_RENDER_TARGET_TYPE)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.type); + lpStruct->pixelFormat.format = (DXGI_FORMAT)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_format); + lpStruct->pixelFormat.alphaMode = (D2D1_ALPHA_MODE)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_alphaMode); + lpStruct->dpiX = env->GetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiX); + lpStruct->dpiY = env->GetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiY); + lpStruct->usage = (D2D1_RENDER_TARGET_USAGE)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.usage); + lpStruct->minLevel = (D2D1_FEATURE_LEVEL)env->GetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.minLevel); + return lpStruct; +} + +void setD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct) +{ + if (!D2D1_RENDER_TARGET_PROPERTIESFc.cached) cacheD2D1_RENDER_TARGET_PROPERTIESFields(env, lpObject); + env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.type, (jint)lpStruct->type); + env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_format, (jint)lpStruct->pixelFormat.format); + env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.pixelFormat_alphaMode, (jint)lpStruct->pixelFormat.alphaMode); + env->SetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiX, (jfloat)lpStruct->dpiX); + env->SetFloatField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.dpiY, (jfloat)lpStruct->dpiY); + env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.usage, (jint)lpStruct->usage); + env->SetIntField(lpObject, D2D1_RENDER_TARGET_PROPERTIESFc.minLevel, (jint)lpStruct->minLevel); +} +#endif + +#ifndef NO_D2D1_ROUNDED_RECT +typedef struct D2D1_ROUNDED_RECT_FID_CACHE { + int cached; + jclass clazz; + jfieldID rect_left, rect_top, rect_right, rect_bottom, radiusX, radiusY; +} D2D1_ROUNDED_RECT_FID_CACHE; + +D2D1_ROUNDED_RECT_FID_CACHE D2D1_ROUNDED_RECTFc; + +void cacheD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_ROUNDED_RECTFc.cached) return; + D2D1_ROUNDED_RECTFc.clazz = env->GetObjectClass(lpObject); + D2D1_ROUNDED_RECTFc.rect_left = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_left", "F"); + D2D1_ROUNDED_RECTFc.rect_top = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_top", "F"); + D2D1_ROUNDED_RECTFc.rect_right = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_right", "F"); + D2D1_ROUNDED_RECTFc.rect_bottom = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "rect_bottom", "F"); + D2D1_ROUNDED_RECTFc.radiusX = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "radiusX", "F"); + D2D1_ROUNDED_RECTFc.radiusY = env->GetFieldID(D2D1_ROUNDED_RECTFc.clazz, "radiusY", "F"); + D2D1_ROUNDED_RECTFc.cached = 1; +} + +D2D1_ROUNDED_RECT *getD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct) +{ + if (!D2D1_ROUNDED_RECTFc.cached) cacheD2D1_ROUNDED_RECTFields(env, lpObject); + lpStruct->rect.left = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_left); + lpStruct->rect.top = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_top); + lpStruct->rect.right = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_right); + lpStruct->rect.bottom = (FLOAT)env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_bottom); + lpStruct->radiusX = env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusX); + lpStruct->radiusY = env->GetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusY); + return lpStruct; +} + +void setD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct) +{ + if (!D2D1_ROUNDED_RECTFc.cached) cacheD2D1_ROUNDED_RECTFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_left, (jfloat)lpStruct->rect.left); + env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_top, (jfloat)lpStruct->rect.top); + env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_right, (jfloat)lpStruct->rect.right); + env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.rect_bottom, (jfloat)lpStruct->rect.bottom); + env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusX, (jfloat)lpStruct->radiusX); + env->SetFloatField(lpObject, D2D1_ROUNDED_RECTFc.radiusY, (jfloat)lpStruct->radiusY); +} +#endif + +#ifndef NO_D2D1_SIZE_F +typedef struct D2D1_SIZE_F_FID_CACHE { + int cached; + jclass clazz; + jfieldID width, height; +} D2D1_SIZE_F_FID_CACHE; + +D2D1_SIZE_F_FID_CACHE D2D1_SIZE_FFc; + +void cacheD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_SIZE_FFc.cached) return; + D2D1_SIZE_FFc.clazz = env->GetObjectClass(lpObject); + D2D1_SIZE_FFc.width = env->GetFieldID(D2D1_SIZE_FFc.clazz, "width", "F"); + D2D1_SIZE_FFc.height = env->GetFieldID(D2D1_SIZE_FFc.clazz, "height", "F"); + D2D1_SIZE_FFc.cached = 1; +} + +D2D1_SIZE_F *getD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct) +{ + if (!D2D1_SIZE_FFc.cached) cacheD2D1_SIZE_FFields(env, lpObject); + lpStruct->width = env->GetFloatField(lpObject, D2D1_SIZE_FFc.width); + lpStruct->height = env->GetFloatField(lpObject, D2D1_SIZE_FFc.height); + return lpStruct; +} + +void setD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct) +{ + if (!D2D1_SIZE_FFc.cached) cacheD2D1_SIZE_FFields(env, lpObject); + env->SetFloatField(lpObject, D2D1_SIZE_FFc.width, (jfloat)lpStruct->width); + env->SetFloatField(lpObject, D2D1_SIZE_FFc.height, (jfloat)lpStruct->height); +} +#endif + +#ifndef NO_D2D1_STROKE_STYLE_PROPERTIES +typedef struct D2D1_STROKE_STYLE_PROPERTIES_FID_CACHE { + int cached; + jclass clazz; + jfieldID startCap, endCap, dashCap, lineJoin, miterLimit, dashStyle, dashOffset; +} D2D1_STROKE_STYLE_PROPERTIES_FID_CACHE; + +D2D1_STROKE_STYLE_PROPERTIES_FID_CACHE D2D1_STROKE_STYLE_PROPERTIESFc; + +void cacheD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject) +{ + if (D2D1_STROKE_STYLE_PROPERTIESFc.cached) return; + D2D1_STROKE_STYLE_PROPERTIESFc.clazz = env->GetObjectClass(lpObject); + D2D1_STROKE_STYLE_PROPERTIESFc.startCap = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "startCap", "I"); + D2D1_STROKE_STYLE_PROPERTIESFc.endCap = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "endCap", "I"); + D2D1_STROKE_STYLE_PROPERTIESFc.dashCap = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "dashCap", "I"); + D2D1_STROKE_STYLE_PROPERTIESFc.lineJoin = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "lineJoin", "I"); + D2D1_STROKE_STYLE_PROPERTIESFc.miterLimit = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "miterLimit", "F"); + D2D1_STROKE_STYLE_PROPERTIESFc.dashStyle = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "dashStyle", "I"); + D2D1_STROKE_STYLE_PROPERTIESFc.dashOffset = env->GetFieldID(D2D1_STROKE_STYLE_PROPERTIESFc.clazz, "dashOffset", "F"); + D2D1_STROKE_STYLE_PROPERTIESFc.cached = 1; +} + +D2D1_STROKE_STYLE_PROPERTIES *getD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct) +{ + if (!D2D1_STROKE_STYLE_PROPERTIESFc.cached) cacheD2D1_STROKE_STYLE_PROPERTIESFields(env, lpObject); + lpStruct->startCap = (D2D1_CAP_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.startCap); + lpStruct->endCap = (D2D1_CAP_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.endCap); + lpStruct->dashCap = (D2D1_CAP_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashCap); + lpStruct->lineJoin = (D2D1_LINE_JOIN)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.lineJoin); + lpStruct->miterLimit = (FLOAT)env->GetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.miterLimit); + lpStruct->dashStyle = (D2D1_DASH_STYLE)env->GetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashStyle); + lpStruct->dashOffset = (FLOAT)env->GetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashOffset); + return lpStruct; +} + +void setD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct) +{ + if (!D2D1_STROKE_STYLE_PROPERTIESFc.cached) cacheD2D1_STROKE_STYLE_PROPERTIESFields(env, lpObject); + env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.startCap, (jint)lpStruct->startCap); + env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.endCap, (jint)lpStruct->endCap); + env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashCap, (jint)lpStruct->dashCap); + env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.lineJoin, (jint)lpStruct->lineJoin); + env->SetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.miterLimit, (jfloat)lpStruct->miterLimit); + env->SetIntField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashStyle, (jint)lpStruct->dashStyle); + env->SetFloatField(lpObject, D2D1_STROKE_STYLE_PROPERTIESFc.dashOffset, (jfloat)lpStruct->dashOffset); +} +#endif + +#ifndef NO_RECT +typedef struct RECT_FID_CACHE { + int cached; + jclass clazz; + jfieldID left, top, right, bottom; +} RECT_FID_CACHE; + +RECT_FID_CACHE RECTFc; + +void cacheRECTFields(JNIEnv *env, jobject lpObject) +{ + if (RECTFc.cached) return; + RECTFc.clazz = env->GetObjectClass(lpObject); + RECTFc.left = env->GetFieldID(RECTFc.clazz, "left", "I"); + RECTFc.top = env->GetFieldID(RECTFc.clazz, "top", "I"); + RECTFc.right = env->GetFieldID(RECTFc.clazz, "right", "I"); + RECTFc.bottom = env->GetFieldID(RECTFc.clazz, "bottom", "I"); + RECTFc.cached = 1; +} + +RECT *getRECTFields(JNIEnv *env, jobject lpObject, RECT *lpStruct) +{ + if (!RECTFc.cached) cacheRECTFields(env, lpObject); + lpStruct->left = env->GetIntField(lpObject, RECTFc.left); + lpStruct->top = env->GetIntField(lpObject, RECTFc.top); + lpStruct->right = env->GetIntField(lpObject, RECTFc.right); + lpStruct->bottom = env->GetIntField(lpObject, RECTFc.bottom); + return lpStruct; +} + +void setRECTFields(JNIEnv *env, jobject lpObject, RECT *lpStruct) +{ + if (!RECTFc.cached) cacheRECTFields(env, lpObject); + env->SetIntField(lpObject, RECTFc.left, (jint)lpStruct->left); + env->SetIntField(lpObject, RECTFc.top, (jint)lpStruct->top); + env->SetIntField(lpObject, RECTFc.right, (jint)lpStruct->right); + env->SetIntField(lpObject, RECTFc.bottom, (jint)lpStruct->bottom); +} +#endif + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.h new file mode 100755 index 0000000..61801ea --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/d2d_structs.h @@ -0,0 +1,145 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "d2d.h" + +#ifndef NO_D2D1_BRUSH_PROPERTIES +void cacheD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject); +D2D1_BRUSH_PROPERTIES *getD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct); +void setD2D1_BRUSH_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_BRUSH_PROPERTIES *lpStruct); +#define D2D1_BRUSH_PROPERTIES_sizeof() sizeof(D2D1_BRUSH_PROPERTIES) +#else +#define cacheD2D1_BRUSH_PROPERTIESFields(a,b) +#define getD2D1_BRUSH_PROPERTIESFields(a,b,c) NULL +#define setD2D1_BRUSH_PROPERTIESFields(a,b,c) +#define D2D1_BRUSH_PROPERTIES_sizeof() 0 +#endif + +#ifndef NO_D2D1_COLOR_F +void cacheD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject); +D2D1_COLOR_F *getD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct); +void setD2D1_COLOR_FFields(JNIEnv *env, jobject lpObject, D2D1_COLOR_F *lpStruct); +#define D2D1_COLOR_F_sizeof() sizeof(D2D1_COLOR_F) +#else +#define cacheD2D1_COLOR_FFields(a,b) +#define getD2D1_COLOR_FFields(a,b,c) NULL +#define setD2D1_COLOR_FFields(a,b,c) +#define D2D1_COLOR_F_sizeof() 0 +#endif + +#ifndef NO_D2D1_MATRIX_3X2_F +void cacheD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject); +D2D1_MATRIX_3X2_F *getD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct); +void setD2D1_MATRIX_3X2_FFields(JNIEnv *env, jobject lpObject, D2D1_MATRIX_3X2_F *lpStruct); +#define D2D1_MATRIX_3X2_F_sizeof() sizeof(D2D1_MATRIX_3X2_F) +#else +#define cacheD2D1_MATRIX_3X2_FFields(a,b) +#define getD2D1_MATRIX_3X2_FFields(a,b,c) NULL +#define setD2D1_MATRIX_3X2_FFields(a,b,c) +#define D2D1_MATRIX_3X2_F_sizeof() 0 +#endif + +#ifndef NO_D2D1_PIXEL_FORMAT +void cacheD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject); +D2D1_PIXEL_FORMAT *getD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct); +void setD2D1_PIXEL_FORMATFields(JNIEnv *env, jobject lpObject, D2D1_PIXEL_FORMAT *lpStruct); +#define D2D1_PIXEL_FORMAT_sizeof() sizeof(D2D1_PIXEL_FORMAT) +#else +#define cacheD2D1_PIXEL_FORMATFields(a,b) +#define getD2D1_PIXEL_FORMATFields(a,b,c) NULL +#define setD2D1_PIXEL_FORMATFields(a,b,c) +#define D2D1_PIXEL_FORMAT_sizeof() 0 +#endif + +#ifndef NO_D2D1_POINT_2F +void cacheD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject); +D2D1_POINT_2F *getD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct); +void setD2D1_POINT_2FFields(JNIEnv *env, jobject lpObject, D2D1_POINT_2F *lpStruct); +#define D2D1_POINT_2F_sizeof() sizeof(D2D1_POINT_2F) +#else +#define cacheD2D1_POINT_2FFields(a,b) +#define getD2D1_POINT_2FFields(a,b,c) NULL +#define setD2D1_POINT_2FFields(a,b,c) +#define D2D1_POINT_2F_sizeof() 0 +#endif + +#ifndef NO_D2D1_RECT_F +void cacheD2D1_RECT_FFields(JNIEnv *env, jobject lpObject); +D2D1_RECT_F *getD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct); +void setD2D1_RECT_FFields(JNIEnv *env, jobject lpObject, D2D1_RECT_F *lpStruct); +#define D2D1_RECT_F_sizeof() sizeof(D2D1_RECT_F) +#else +#define cacheD2D1_RECT_FFields(a,b) +#define getD2D1_RECT_FFields(a,b,c) NULL +#define setD2D1_RECT_FFields(a,b,c) +#define D2D1_RECT_F_sizeof() 0 +#endif + +#ifndef NO_D2D1_RENDER_TARGET_PROPERTIES +void cacheD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject); +D2D1_RENDER_TARGET_PROPERTIES *getD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct); +void setD2D1_RENDER_TARGET_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_RENDER_TARGET_PROPERTIES *lpStruct); +#define D2D1_RENDER_TARGET_PROPERTIES_sizeof() sizeof(D2D1_RENDER_TARGET_PROPERTIES) +#else +#define cacheD2D1_RENDER_TARGET_PROPERTIESFields(a,b) +#define getD2D1_RENDER_TARGET_PROPERTIESFields(a,b,c) NULL +#define setD2D1_RENDER_TARGET_PROPERTIESFields(a,b,c) +#define D2D1_RENDER_TARGET_PROPERTIES_sizeof() 0 +#endif + +#ifndef NO_D2D1_ROUNDED_RECT +void cacheD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject); +D2D1_ROUNDED_RECT *getD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct); +void setD2D1_ROUNDED_RECTFields(JNIEnv *env, jobject lpObject, D2D1_ROUNDED_RECT *lpStruct); +#define D2D1_ROUNDED_RECT_sizeof() sizeof(D2D1_ROUNDED_RECT) +#else +#define cacheD2D1_ROUNDED_RECTFields(a,b) +#define getD2D1_ROUNDED_RECTFields(a,b,c) NULL +#define setD2D1_ROUNDED_RECTFields(a,b,c) +#define D2D1_ROUNDED_RECT_sizeof() 0 +#endif + +#ifndef NO_D2D1_SIZE_F +void cacheD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject); +D2D1_SIZE_F *getD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct); +void setD2D1_SIZE_FFields(JNIEnv *env, jobject lpObject, D2D1_SIZE_F *lpStruct); +#define D2D1_SIZE_F_sizeof() sizeof(D2D1_SIZE_F) +#else +#define cacheD2D1_SIZE_FFields(a,b) +#define getD2D1_SIZE_FFields(a,b,c) NULL +#define setD2D1_SIZE_FFields(a,b,c) +#define D2D1_SIZE_F_sizeof() 0 +#endif + +#ifndef NO_D2D1_STROKE_STYLE_PROPERTIES +void cacheD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject); +D2D1_STROKE_STYLE_PROPERTIES *getD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct); +void setD2D1_STROKE_STYLE_PROPERTIESFields(JNIEnv *env, jobject lpObject, D2D1_STROKE_STYLE_PROPERTIES *lpStruct); +#define D2D1_STROKE_STYLE_PROPERTIES_sizeof() sizeof(D2D1_STROKE_STYLE_PROPERTIES) +#else +#define cacheD2D1_STROKE_STYLE_PROPERTIESFields(a,b) +#define getD2D1_STROKE_STYLE_PROPERTIESFields(a,b,c) NULL +#define setD2D1_STROKE_STYLE_PROPERTIESFields(a,b,c) +#define D2D1_STROKE_STYLE_PROPERTIES_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 + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.cpp new file mode 100755 index 0000000..8c89db7 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.cpp @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "dw_structs.h" +#include "dw_stats.h" + +#ifndef DW_NATIVE +#define DW_NATIVE(func) Java_org_eclipse_swt_internal_dw_DW_##func +#endif + +#ifndef NO_IDWriteFactory_1CreateTextFormat +extern "C" JNIEXPORT jint JNICALL DW_NATIVE(IDWriteFactory_1CreateTextFormat)(JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jintLong arg2, jint arg3, jint arg4, jint arg5, jfloat arg6, jcharArray arg7, jintLongArray arg8); +JNIEXPORT jint JNICALL DW_NATIVE(IDWriteFactory_1CreateTextFormat) + (JNIEnv *env, jclass that, jintLong arg0, jcharArray arg1, jintLong arg2, jint arg3, jint arg4, jint arg5, jfloat arg6, jcharArray arg7, jintLongArray arg8) +{ + jchar *lparg1=NULL; + jchar *lparg7=NULL; + jintLong *lparg8=NULL; + jint rc = 0; + DW_NATIVE_ENTER(env, that, IDWriteFactory_1CreateTextFormat_FUNC); + if (arg1) if ((lparg1 = env->GetCharArrayElements(arg1, NULL)) == NULL) goto fail; + if (arg7) if ((lparg7 = env->GetCharArrayElements(arg7, NULL)) == NULL) goto fail; + if (arg8) if ((lparg8 = env->GetIntLongArrayElements(arg8, NULL)) == NULL) goto fail; + rc = (jint)((IDWriteFactory*)arg0)->CreateTextFormat((const WCHAR *)lparg1, (IDWriteFontCollection*)arg2, (DWRITE_FONT_WEIGHT)arg3, (DWRITE_FONT_STYLE)arg4, (DWRITE_FONT_STRETCH)arg5, arg6, (const WCHAR *)lparg7, (IDWriteTextFormat**)lparg8); +fail: + if (arg8 && lparg8) env->ReleaseIntLongArrayElements(arg8, lparg8, 0); + if (arg7 && lparg7) env->ReleaseCharArrayElements(arg7, lparg7, 0); + if (arg1 && lparg1) env->ReleaseCharArrayElements(arg1, lparg1, 0); + DW_NATIVE_EXIT(env, that, IDWriteFactory_1CreateTextFormat_FUNC); + return rc; +} +#endif + +#ifndef NO_IDWriteTextFormat_1SetParagraphAlignment +extern "C" JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetParagraphAlignment)(JNIEnv *env, jclass that, jintLong arg0, jint arg1); +JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetParagraphAlignment) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + jint rc = 0; + DW_NATIVE_ENTER(env, that, IDWriteTextFormat_1SetParagraphAlignment_FUNC); + rc = (jint)((IDWriteTextFormat*)arg0)->SetParagraphAlignment((DWRITE_PARAGRAPH_ALIGNMENT)arg1); + DW_NATIVE_EXIT(env, that, IDWriteTextFormat_1SetParagraphAlignment_FUNC); + return rc; +} +#endif + +#ifndef NO_IDWriteTextFormat_1SetTextAlignment +extern "C" JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetTextAlignment)(JNIEnv *env, jclass that, jintLong arg0, jint arg1); +JNIEXPORT jint JNICALL DW_NATIVE(IDWriteTextFormat_1SetTextAlignment) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + jint rc = 0; + DW_NATIVE_ENTER(env, that, IDWriteTextFormat_1SetTextAlignment_FUNC); + rc = (jint)((IDWriteTextFormat*)arg0)->SetTextAlignment((DWRITE_TEXT_ALIGNMENT)arg1); + DW_NATIVE_EXIT(env, that, IDWriteTextFormat_1SetTextAlignment_FUNC); + return rc; +} +#endif + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.h new file mode 100755 index 0000000..c4a5b4d --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw.h @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2000, 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#ifndef INC_dw_H +#define INC_dw_H + +#include +#include +#include "dw_custom.h" + +#define NATIVE_TRY(env, that, func) \ + __try { +#define NATIVE_CATCH(env, that, func) \ + } __except(EXCEPTION_EXECUTE_HANDLER) { \ + jclass expClass = (*env)->FindClass(env, "org/eclipse/swt/SWTError"); \ + if (expClass) { \ + char buffer[256]; \ + PRINT_CODE(buffer, 256, "cought native exception: 0x%x", GetExceptionCode()) \ + (*env)->ThrowNew(env, expClass, buffer); \ + } \ + } + +#define DW_NATIVE_ENTER_TRY(env, that, func) \ + DW_NATIVE_ENTER(env, that, func); \ + NATIVE_TRY(env, that, func); +#define DW_NATIVE_EXIT_CATCH(env, that, func) \ + NATIVE_CATCH(env, that, func); \ + DW_NATIVE_EXIT(env, that, func); + +#ifdef __cplusplus +extern "C" { +#endif + +#define CALLING_CONVENTION CALLBACK +#define DWrite_LOAD_FUNCTION(var, name, proc) \ + static int initialized = 0; \ + static FARPROC var = NULL; \ + if (!initialized) { \ + HMODULE hm = LoadLibrary(name##_LIB); \ + if (hm) var = GetProcAddress(hm, proc); \ + initialized = 1; \ + } + +#ifdef __cplusplus +} +#endif + + +#endif /* INC_dw_H */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.cpp new file mode 100755 index 0000000..24f1ecf --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.cpp @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "dw.h" +#include "dw_stats.h" + +#define DW_NATIVE(func) Java_org_eclipse_swt_internal_dw_DW_##func + +#ifndef NO_DWriteCreateFactory +extern "C" JNIEXPORT jint JNICALL DW_NATIVE(DWriteCreateFactory)(JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jintLongArray arg2); +JNIEXPORT jint JNICALL DW_NATIVE(DWriteCreateFactory) + (JNIEnv *env, jclass that, jint arg0, jbyteArray arg1, jintLongArray arg2) +{ + + jbyte *lparg1=NULL; + jintLong *lparg2=NULL; + jint rc = 0; + DW_NATIVE_ENTER(env, that, DWriteCreateFactory_FUNC); + if (arg1) if ((lparg1 = env->GetByteArrayElements(arg1, NULL)) == NULL) goto fail; + if (arg2) if ((lparg2 = env->GetIntLongArrayElements(arg2, NULL)) == NULL) goto fail; + +// rc = (jint)DWriteCreateFactory((DWRITE_FACTORY_TYPE)arg0, (GUID*)lparg1, (IUnknown**)lparg2); + rc = (jint)DWriteCreateFactory((DWRITE_FACTORY_TYPE)arg0, __uuidof(IDWriteFactory), (IUnknown**)lparg2); +/* + { + DWrite_LOAD_FUNCTION(factory, Dwrite, DWriteCreateFactory) + if (factory) { + rc = (jint)((jint (*)(jint, jbyte*, jintLong*))factory)(arg0, lparg1, lparg2); + } + } +*/ +fail: + if (arg2 && lparg2) env->ReleaseIntLongArrayElements(arg2, lparg2, 0); + if (arg1 && lparg1) env->ReleaseByteArrayElements(arg1, lparg1, JNI_ABORT); + DW_NATIVE_EXIT(env, that, DWriteCreateFactory_FUNC); + return rc; +} +#endif + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.h new file mode 100755 index 0000000..4828c68 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_custom.h @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2000, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#define Dwrite_LIB "Dwrite.dll" + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.cpp new file mode 100755 index 0000000..cfde3b9 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.cpp @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "swt.h" +#include "dw_stats.h" + +#ifdef NATIVE_STATS + +int DW_nativeFunctionCount = 4; +int DW_nativeFunctionCallCount[4]; +char * DW_nativeFunctionNames[] = { + "DWriteCreateFactory", + "IDWriteFactory_1CreateTextFormat", + "IDWriteTextFormat_1SetParagraphAlignment", + "IDWriteTextFormat_1SetTextAlignment", +}; + +#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func + +JNIEXPORT jint JNICALL STATS_NATIVE(DW_1GetFunctionCount) + (JNIEnv *env, jclass that) +{ + return DW_nativeFunctionCount; +} + +JNIEXPORT jstring JNICALL STATS_NATIVE(DW_1GetFunctionName) + (JNIEnv *env, jclass that, jint index) +{ + return env->NewStringUTF(DW_nativeFunctionNames[index]); +} + +JNIEXPORT jint JNICALL STATS_NATIVE(DW_1GetFunctionCallCount) + (JNIEnv *env, jclass that, jint index) +{ + return DW_nativeFunctionCallCount[index]; +} + +#endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.h new file mode 100755 index 0000000..3151bd1 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_stats.h @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#ifdef NATIVE_STATS +extern int DW_nativeFunctionCount; +extern int DW_nativeFunctionCallCount[]; +extern char* DW_nativeFunctionNames[]; +#define DW_NATIVE_ENTER(env, that, func) DW_nativeFunctionCallCount[func]++; +#define DW_NATIVE_EXIT(env, that, func) +#else +#ifndef DW_NATIVE_ENTER +#define DW_NATIVE_ENTER(env, that, func) +#endif +#ifndef DW_NATIVE_EXIT +#define DW_NATIVE_EXIT(env, that, func) +#endif +#endif + +typedef enum { + DWriteCreateFactory_FUNC, + IDWriteFactory_1CreateTextFormat_FUNC, + IDWriteTextFormat_1SetParagraphAlignment_FUNC, + IDWriteTextFormat_1SetTextAlignment_FUNC, +} DW_FUNCS; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_structs.h new file mode 100755 index 0000000..6b76742 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/dw_structs.h @@ -0,0 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +#include "dw.h" + diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_common.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_common.mak new file mode 100755 index 0000000..f4b71fba --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_common.mak @@ -0,0 +1,14 @@ +#******************************************************************************* +# Copyright (c) 2000, 2012 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +#******************************************************************************* + +maj_ver=4 +min_ver=233 +comma_ver=4,2,3,3 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 old mode 100644 new mode 100755 index 57be563..f36e7f7 --- 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 @@ -32,6 +32,11 @@ GDIP_LIB = $(GDIP_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll GDIP_LIBS = gdiplus.lib GDIP_OBJS = gdip.obj gdip_structs.obj gdip_stats.obj gdip_custom.obj +D2D_PREFIX = swt-d2d +D2D_LIB = $(D2D_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll +D2D_LIBS = d2d1.lib Dwrite.lib +D2D_OBJS = d2d.obj d2d_structs.obj d2d_stats.obj d2d_custom.obj dw.obj dw_stats.obj dw_custom.obj + AWT_PREFIX = swt-awt AWT_LIB = $(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).dll AWT_LIBS = "$(JAVA_HOME)\jre\bin\jawt.lib" @@ -125,6 +130,15 @@ make_swt: $(SWT_OBJS) swt.res link @templrf del templrf +make_d2d: $(D2D_OBJS) swt_d2d.res + echo $(ldebug) $(dlllflags) $(guilibsmt) >templrf + echo $(D2D_LIBS) >>templrf + echo $(D2D_OBJS) >>templrf + echo swt_d2d.res >>templrf + echo -out:$(D2D_LIB) >>templrf + link @templrf + del templrf + make_gdip: $(GDIP_OBJS) swt_gdip.res echo $(ldebug) $(dlllflags) $(guilibsmt) >templrf echo $(GDIP_LIBS) >>templrf @@ -173,6 +187,9 @@ make_xulrunner: $(XULRUNNER_OBJS) swt_xpcom.res swt.res: rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(SWT_LIB)\" -r -fo swt.res swt.rc +swt_d2d.res: + rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(D2D_LIB)\" -r -fo swt_d2d.res swt_d2d.rc + swt_gdip.res: rc $(RCFLAGS) -DSWT_ORG_FILENAME=\"$(GDIP_LIB)\" -r -fo swt_gdip.res swt_gdip.rc diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_d2d.rc b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_d2d.rc new file mode 100755 index 0000000..ecf1bd0 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_d2d.rc @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2000, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-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", "Copyright (c) 2000, 2011 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/d2d/D2D1_BRUSH_PROPERTIES.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_BRUSH_PROPERTIES.java new file mode 100755 index 0000000..8086931 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_BRUSH_PROPERTIES.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_BRUSH_PROPERTIES { + /** @field cast=(FLOAT) */ + public float opacity; + /** @field accessor=transform._11, cast=(FLOAT) */ + public float transform__11; + /** @field accessor=transform._12, cast=(FLOAT) */ + public float transform__12; + /** @field accessor=transform._21, cast=(FLOAT) */ + public float transform__21; + /** @field accessor=transform._22, cast=(FLOAT) */ + public float transform__22; + /** @field accessor=transform._31, cast=(FLOAT) */ + public float transform__31; + /** @field accessor=transform._32, cast=(FLOAT) */ + public float transform__32; + public static final int sizeof = D2d.D2D1_BRUSH_PROPERTIES_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_COLOR_F.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_COLOR_F.java new file mode 100755 index 0000000..5b3fe5a --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_COLOR_F.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class D2D1_COLOR_F { + public float r; + public float g; + public float b; + public float a; + public static final int sizeof = D2d.D2D1_COLOR_F_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_MATRIX_3X2_F.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_MATRIX_3X2_F.java new file mode 100755 index 0000000..2b8b304 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_MATRIX_3X2_F.java @@ -0,0 +1,87 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_MATRIX_3X2_F { + public float _11; + public float _12; + public float _21; + public float _22; + public float _31; + public float _32; + public static final int sizeof = D2d.D2D1_MATRIX_3X2_F_sizeof(); + +public D2D1_MATRIX_3X2_F translate(D2D1_SIZE_F size) { + return translate(size.width, size.height); +} + +public D2D1_MATRIX_3X2_F translate(float x, float y) { + _11 = 1.0f; _12 = 0.0f; + _21 = 0.0f; _22 = 1.0f; + _31 = x; + _32 = y; + return this; +} + +public D2D1_MATRIX_3X2_F scale(float dx, float dy, D2D1_POINT_2F center) { + _11 = dx; _12 = 0.0f; + _21 = 0.0f; _22 = dy; + _31 = center.x - dx * center.x; + _32 = center.y - dy * center.y; + return this; +} + +public D2D1_MATRIX_3X2_F compose(D2D1_MATRIX_3X2_F m) { + float r_11, r_12, r_21, r_22, r_31, r_32; + r_11 = _11 * m._11 + _12 * m._21; + r_12 = _11 * m._12 + _12 * m._22; + r_21 = _21 * m._11 + _22 * m._21; + r_22 = _21 * m._12 + _22 * m._22; + r_31 = _31 * m._11 + _32 * m._21 + m._31; + r_32 = _31 * m._12 + _32 * m._22 + m._32; + _11 = r_11; + _12 = r_12; + _21 = r_21; + _22 = r_22; + _31 = r_31; + _32 = r_32; + return this; +} + +public D2D1_MATRIX_3X2_F rotate(float r, D2D1_POINT_2F center) { + D2d.D2D1MakeRotateMatrix(r, center, this); + return this; +} + +public D2D1_MATRIX_3X2_F skew() { + return this; +} + +public D2D1_MATRIX_3X2_F identify() { + _11 = 1.0f; _12 = 0.0f; + _21 = 1.0f; _22 = 0.0f; + _31 = 0.0f; + _32 = 0.0f; + return this; +} + +public D2D1_MATRIX_3X2_F setComposed(D2D1_MATRIX_3X2_F a, D2D1_MATRIX_3X2_F b) { + _11 = a._11 * b._11 + a._12 * b._21; + _12 = a._11 * b._12 + a._12 * b._22; + _21 = a._21 * b._11 + a._22 * b._21; + _22 = a._21 * b._12 + a._22 * b._22; + _31 = a._31 * b._11 + a._32 * b._21 + b._31; + _32 = a._31 * b._12 + a._32 * b._22 + b._32; + return this; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_PIXEL_FORMAT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_PIXEL_FORMAT.java new file mode 100755 index 0000000..ea9cf3c --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_PIXEL_FORMAT.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_PIXEL_FORMAT { + /** @field cast=(DXGI_FORMAT) */ + public int format; + /** @field cast=(D2D1_ALPHA_MODE) */ + public int alphaMode; + public static final int sizeof = D2d.D2D1_PIXEL_FORMAT_sizeof (); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_POINT_2F.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_POINT_2F.java new file mode 100755 index 0000000..7fe1d70 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_POINT_2F.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class D2D1_POINT_2F { + public float x; + public float y; + public static final int sizeof = D2d.D2D1_POINT_2F_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RECT_F.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RECT_F.java new file mode 100755 index 0000000..3eadc4a --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RECT_F.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_RECT_F { + public float left; + public float top; + public float right; + public float bottom; + public static final int sizeof = D2d.D2D1_RECT_F_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RENDER_TARGET_PROPERTIES.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RENDER_TARGET_PROPERTIES.java new file mode 100755 index 0000000..e78ce8e --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_RENDER_TARGET_PROPERTIES.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_RENDER_TARGET_PROPERTIES { + /** @field cast=(D2D1_RENDER_TARGET_TYPE) */ + public int type; + /** @field accessor=pixelFormat.format, cast=(DXGI_FORMAT) */ + public int pixelFormat_format; + /** @field accessor=pixelFormat.alphaMode, cast=(D2D1_ALPHA_MODE) */ + public int pixelFormat_alphaMode; + public float dpiX; + public float dpiY; + /** @field cast=(D2D1_RENDER_TARGET_USAGE) */ + public int usage; + /** @field cast=(D2D1_FEATURE_LEVEL) */ + public int minLevel; + public static final int sizeof = D2d.D2D1_RENDER_TARGET_PROPERTIES_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_ROUNDED_RECT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_ROUNDED_RECT.java new file mode 100755 index 0000000..030eb72 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_ROUNDED_RECT.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class D2D1_ROUNDED_RECT { + /** @field accessor=rect.left, cast=(FLOAT) */ + public float rect_left; + /** @field accessor=rect.top, cast=(FLOAT) */ + public float rect_top; + /** @field accessor=rect.right, cast=(FLOAT) */ + public float rect_right; + /** @field accessor=rect.bottom, cast=(FLOAT) */ + public float rect_bottom; + public float radiusX; + public float radiusY; + public static final int sizeof = D2d.D2D1_ROUNDED_RECT_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_SIZE_F.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_SIZE_F.java new file mode 100755 index 0000000..b20384c --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_SIZE_F.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_SIZE_F { + public float width; + public float height; + public static final int sizeof = D2d.D2D1_SIZE_F_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_STROKE_STYLE_PROPERTIES.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_STROKE_STYLE_PROPERTIES.java new file mode 100755 index 0000000..5c79b97 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2D1_STROKE_STYLE_PROPERTIES.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** @jniclass flags=cpp */ +public class D2D1_STROKE_STYLE_PROPERTIES { + /** @field cast=(D2D1_CAP_STYLE) */ + public int startCap; + /** @field cast=(D2D1_CAP_STYLE) */ + public int endCap; + /** @field cast=(D2D1_CAP_STYLE) */ + public int dashCap; + /** @field cast=(D2D1_LINE_JOIN) */ + public int lineJoin; + /** @field cast=(FLOAT) */ + public float miterLimit; + /** @field cast=(D2D1_DASH_STYLE) */ + public int dashStyle; + /** @field cast=(FLOAT) */ + public float dashOffset; + public static final int sizeof = D2d.D2D1_STROKE_STYLE_PROPERTIES_sizeof(); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2d.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2d.java new file mode 100755 index 0000000..06c6db8 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/D2d.java @@ -0,0 +1,616 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +import org.eclipse.swt.internal.*; +import org.eclipse.swt.internal.ole.win32.*; + + +/** @jniclass flags=cpp */ +public class D2d extends C { + + static { + Library.loadLibrary ("swt-d2d"); //$NON-NLS-1$ + } + +// ------------------------------------------------------------------------------------- + +static int sc_redShift = 16; +static int sc_greenShift = 8; +static int sc_blueShift = 0; + +static int sc_redMask = 0xff << sc_redShift; +static int sc_greenMask = 0xff << sc_greenShift; +static int sc_blueMask = 0xff << sc_blueShift; +public static final D2D1_COLOR_F fromRGB(int rgb) { + D2D1_COLOR_F color = new D2D1_COLOR_F(); + color.a = 1.0f; + color.r = ((rgb & sc_redMask) >> sc_redShift) / 255.f; + color.g = ((rgb & sc_greenMask) >> sc_greenShift) / 255.f; + color.b = ((rgb & sc_blueMask) >> sc_blueShift) / 255.f; + return color; +} + +public static final D2D1_COLOR_F AliceBlue = fromRGB(0xF0F8FF); +public static final D2D1_COLOR_F AntiqueWhite = fromRGB(0xFAEBD7); +public static final D2D1_COLOR_F Aqua = fromRGB(0x00FFFF); +public static final D2D1_COLOR_F Aquamarine = fromRGB(0x7FFFD4); +public static final D2D1_COLOR_F Azure = fromRGB(0xF0FFFF); +public static final D2D1_COLOR_F Beige = fromRGB(0xF5F5DC); +public static final D2D1_COLOR_F Bisque = fromRGB(0xFFE4C4); +public static final D2D1_COLOR_F Black = fromRGB(0x000000); +public static final D2D1_COLOR_F BlanchedAlmond = fromRGB(0xFFEBCD); +public static final D2D1_COLOR_F Blue = fromRGB(0x0000FF); +public static final D2D1_COLOR_F BlueViolet = fromRGB(0x8A2BE2); +public static final D2D1_COLOR_F Brown = fromRGB(0xA52A2A); +public static final D2D1_COLOR_F BurlyWood = fromRGB(0xDEB887); +public static final D2D1_COLOR_F CadetBlue = fromRGB(0x5F9EA0); +public static final D2D1_COLOR_F Chartreuse = fromRGB(0x7FFF00); +public static final D2D1_COLOR_F Chocolate = fromRGB(0xD2691E); +public static final D2D1_COLOR_F Coral = fromRGB(0xFF7F50); +public static final D2D1_COLOR_F CornflowerBlue = fromRGB(0x6495ED); +public static final D2D1_COLOR_F Cornsilk = fromRGB(0xFFF8DC); +public static final D2D1_COLOR_F Crimson = fromRGB(0xDC143C); +public static final D2D1_COLOR_F Cyan = fromRGB(0x00FFFF); +public static final D2D1_COLOR_F DarkBlue = fromRGB(0x00008B); +public static final D2D1_COLOR_F DarkCyan = fromRGB(0x008B8B); +public static final D2D1_COLOR_F DarkGoldenrod = fromRGB(0xB8860B); +public static final D2D1_COLOR_F DarkGray = fromRGB(0xA9A9A9); +public static final D2D1_COLOR_F DarkGreen = fromRGB(0x006400); +public static final D2D1_COLOR_F DarkKhaki = fromRGB(0xBDB76B); +public static final D2D1_COLOR_F DarkMagenta = fromRGB(0x8B008B); +public static final D2D1_COLOR_F DarkOliveGreen = fromRGB(0x556B2F); +public static final D2D1_COLOR_F DarkOrange = fromRGB(0xFF8C00); +public static final D2D1_COLOR_F DarkOrchid = fromRGB(0x9932CC); +public static final D2D1_COLOR_F DarkRed = fromRGB(0x8B0000); +public static final D2D1_COLOR_F DarkSalmon = fromRGB(0xE9967A); +public static final D2D1_COLOR_F DarkSeaGreen = fromRGB(0x8FBC8F); +public static final D2D1_COLOR_F DarkSlateBlue = fromRGB(0x483D8B); +public static final D2D1_COLOR_F DarkSlateGray = fromRGB(0x2F4F4F); +public static final D2D1_COLOR_F DarkTurquoise = fromRGB(0x00CED1); +public static final D2D1_COLOR_F DarkViolet = fromRGB(0x9400D3); +public static final D2D1_COLOR_F DeepPink = fromRGB(0xFF1493); +public static final D2D1_COLOR_F DeepSkyBlue = fromRGB(0x00BFFF); +public static final D2D1_COLOR_F DimGray = fromRGB(0x696969); +public static final D2D1_COLOR_F DodgerBlue = fromRGB(0x1E90FF); +public static final D2D1_COLOR_F Firebrick = fromRGB(0xB22222); +public static final D2D1_COLOR_F FloralWhite = fromRGB(0xFFFAF0); +public static final D2D1_COLOR_F ForestGreen = fromRGB(0x228B22); +public static final D2D1_COLOR_F Fuchsia = fromRGB(0xFF00FF); +public static final D2D1_COLOR_F Gainsboro = fromRGB(0xDCDCDC); +public static final D2D1_COLOR_F GhostWhite = fromRGB(0xF8F8FF); +public static final D2D1_COLOR_F Gold = fromRGB(0xFFD700); +public static final D2D1_COLOR_F Goldenrod = fromRGB(0xDAA520); +public static final D2D1_COLOR_F Gray = fromRGB(0x808080); +public static final D2D1_COLOR_F Green = fromRGB(0x008000); +public static final D2D1_COLOR_F GreenYellow = fromRGB(0xADFF2F); +public static final D2D1_COLOR_F Honeydew = fromRGB(0xF0FFF0); +public static final D2D1_COLOR_F HotPink = fromRGB(0xFF69B4); +public static final D2D1_COLOR_F IndianRed = fromRGB(0xCD5C5C); +public static final D2D1_COLOR_F Indigo = fromRGB(0x4B0082); +public static final D2D1_COLOR_F Ivory = fromRGB(0xFFFFF0); +public static final D2D1_COLOR_F Khaki = fromRGB(0xF0E68C); +public static final D2D1_COLOR_F Lavender = fromRGB(0xE6E6FA); +public static final D2D1_COLOR_F LavenderBlush = fromRGB(0xFFF0F5); +public static final D2D1_COLOR_F LawnGreen = fromRGB(0x7CFC00); +public static final D2D1_COLOR_F LemonChiffon = fromRGB(0xFFFACD); +public static final D2D1_COLOR_F LightBlue = fromRGB(0xADD8E6); +public static final D2D1_COLOR_F LightCoral = fromRGB(0xF08080); +public static final D2D1_COLOR_F LightCyan = fromRGB(0xE0FFFF); +public static final D2D1_COLOR_F LightGoldenrodYellow = fromRGB(0xFAFAD2); +public static final D2D1_COLOR_F LightGreen = fromRGB(0x90EE90); +public static final D2D1_COLOR_F LightGray = fromRGB(0xD3D3D3); +public static final D2D1_COLOR_F LightPink = fromRGB(0xFFB6C1); +public static final D2D1_COLOR_F LightSalmon = fromRGB(0xFFA07A); +public static final D2D1_COLOR_F LightSeaGreen = fromRGB(0x20B2AA); +public static final D2D1_COLOR_F LightSkyBlue = fromRGB(0x87CEFA); +public static final D2D1_COLOR_F LightSlateGray = fromRGB(0x778899); +public static final D2D1_COLOR_F LightSteelBlue = fromRGB(0xB0C4DE); +public static final D2D1_COLOR_F LightYellow = fromRGB(0xFFFFE0); +public static final D2D1_COLOR_F Lime = fromRGB(0x00FF00); +public static final D2D1_COLOR_F LimeGreen = fromRGB(0x32CD32); +public static final D2D1_COLOR_F Linen = fromRGB(0xFAF0E6); +public static final D2D1_COLOR_F Magenta = fromRGB(0xFF00FF); +public static final D2D1_COLOR_F Maroon = fromRGB(0x800000); +public static final D2D1_COLOR_F MediumAquamarine = fromRGB(0x66CDAA); +public static final D2D1_COLOR_F MediumBlue = fromRGB(0x0000CD); +public static final D2D1_COLOR_F MediumOrchid = fromRGB(0xBA55D3); +public static final D2D1_COLOR_F MediumPurple = fromRGB(0x9370DB); +public static final D2D1_COLOR_F MediumSeaGreen = fromRGB(0x3CB371); +public static final D2D1_COLOR_F MediumSlateBlue = fromRGB(0x7B68EE); +public static final D2D1_COLOR_F MediumSpringGreen = fromRGB(0x00FA9A); +public static final D2D1_COLOR_F MediumTurquoise = fromRGB(0x48D1CC); +public static final D2D1_COLOR_F MediumVioletRed = fromRGB(0xC71585); +public static final D2D1_COLOR_F MidnightBlue = fromRGB(0x191970); +public static final D2D1_COLOR_F MintCream = fromRGB(0xF5FFFA); +public static final D2D1_COLOR_F MistyRose = fromRGB(0xFFE4E1); +public static final D2D1_COLOR_F Moccasin = fromRGB(0xFFE4B5); +public static final D2D1_COLOR_F NavajoWhite = fromRGB(0xFFDEAD); +public static final D2D1_COLOR_F Navy = fromRGB(0x000080); +public static final D2D1_COLOR_F OldLace = fromRGB(0xFDF5E6); +public static final D2D1_COLOR_F Olive = fromRGB(0x808000); +public static final D2D1_COLOR_F OliveDrab = fromRGB(0x6B8E23); +public static final D2D1_COLOR_F Orange = fromRGB(0xFFA500); +public static final D2D1_COLOR_F OrangeRed = fromRGB(0xFF4500); +public static final D2D1_COLOR_F Orchid = fromRGB(0xDA70D6); +public static final D2D1_COLOR_F PaleGoldenrod = fromRGB(0xEEE8AA); +public static final D2D1_COLOR_F PaleGreen = fromRGB(0x98FB98); +public static final D2D1_COLOR_F PaleTurquoise = fromRGB(0xAFEEEE); +public static final D2D1_COLOR_F PaleVioletRed = fromRGB(0xDB7093); +public static final D2D1_COLOR_F PapayaWhip = fromRGB(0xFFEFD5); +public static final D2D1_COLOR_F PeachPuff = fromRGB(0xFFDAB9); +public static final D2D1_COLOR_F Peru = fromRGB(0xCD853F); +public static final D2D1_COLOR_F Pink = fromRGB(0xFFC0CB); +public static final D2D1_COLOR_F Plum = fromRGB(0xDDA0DD); +public static final D2D1_COLOR_F PowderBlue = fromRGB(0xB0E0E6); +public static final D2D1_COLOR_F Purple = fromRGB(0x800080); +public static final D2D1_COLOR_F Red = fromRGB(0xFF0000); +public static final D2D1_COLOR_F RosyBrown = fromRGB(0xBC8F8F); +public static final D2D1_COLOR_F RoyalBlue = fromRGB(0x4169E1); +public static final D2D1_COLOR_F SaddleBrown = fromRGB(0x8B4513); +public static final D2D1_COLOR_F Salmon = fromRGB(0xFA8072); +public static final D2D1_COLOR_F SandyBrown = fromRGB(0xF4A460); +public static final D2D1_COLOR_F SeaGreen = fromRGB(0x2E8B57); +public static final D2D1_COLOR_F SeaShell = fromRGB(0xFFF5EE); +public static final D2D1_COLOR_F Sienna = fromRGB(0xA0522D); +public static final D2D1_COLOR_F Silver = fromRGB(0xC0C0C0); +public static final D2D1_COLOR_F SkyBlue = fromRGB(0x87CEEB); +public static final D2D1_COLOR_F SlateBlue = fromRGB(0x6A5ACD); +public static final D2D1_COLOR_F SlateGray = fromRGB(0x708090); +public static final D2D1_COLOR_F Snow = fromRGB(0xFFFAFA); +public static final D2D1_COLOR_F SpringGreen = fromRGB(0x00FF7F); +public static final D2D1_COLOR_F SteelBlue = fromRGB(0x4682B4); +public static final D2D1_COLOR_F Tan = fromRGB(0xD2B48C); +public static final D2D1_COLOR_F Teal = fromRGB(0x008080); +public static final D2D1_COLOR_F Thistle = fromRGB(0xD8BFD8); +public static final D2D1_COLOR_F Tomato = fromRGB(0xFF6347); +public static final D2D1_COLOR_F Turquoise = fromRGB(0x40E0D0); +public static final D2D1_COLOR_F Violet = fromRGB(0xEE82EE); +public static final D2D1_COLOR_F Wheat = fromRGB(0xF5DEB3); +public static final D2D1_COLOR_F White = fromRGB(0xFFFFFF); +public static final D2D1_COLOR_F WhiteSmoke = fromRGB(0xF5F5F5); +public static final D2D1_COLOR_F Yellow = fromRGB(0xFFFF00); +public static final D2D1_COLOR_F YellowGreen = fromRGB(0x9ACD32); + +// ------------------------------------------------------------------------------------- + +public static final GUID CLSID_ID2D1Resource = D2d.IIDFromString("{2cd90691-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1Bitmap = D2d.IIDFromString("{a2296057-ea42-4099-983b-539fb6505426}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1GradientStopCollection = D2d.IIDFromString("{2cd906a7-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1Brush = D2d.IIDFromString("{2cd906a8-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1BitmapBrush = D2d.IIDFromString("{2cd906aa-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1SolidColorBrush = D2d.IIDFromString("{2cd906a9-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1LinearGradientBrush = D2d.IIDFromString("{2cd906ab-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1RadialGradientBrush = D2d.IIDFromString("{2cd906ac-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1StrokeStyle = D2d.IIDFromString("{2cd9069d-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1Geometry = D2d.IIDFromString("{2cd906a1-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1RectangleGeometry = D2d.IIDFromString("{2cd906a2-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1RoundedRectangleGeometry = D2d.IIDFromString("{2cd906a3-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1EllipseGeometry = D2d.IIDFromString("{2cd906a4-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1TransformedGeometry = D2d.IIDFromString("{2cd906bb-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1SimplifiedGeometrySink = D2d.IIDFromString("{2cd9069e-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1GeometrySink = D2d.IIDFromString("{2cd9069f-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1TessellationSink = D2d.IIDFromString("{2cd906c1-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ +public static final GUID CLSID_ID2D1PathGeometry = D2d.IIDFromString("{2cd906a5-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Geometry +public static final GUID CLSID_ID2D1Mesh = D2d.IIDFromString("{2cd906c2-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Resource +public static final GUID CLSID_ID2D1Layer = D2d.IIDFromString("{2cd9069b-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Resource +public static final GUID CLSID_ID2D1DrawingStateBlock = D2d.IIDFromString("{28506e39-ebf6-46a1-bb47-fd85565ab957}"); //$NON-NLS-1$ : public ID2D1Resource +public static final GUID CLSID_ID2D1RenderTarget = D2d.IIDFromString("{2cd90694-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1Resource +public static final GUID CLSID_ID2D1BitmapRenderTarget = D2d.IIDFromString("{2cd90695-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1RenderTarget +public static final GUID CLSID_ID2D1HwndRenderTarget = D2d.IIDFromString("{2cd90698-12e2-11dc-9fed-001143a055f9}"); //$NON-NLS-1$ : public ID2D1RenderTarget +public static final GUID CLSID_ID2D1GdiInteropRenderTarget = D2d.IIDFromString("{e0db51c3-6f77-4bae-b3d5-e47509b35838}"); //$NON-NLS-1$ : public IUnknown +public static final GUID CLSID_ID2D1DCRenderTarget = D2d.IIDFromString("{1c51bc64-de61-46fd-9899-63a5d8f03950}"); //$NON-NLS-1$ : public ID2D1RenderTarget +public static final GUID CLSID_ID2D1Factory = D2d.IIDFromString("{06152247-6f50-465a-9245-118bfd3b6007}"); //$NON-NLS-1$ : public IUnknown + +public static GUID IIDFromString(String lpsz) { + int length = lpsz.length(); + char[] buffer = new char[length + 1]; + lpsz.getChars(0, length, buffer, 0); + GUID lpiid = new GUID(); + if (COM.IIDFromString(buffer, lpiid) == COM.S_OK) return lpiid; + return null; +} + +// ------------------------------------------------------------------------------------- + + +// if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 1)) {} // TEST WIN7 + +// D2D1_FACTORY_TYPE +public static final int D2D1_FACTORY_TYPE_SINGLE_THREADED = 0; +public static final int D2D1_FACTORY_TYPE_MULTI_THREADED = 1; + +// D2D1_RENDER_TARGET_TYPE +public static final int D2D1_RENDER_TARGET_TYPE_DEFAULT = 0; +public static final int D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1; +public static final int D2D1_RENDER_TARGET_TYPE_HARDWARE = 2; + +// DXGI_FORMAT +public static final int DXGI_FORMAT_UNKNOWN = 0; +public static final int DXGI_FORMAT_R32G32B32A32_TYPELESS = 1; +public static final int DXGI_FORMAT_R32G32B32A32_FLOAT = 2; +public static final int DXGI_FORMAT_R32G32B32A32_UINT = 3; +public static final int DXGI_FORMAT_R32G32B32A32_SINT = 4; +public static final int DXGI_FORMAT_R32G32B32_TYPELESS = 5; +public static final int DXGI_FORMAT_R32G32B32_FLOAT = 6; +public static final int DXGI_FORMAT_R32G32B32_UINT = 7; +public static final int DXGI_FORMAT_R32G32B32_SINT = 8; +public static final int DXGI_FORMAT_R16G16B16A16_TYPELESS = 9; +public static final int DXGI_FORMAT_R16G16B16A16_FLOAT = 10; +public static final int DXGI_FORMAT_R16G16B16A16_UNORM = 11; +public static final int DXGI_FORMAT_R16G16B16A16_UINT = 12; +public static final int DXGI_FORMAT_R16G16B16A16_SNORM = 13; +public static final int DXGI_FORMAT_R16G16B16A16_SINT = 14; +public static final int DXGI_FORMAT_R32G32_TYPELESS = 15; +public static final int DXGI_FORMAT_R32G32_FLOAT = 16; +public static final int DXGI_FORMAT_R32G32_UINT = 17; +public static final int DXGI_FORMAT_R32G32_SINT = 18; +public static final int DXGI_FORMAT_R32G8X24_TYPELESS = 19; +public static final int DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20; +public static final int DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21; +public static final int DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22; +public static final int DXGI_FORMAT_R10G10B10A2_TYPELESS = 23; +public static final int DXGI_FORMAT_R10G10B10A2_UNORM = 24; +public static final int DXGI_FORMAT_R10G10B10A2_UINT = 25; +public static final int DXGI_FORMAT_R11G11B10_FLOAT = 26; +public static final int DXGI_FORMAT_R8G8B8A8_TYPELESS = 27; +public static final int DXGI_FORMAT_R8G8B8A8_UNORM = 28; +public static final int DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29; +public static final int DXGI_FORMAT_R8G8B8A8_UINT = 30; +public static final int DXGI_FORMAT_R8G8B8A8_SNORM = 31; +public static final int DXGI_FORMAT_R8G8B8A8_SINT = 32; +public static final int DXGI_FORMAT_R16G16_TYPELESS = 33; +public static final int DXGI_FORMAT_R16G16_FLOAT = 34; +public static final int DXGI_FORMAT_R16G16_UNORM = 35; +public static final int DXGI_FORMAT_R16G16_UINT = 36; +public static final int DXGI_FORMAT_R16G16_SNORM = 37; +public static final int DXGI_FORMAT_R16G16_SINT = 38; +public static final int DXGI_FORMAT_R32_TYPELESS = 39; +public static final int DXGI_FORMAT_D32_FLOAT = 40; +public static final int DXGI_FORMAT_R32_FLOAT = 41; +public static final int DXGI_FORMAT_R32_UINT = 42; +public static final int DXGI_FORMAT_R32_SINT = 43; +public static final int DXGI_FORMAT_R24G8_TYPELESS = 44; +public static final int DXGI_FORMAT_D24_UNORM_S8_UINT = 45; +public static final int DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46; +public static final int DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47; +public static final int DXGI_FORMAT_R8G8_TYPELESS = 48; +public static final int DXGI_FORMAT_R8G8_UNORM = 49; +public static final int DXGI_FORMAT_R8G8_UINT = 50; +public static final int DXGI_FORMAT_R8G8_SNORM = 51; +public static final int DXGI_FORMAT_R8G8_SINT = 52; +public static final int DXGI_FORMAT_R16_TYPELESS = 53; +public static final int DXGI_FORMAT_R16_FLOAT = 54; +public static final int DXGI_FORMAT_D16_UNORM = 55; +public static final int DXGI_FORMAT_R16_UNORM = 56; +public static final int DXGI_FORMAT_R16_UINT = 57; +public static final int DXGI_FORMAT_R16_SNORM = 58; +public static final int DXGI_FORMAT_R16_SINT = 59; +public static final int DXGI_FORMAT_R8_TYPELESS = 60; +public static final int DXGI_FORMAT_R8_UNORM = 61; +public static final int DXGI_FORMAT_R8_UINT = 62; +public static final int DXGI_FORMAT_R8_SNORM = 63; +public static final int DXGI_FORMAT_R8_SINT = 64; +public static final int DXGI_FORMAT_A8_UNORM = 65; +public static final int DXGI_FORMAT_R1_UNORM = 66; +public static final int DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67; +public static final int DXGI_FORMAT_R8G8_B8G8_UNORM = 68; +public static final int DXGI_FORMAT_G8R8_G8B8_UNORM = 69; +public static final int DXGI_FORMAT_BC1_TYPELESS = 70; +public static final int DXGI_FORMAT_BC1_UNORM = 71; +public static final int DXGI_FORMAT_BC1_UNORM_SRGB = 72; +public static final int DXGI_FORMAT_BC2_TYPELESS = 73; +public static final int DXGI_FORMAT_BC2_UNORM = 74; +public static final int DXGI_FORMAT_BC2_UNORM_SRGB = 75; +public static final int DXGI_FORMAT_BC3_TYPELESS = 76; +public static final int DXGI_FORMAT_BC3_UNORM = 77; +public static final int DXGI_FORMAT_BC3_UNORM_SRGB = 78; +public static final int DXGI_FORMAT_BC4_TYPELESS = 79; +public static final int DXGI_FORMAT_BC4_UNORM = 80; +public static final int DXGI_FORMAT_BC4_SNORM = 81; +public static final int DXGI_FORMAT_BC5_TYPELESS = 82; +public static final int DXGI_FORMAT_BC5_UNORM = 83; +public static final int DXGI_FORMAT_BC5_SNORM = 84; +public static final int DXGI_FORMAT_B5G6R5_UNORM = 85; +public static final int DXGI_FORMAT_B5G5R5A1_UNORM = 86; +public static final int DXGI_FORMAT_B8G8R8A8_UNORM = 87; +public static final int DXGI_FORMAT_B8G8R8X8_UNORM = 88; +public static final int DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89; +public static final int DXGI_FORMAT_B8G8R8A8_TYPELESS = 90; +public static final int DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91; +public static final int DXGI_FORMAT_B8G8R8X8_TYPELESS = 92; +public static final int DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93; +public static final int DXGI_FORMAT_BC6H_TYPELESS = 94; +public static final int DXGI_FORMAT_BC6H_UF16 = 95; +public static final int DXGI_FORMAT_BC6H_SF16 = 96; +public static final int DXGI_FORMAT_BC7_TYPELESS = 97; +public static final int DXGI_FORMAT_BC7_UNORM = 98; +public static final int DXGI_FORMAT_BC7_UNORM_SRGB = 99; +public static final int DXGI_FORMAT_AYUV = 100; +public static final int DXGI_FORMAT_Y410 = 101; +public static final int DXGI_FORMAT_Y416 = 102; +public static final int DXGI_FORMAT_NV12 = 103; +public static final int DXGI_FORMAT_P010 = 104; +public static final int DXGI_FORMAT_P016 = 105; +public static final int DXGI_FORMAT_420_OPAQUE = 106; +public static final int DXGI_FORMAT_YUY2 = 107; +public static final int DXGI_FORMAT_Y210 = 108; +public static final int DXGI_FORMAT_Y216 = 109; +public static final int DXGI_FORMAT_NV11 = 110; +public static final int DXGI_FORMAT_AI44 = 111; +public static final int DXGI_FORMAT_IA44 = 112; +public static final int DXGI_FORMAT_P8 = 113; +public static final int DXGI_FORMAT_A8P8 = 114; +public static final int DXGI_FORMAT_B4G4R4A4_UNORM = 115; +//public static final int DXGI_FORMAT_FORCE_UINT = 0xffffffffUL; + +// D2D1_ALPHA_MODE +public static final int D2D1_ALPHA_MODE_UNKNOWN = 0; +public static final int D2D1_ALPHA_MODE_PREMULTIPLIED = 1; +public static final int D2D1_ALPHA_MODE_STRAIGHT = 2; +public static final int D2D1_ALPHA_MODE_IGNORE = 3; + +// D2D1_RENDER_TARGET_USAGE +public static final int D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000; +public static final int D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001; +public static final int D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002; + +// D2D1_DC_INITIALIZE_MODE +public static final int D2D1_DC_INITIALIZE_MODE_COPY = 0; +public static final int D2D1_DC_INITIALIZE_MODE_CLEAR = 1; + +// D2D1_FEATURE_LEVEL +public static final int D2D1_FEATURE_LEVEL_DEFAULT = 0; +//public static final int D2D1_FEATURE_LEVEL_9 = D3D10_FEATURE_LEVEL_9_1; +//public static final int D2D1_FEATURE_LEVEL_10 = D3D10_FEATURE_LEVEL_10_0; + +// D2D1_CAP_STYLE +public static final int D2D1_CAP_STYLE_FLAT = 0; +public static final int D2D1_CAP_STYLE_SQUARE = 1; +public static final int D2D1_CAP_STYLE_ROUND = 2; +public static final int D2D1_CAP_STYLE_TRIANGLE = 3; + +// D2D1_LINE_JOIN +public static final int D2D1_LINE_JOIN_MITER = 0; +public static final int D2D1_LINE_JOIN_BEVEL = 1; +public static final int D2D1_LINE_JOIN_ROUND = 2; +public static final int D2D1_LINE_JOIN_MITER_OR_BEVEL = 3; + +// D2D1_DASH_STYLE +public static final int D2D1_DASH_STYLE_SOLID = 0; +public static final int D2D1_DASH_STYLE_DASH = 1; +public static final int D2D1_DASH_STYLE_DOT = 2; +public static final int D2D1_DASH_STYLE_DASH_DOT = 3; +public static final int D2D1_DASH_STYLE_DASH_DOT_DOT = 4; +public static final int D2D1_DASH_STYLE_CUSTOM = 5; + +// D2D1_ANTIALIAS_MODE +public static final int D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0; +public static final int D2D1_ANTIALIAS_MODE_ALIASED = 1; + +// D2D1_TEXT_ANTIALIAS_MODE +public static final int D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0; +public static final int D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1; +public static final int D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2; +public static final int D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3; + +// D2D1_DRAW_TEXT_OPTIONS +public static final int D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001; +public static final int D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002; +public static final int D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000; + + +// -------------------------------------------------------------------------------------- + +public static final ID2D1Factory factory() { + long /*int*/ factory[] = new long /*int*/[1]; + factory[0] = 0; +// long /*int*/ rc = D2d._D2D1CreateFactory(D2d.D2D1_FACTORY_TYPE_SINGLE_THREADED, null, factory); + long /*int*/ rc = D2d.D2D1CreateFactory(factory); + return rc == 0 ? new ID2D1Factory(factory[0]) : null; +} + + +/* sizeof's */ +public static final native int D2D1_PIXEL_FORMAT_sizeof(); +public static final native int D2D1_RENDER_TARGET_PROPERTIES_sizeof(); +public static final native int D2D1_COLOR_F_sizeof(); +public static final native int D2D1_POINT_2F_sizeof(); +public static final native int D2D1_RECT_F_sizeof(); +public static final native int D2D1_STROKE_STYLE_PROPERTIES_sizeof(); +public static final native int D2D1_MATRIX_3X2_F_sizeof(); +public static final native int D2D1_BRUSH_PROPERTIES_sizeof(); +public static final native int D2D1_SIZE_F_sizeof(); +public static final native int D2D1_ROUNDED_RECT_sizeof(); + + +// -------------------------------------------------------------------------------------- + +// +///* VTable calls */ +//public static native int VtblCall(int fnNumber, long /*int*/ ppVtbl, D2D1_RENDER_TARGET_PROPERTIES arg0, long /*int*/[] arg1); +// + +//-------------------------------------------------------------------------------------- + +/** @method flags=cpp no_gen */ +public static final native long /*int*/ D2D1CreateFactory(long /*int*/[] result); + +/** + * @method flags=cpp + * @param This cast=(ID2D1Factory *) + * @paran renderTargetProperties cast=(D2D1_RENDER_TARGET_PROPERTIES), flags=no_out + * @param dcRenderTarget cast=(ID2D1DCRenderTarget**), flags=no_in + */ +public static final native int ID2D1Factory_CreateDCRenderTarget(long /*int*/ This, D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties, long /*int*/ [] dcRenderTarget); + +/** + * @method flags=cpp + * @param This cast=(ID2D1Factory *) + * @paran strokeStyleProperties cast=(CONST D2D1_STROKE_STYLE_PROPERTIES*), flags=no_out + * @param dashes cast=(CONST FLOAT*) + * @param strokeStyle cast=(ID2D1StrokeStyle**), flags=no_in + */ +public static final native int ID2D1Factory_CreateStrokeStyle(long /*int*/ This, D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties, float[] dashes, int dashesCount, long /*int*/ [] strokeStyle); + + +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + */ +public static final native void ID2D1RenderTarget_BeginDraw(long /*int*/ This); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + */ +public static final native void ID2D1RenderTarget_EndDraw(long /*int*/ This); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + */ +public static final native void ID2D1RenderTarget_Clear(long /*int*/ This, D2D1_COLOR_F color); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + */ +public static final native void ID2D1RenderTarget_SetTransform(long /*int*/ This, D2D1_MATRIX_3X2_F transform); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param point0 flags=struct + * @param point1 flags=struct + * @param brush cast=(ID2D1Brush *), flags=no_out + * @param strokeWidth cast=(FLOAT) + * @param strokeStyle cast=(ID2D1StrokeStyle *) + */ +public static final native void ID2D1RenderTarget_DrawLine(long /*int*/ This, D2D1_POINT_2F point0, D2D1_POINT_2F point1, long /*int*/ brush, float strokeWidth, long /*int*/ strokeStyle); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param brush cast=(ID2D1Brush *), flags=no_out + * @param strokeWidth cast=(FLOAT) + * @param strokeStyle cast=(ID2D1StrokeStyle *) + */ +public static final native void ID2D1RenderTarget_DrawRectangle(long /*int*/ This, D2D1_RECT_F rect, long /*int*/ brush, float strokeWidth, long /*int*/ strokeStyle); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param brush cast=(ID2D1Brush *), flags=no_out + */ +public static final native void ID2D1RenderTarget_FillRectangle(long /*int*/ This, D2D1_RECT_F rect, long /*int*/ brush); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param roundedRect cast=(D2D1_ROUNDED_RECT *), flags=no_out + * @param brush cast=(ID2D1Brush *), flags=no_out + * @param strokeStyle cast=(ID2D1StrokeStyle *), flags=no_out + */ +public static final native void ID2D1RenderTarget_DrawRoundedRectangle(long /*int*/ This, D2D1_ROUNDED_RECT roundedRect, long /*int*/ brush, float strokeWidth, long /*int*/ strokeStyle); + +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param string cast=(const WCHAR *) + * @param stringLength cast=(UINT) + * @param textFormat cast=(IDWriteTextFormat*) + * @param defaultForegroundBrush cast=(ID2D1Brush *) + * @param options cast=(D2D1_DRAW_TEXT_OPTIONS) + * @param measuringMode cast=(DWRITE_MEASURING_MODE) + */ +public static final native void ID2D1RenderTarget_DrawText(long /*int*/ This, char[] string, int stringLength, long /*int*/ textFormat, D2D1_RECT_F layoutRect, long /*int*/defaultForegroundBrush, int options, int measuringMode); + +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param brushProperties flags=no_out + * @param solidColorBrush cast=(ID2D1SolidColorBrush**), flags=no_in + */ +public static final native int ID2D1RenderTarget_CreateSolidColorBrush(long /*int*/ This, D2D1_COLOR_F color, D2D1_BRUSH_PROPERTIES brushProperties, long /*int*/ [] solidColorBrush); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param mode cast=(D2D1_ANTIALIAS_MODE) + */ +public static final native void ID2D1RenderTarget_SetAntialiasMode(long /*int*/ This, int mode); +/** + * @method flags=cpp + * @param This cast=(ID2D1RenderTarget *) + * @param mode cast=(D2D1_TEXT_ANTIALIAS_MODE) + */ +public static final native void ID2D1RenderTarget_SetTextAntialiasMode(long /*int*/ This, int mode); + + +/** + * @method flags=cpp + * @param This cast=(ID2D1DCRenderTarget *) + * @param hDC cast=(HDC) + * @param pSubRect cast=(CONST RECT *) + */ +public static final native int ID2D1DCRenderTarget_BindDC(long /*int*/ This, long /*int*/ hDC, RECT pSubRect); + + +/** + * @method flags=cpp + * @param This cast=(ID2D1HwndRenderTarget *) + */ +public static final native long /*int*/ ID2D1HwndRenderTarget_GetHwnd(long /*int*/ This); + + +/** + * @method flags=cpp + * @param This cast=(ID2D1GdiInteropRenderTarget *) + * @param mode cast=(D2D1_DC_INITIALIZE_MODE) + * @param hdc cast=(HDC *) + */ +public static final native int ID2D1GdiInteropRenderTarget_GetDC(long /*int*/ This, int mode, long /*int*/ [] hdc); +/** + * @method flags=cpp + * @param This cast=(ID2D1GdiInteropRenderTarget *) + */ +public static final native int ID2D1GdiInteropRenderTarget_ReleaseDC(long /*int*/ This, RECT rect); + + +/** + * @method flags=cpp + * @param This cast=(ID2D1Brush*) + */ +public static native void ID2D1Brush_SetOpacity(long /*int*/ This, float opacity); +/** + * @method flags=cpp no_gen + * @param This cast=(ID2D1Brush*) + * @param opacity cast=(FLOAT**) + */ +public static native void ID2D1Brush_GetOpacity(long /*int*/ This, float[] opacity); + + +/** + * @method flags=cpp + * @param This cast=(ID2D1SolidColorBrush*) + * @param color flags=no_out + */ +public static native void ID2D1SolidColorBrush_SetColor(long /*int*/ This, D2D1_COLOR_F color); +/** + * @method flags=cpp no_gen + * @param This cast=(ID2D1SolidColorBrush*) + * @param color flags=no_in + */ +public static native void ID2D1SolidColorBrush_GetColor(long /*int*/ This, D2D1_COLOR_F color); + + +/** + * @param angle cast=(FLOAT) + * @param center flags=struct + * @param rotation cast=(D2D1_MATRIX_3X2_F*) + */ +public static final native void D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F rotation); + + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Bitmap.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Bitmap.java new file mode 100755 index 0000000..908772b --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Bitmap.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** jniclass flags=cpp */ +public class ID2D1Bitmap extends ID2D1Resource { + +public ID2D1Bitmap(long /*int*/ address) { + super(address); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1BitmapBrush.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1BitmapBrush.java new file mode 100755 index 0000000..beb91a9 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1BitmapBrush.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** jniclass flags=cpp */ +public class ID2D1BitmapBrush extends ID2D1Brush { + + /** jniclass flags=cpp */ +public ID2D1BitmapBrush(long /*int*/ address) { + super(address); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Brush.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Brush.java new file mode 100755 index 0000000..05660b0 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Brush.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** jniclass flags=cpp */ +public class ID2D1Brush extends ID2D1Resource { + +public ID2D1Brush(long /*int*/ address) { + super(address); +} + +public void SetOpacity(float opacity) { + D2d.ID2D1Brush_SetOpacity(address, opacity); +} + +public float GetOpacity() { + float[] opacity = new float[1]; + D2d.ID2D1Brush_GetOpacity(address, opacity); + return opacity[0]; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1DCRenderTarget.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1DCRenderTarget.java new file mode 100755 index 0000000..0b3dada --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1DCRenderTarget.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** jniclass flags=cpp */ +public class ID2D1DCRenderTarget extends ID2D1RenderTarget { + +public ID2D1DCRenderTarget(long /*int*/ address) { + super(address); +} + +public final int BindDC(long /*int*/ hDC, RECT pSubRect) { + return D2d.ID2D1DCRenderTarget_BindDC(address, hDC, pSubRect); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Factory.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Factory.java new file mode 100755 index 0000000..21bdda1 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Factory.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class ID2D1Factory extends IUnknown { + +/** jniclass flags=cpp */ +public ID2D1Factory(long /*int*/ address) { + super(address); +} +public ID2D1DCRenderTarget CreateDCRenderTarget(D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties) { + long /*int*/ dcRenderTarget[] = new long /*int*/[1]; + dcRenderTarget[0] = 0; + int rc = D2d.ID2D1Factory_CreateDCRenderTarget(address, renderTargetProperties, dcRenderTarget); + return rc == 0 ? new ID2D1DCRenderTarget(dcRenderTarget[0]) : null; +} + +public ID2D1StrokeStyle CreateStrokeStyle(D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties, float dashes, int dashesCount) { + long /*int*/ strokeStyle[] = new long /*int*/[1]; + strokeStyle[0] = 0; + float ddashes[] = new float[1]; + ddashes[0] = dashes; + int rc = D2d.ID2D1Factory_CreateStrokeStyle(address, strokeStyleProperties, ddashes, dashesCount, strokeStyle); + return rc == 0 ? new ID2D1StrokeStyle(strokeStyle[0]) : null; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1GdiInteropRenderTarget.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1GdiInteropRenderTarget.java new file mode 100755 index 0000000..2806338 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1GdiInteropRenderTarget.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class ID2D1GdiInteropRenderTarget extends IUnknown { + +public ID2D1GdiInteropRenderTarget(long /*int*/ address) { + super(address); +} + +public long /*int*/ GetDC(int mode) { + long /*int*/ hdc[] = new long /*int*/ [1]; + int rc = D2d.ID2D1GdiInteropRenderTarget_GetDC(address, mode, hdc); + return rc == 0 ? hdc[0] : 0; +} + +public int ReleaseDC() { + return D2d.ID2D1GdiInteropRenderTarget_ReleaseDC(address, null); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1HwndRenderTarget.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1HwndRenderTarget.java new file mode 100755 index 0000000..32c0e85 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1HwndRenderTarget.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class ID2D1HwndRenderTarget extends ID2D1RenderTarget { + +/** jniclass flags=cpp */ +public ID2D1HwndRenderTarget(int address) { + super(address); +} + +public long /*int*/ GetHwndD() { + return D2d.ID2D1HwndRenderTarget_GetHwnd(address); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Layer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Layer.java new file mode 100755 index 0000000..1e6df35 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Layer.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** jniclass flags=cpp */ +public class ID2D1Layer extends ID2D1Resource { + +public ID2D1Layer(long /*int*/ address) { + super(address); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1RenderTarget.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1RenderTarget.java new file mode 100755 index 0000000..2379f86 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1RenderTarget.java @@ -0,0 +1,138 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +import org.eclipse.swt.internal.dw.DW; +import org.eclipse.swt.internal.dw.IDWriteTextFormat; + +/** @jniclass flags=cpp */ +public class ID2D1RenderTarget extends ID2D1Resource { + +public ID2D1RenderTarget(long /*int*/ address) { + super(address); +} + +public final void BeginDraw() { + D2d.ID2D1RenderTarget_BeginDraw(address); +} + +public final void Clear(D2D1_COLOR_F color) { + D2d.ID2D1RenderTarget_Clear(address, color); +} + +public final void EndDraw() { + D2d.ID2D1RenderTarget_EndDraw(address); +} + +public final void SetAntialiasMode(int mode) { + D2d.ID2D1RenderTarget_SetAntialiasMode(address, mode); +} + +public final void SetTextAntialiasMode(int mode) { + D2d.ID2D1RenderTarget_SetTextAntialiasMode(address, mode); +} + +public final D2D1_SIZE_F GetSize() { + D2D1_SIZE_F size = new D2D1_SIZE_F(); + ID2D1RenderTarget_GetSize(address, size); + return size; +} + +public final ID2D1SolidColorBrush CreateSolidColorBrush(D2D1_COLOR_F color, D2D1_BRUSH_PROPERTIES brushProperties) { + long /*int*/ solidColorBrush[] = new long /*int*/[1]; + solidColorBrush[0] = 0; + int rc = D2d.ID2D1RenderTarget_CreateSolidColorBrush(address, color, brushProperties, solidColorBrush); + return rc == 0 ? new ID2D1SolidColorBrush(solidColorBrush[0]) : null; +} + +public final void SetTransform(D2D1_MATRIX_3X2_F transform) { + D2d.ID2D1RenderTarget_SetTransform(address, transform); +} + +public final void DrawLine(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush brush, float lineWidth) { + D2d.ID2D1RenderTarget_DrawLine(address, point0, point1, brush.address, 1, 0); +} + +public final void DrawLine(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush brush, float lineWidth, float strokeWidth, ID2D1StrokeStyle strokeStyle) { + D2d.ID2D1RenderTarget_DrawLine(address, point0, point1, brush.address, strokeWidth, strokeStyle.address); +} + +public final void DrawRectangle(D2D1_RECT_F rect, ID2D1Brush brush, float lineWidth) { + D2d.ID2D1RenderTarget_DrawRectangle(address, rect, brush.address, 1, 0); +} + +public final void DrawRectangle(D2D1_RECT_F rect, ID2D1Brush brush, float lineWidth, float strokeWidth, ID2D1StrokeStyle strokeStyle) { + D2d.ID2D1RenderTarget_DrawRectangle(address, rect, brush.address, strokeWidth, strokeStyle.address); +} + +public final void FillRectangle(D2D1_RECT_F rect, ID2D1Brush brush) { + D2d.ID2D1RenderTarget_FillRectangle(address, rect, brush.address); +} + +public final void DrawRoundedRectangle(D2D1_ROUNDED_RECT roundedRect, ID2D1Brush brush) { + D2d.ID2D1RenderTarget_DrawRoundedRectangle(address, roundedRect, brush.address, 1, 0); +} + +public final void DrawRoundedRectangle(D2D1_ROUNDED_RECT roundedRect, ID2D1Brush brush, float strokeWidth, ID2D1StrokeStyle strokeStyle) { + D2d.ID2D1RenderTarget_DrawRoundedRectangle(address, roundedRect, brush.address, strokeWidth, strokeStyle.address); +} + +// STDMETHOD_(void, DrawRoundedRectangle)( +// __in CONST D2D1_ROUNDED_RECT *roundedRect, +// __in ID2D1Brush *brush, +// FLOAT strokeWidth = 1.0f, +// __in_opt ID2D1StrokeStyle *strokeStyle = NULL +// ) PURE; +// +// STDMETHOD_(void, FillRoundedRectangle)( +// __in CONST D2D1_ROUNDED_RECT *roundedRect, +// __in ID2D1Brush *brush +// ) PURE; +// +// STDMETHOD_(void, DrawEllipse)( +// __in CONST D2D1_ELLIPSE *ellipse, +// __in ID2D1Brush *brush, +// FLOAT strokeWidth = 1.0f, +// __in_opt ID2D1StrokeStyle *strokeStyle = NULL +// ) PURE; +// +// STDMETHOD_(void, FillEllipse)( +// __in CONST D2D1_ELLIPSE *ellipse, +// __in ID2D1Brush *brush +// ) PURE; +// +// STDMETHOD_(void, DrawGeometry)( +// __in ID2D1Geometry *geometry, +// __in ID2D1Brush *brush, +// FLOAT strokeWidth = 1.0f, +// __in_opt ID2D1StrokeStyle *strokeStyle = NULL +// ) PURE; +// +// STDMETHOD_(void, FillGeometry)( +// __in ID2D1Geometry *geometry, +// __in ID2D1Brush *brush, + +public final void DrawText(char[] string, int stringLength, IDWriteTextFormat textFormat, D2D1_RECT_F layoutRect, ID2D1Brush defaultForegroundBrush) { + D2d.ID2D1RenderTarget_DrawText(address, string, stringLength, textFormat.getAddress(), layoutRect, defaultForegroundBrush.getAddress(), D2d.D2D1_DRAW_TEXT_OPTIONS_NONE, DW.DWRITE_MEASURING_MODE_NATURAL); +} + +public final void DrawText(char[] string, int stringLength, IDWriteTextFormat textFormat, D2D1_RECT_F layoutRect, ID2D1Brush defaultForegroundBrush, int options, int measuringMode) { + D2d.ID2D1RenderTarget_DrawText(address, string, stringLength, textFormat.getAddress(), layoutRect, defaultForegroundBrush.getAddress(), options, measuringMode); +} + + +/** + * @method flags=cpp no_gen + * @param This cast=(ID2D1RenderTarget *) + */ +public static final native void ID2D1RenderTarget_GetSize(long /*int*/ This, D2D1_SIZE_F size); + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Resource.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Resource.java new file mode 100755 index 0000000..66eca4c --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1Resource.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +import org.eclipse.swt.internal.ole.win32.COM; + +/** jniclass flags=cpp */ +public class ID2D1Resource extends IUnknown { + +public ID2D1Resource(long /*int*/ address) { + super(address); +} + +public ID2D1Factory GetFactory() { + long /*int*/ factory[] = new long /*int*/[1]; + long /*int*/ rc = COM.VtblCall(3, address, factory); + return rc != 0 ? new ID2D1Factory(factory[0]) : null; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1SolidColorBrush.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1SolidColorBrush.java new file mode 100755 index 0000000..d196d18 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1SolidColorBrush.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +/** jniclass flags=cpp */ +public class ID2D1SolidColorBrush extends ID2D1Brush { + +public ID2D1SolidColorBrush(long /*int*/ address) { + super(address); +} + +public void SetColor(D2D1_COLOR_F color) { + D2d.ID2D1SolidColorBrush_SetColor(address, color); +} + +public D2D1_COLOR_F GetColor() { + D2D1_COLOR_F color = new D2D1_COLOR_F(); + D2d.ID2D1SolidColorBrush_GetColor(address, color); + return color; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1StrokeStyle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1StrokeStyle.java new file mode 100755 index 0000000..aeefeaa --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/ID2D1StrokeStyle.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class ID2D1StrokeStyle extends ID2D1Resource { + +public ID2D1StrokeStyle(long /*int*/ address) { + super(address); +} + +//STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)( +// ) CONST PURE; +// +//STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)( +// ) CONST PURE; +// +//STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)( +// ) CONST PURE; +// +//STDMETHOD_(FLOAT, GetMiterLimit)( +// ) CONST PURE; +// +//STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)( +// ) CONST PURE; +// +//STDMETHOD_(FLOAT, GetDashOffset)( +// ) CONST PURE; +// +//STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)( +// ) CONST PURE; +// +//STDMETHOD_(UINT32, GetDashesCount)( +// ) CONST PURE; +// +// +//// +//// Returns the dashes from the object into a user allocated array. The user must +//// call GetDashesCount to retrieve the required size. +//// +//STDMETHOD_(void, GetDashes)( +// __out_ecount(dashesCount) FLOAT *dashes, +// UINT dashesCount +// ) CONST PURE; +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/IUnknown.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/IUnknown.java new file mode 100755 index 0000000..eea7df0 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/IUnknown.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +import org.eclipse.swt.internal.ole.win32.*; + +public class IUnknown +{ +long /*int*/ address; +public IUnknown(long /*int*/ address) { + this.address = address; +} +public int AddRef() { + return COM.VtblCall(1, address); +} +public long /*int*/ getAddress() { + return address; +} +public int QueryInterface(GUID riid, long /*int*/[] ppvObject) { + return COM.VtblCall(0, address, riid, ppvObject); +} +public int Release() { + return COM.VtblCall(2, address); +} + +public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("[").append(address).append("]"); + return sb.toString(); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/RECT.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/RECT.java new file mode 100755 index 0000000..2e1bfe8 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/d2d/RECT.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.d2d; + +public class RECT { + public int left; + public int top; + public int right; + public int bottom; +// public static final int sizeof = D2d.RECT_sizeof (); +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DW.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DW.java new file mode 100755 index 0000000..03c8f7b --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DW.java @@ -0,0 +1,160 @@ +/******************************************************************************* + * Copyright (c) 2000, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.internal.dw; + +import org.eclipse.swt.internal.*; +import org.eclipse.swt.internal.d2d.*; +import org.eclipse.swt.internal.ole.win32.*; +import org.eclipse.swt.internal.ole.win32.IUnknown; +import org.eclipse.swt.internal.win32.OS; + +/** @jniclass flags=cpp */ +public class DW extends C { + + static { + Library.loadLibrary ("swt-d2d"); //$NON-NLS-1$ + } + +public static final IDWriteFactory DWriteCreateFactory() { + GUID iid = DW.IDWriteFactory; + long /*int*/ factory[] = new long /*int*/[1]; + factory[0] = 0; + byte[] refiid = new byte[GUID.sizeof]; + OS.IIDFromString ((iid.toString () + '\0').toCharArray (), refiid); + long /*int*/ rc = DW.DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, refiid, factory); + return rc == 0 ? new IDWriteFactory(factory[0]) : null; +} + +//-------------------------------------------------------------------------------------- + +public static final GUID IDWriteTextFormat = IIDFromString("{9c906818-31d7-4fd3-a151-7c5e225db55a}"); //$NON-NLS-1$ +public static final GUID IDWriteTypography = IIDFromString("{55f1112b-1dc2-4b3c-9541-f46894ed85b6}"); //$NON-NLS-1$ +public static final GUID IDWriteNumberSubstitution = IIDFromString("{14885CC9-BAB0-4f90-B6ED-5C366A2CD03D}"); //$NON-NLS-1$ +public static final GUID IDWriteTextAnalysisSource = IIDFromString("{688e1a58-5094-47c8-adc8-fbcea60ae92b}"); //$NON-NLS-1$ +public static final GUID IDWriteTextAnalysisSink = IIDFromString("{5810cd44-0ca0-4701-b3fa-bec5182ae4f6}"); //$NON-NLS-1$ +public static final GUID IDWriteTextAnalyzer = IIDFromString("{b7e6163e-7f46-43b4-84b3-e4e6249c365d}"); //$NON-NLS-1$ +public static final GUID IDWriteInlineObject = IIDFromString("{8339FDE3-106F-47ab-8373-1C6295EB10B3}"); //$NON-NLS-1$ +public static final GUID IDWritePixelSnapping = IIDFromString("{eaf3a2da-ecf4-4d24-b644-b34f6842024b]"); //$NON-NLS-1$ +public static final GUID IDWriteTextRenderer = IIDFromString("{ef8a8135-5cc6-45fe-8825-c5a0724eb819}"); //$NON-NLS-1$ +public static final GUID IDWriteTextLayout = IIDFromString("{53737037-6d14-410b-9bfe-0b182bb70961}"); //$NON-NLS-1$ +public static final GUID IDWriteBitmapRenderTarget = IIDFromString("{5e5a32a3-8dff-4773-9ff6-0696eab77267}"); //$NON-NLS-1$ +public static final GUID IDWriteGdiInterop = IIDFromString("{1edd9491-9853-4299-898f-6432983b6f3a}"); //$NON-NLS-1$ +public static final GUID IDWriteGlyphRunAnalysis = IIDFromString("{7d97dbf7-e085-42d4-81e3-6a883bded118}"); //$NON-NLS-1$ +public static final GUID IDWriteFactory = IIDFromString("{b859ee5a-d838-4b5b-a2e8-1adc7d93db48}"); //$NON-NLS-1$ + +private static GUID IIDFromString(String lpsz) { + int length = lpsz.length(); + char[] buffer = new char[length + 1]; + lpsz.getChars(0, length, buffer, 0); + GUID lpiid = new GUID(); + if (COM.IIDFromString(buffer, lpiid) == COM.S_OK) return lpiid; + return null; +} + +//-------------------------------------------------------------------------------------- + +// DWRITE_FACTORY_TYPE +public static final int DWRITE_FACTORY_TYPE_SHARED = 0; +public static final int DWRITE_FACTORY_TYPE_ISOLATED = 1; + +// DWRITE_FONT_WEIGHT +public static final int DWRITE_FONT_WEIGHT_THIN = 100; +public static final int DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200; +public static final int DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200; +public static final int DWRITE_FONT_WEIGHT_LIGHT = 300; +public static final int DWRITE_FONT_WEIGHT_SEMILIGHT = 350; +public static final int DWRITE_FONT_WEIGHT_NORMAL = 400; +public static final int DWRITE_FONT_WEIGHT_REGULAR = 400; +public static final int DWRITE_FONT_WEIGHT_MEDIUM = 500; +public static final int DWRITE_FONT_WEIGHT_DEMI_BOLD = 600; +public static final int DWRITE_FONT_WEIGHT_SEMI_BOLD = 600; +public static final int DWRITE_FONT_WEIGHT_BOLD = 700; +public static final int DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800; +public static final int DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800; +public static final int DWRITE_FONT_WEIGHT_BLACK = 900; +public static final int DWRITE_FONT_WEIGHT_HEAVY = 900; +public static final int DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950; +public static final int DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950; + +// DWRITE_FONT_STYLE +public static final int DWRITE_FONT_STYLE_NORMAL = 0; +public static final int DWRITE_FONT_STYLE_OBLIQUE = 1; +public static final int DWRITE_FONT_STYLE_ITALIC = 2; + +// DWRITE_FONT_STRETCH +public static final int DWRITE_FONT_STRETCH_UNDEFINED = 0; +public static final int DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1; +public static final int DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2; +public static final int DWRITE_FONT_STRETCH_CONDENSED = 3; +public static final int DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4; +public static final int DWRITE_FONT_STRETCH_NORMAL = 5; +public static final int DWRITE_FONT_STRETCH_MEDIUM = 5; +public static final int DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6; +public static final int DWRITE_FONT_STRETCH_EXPANDED = 7; +public static final int DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8; +public static final int DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9; + +// DWRITE_TEXT_ALIGNMENT +public static final int DWRITE_TEXT_ALIGNMENT_LEADING = 0; +public static final int DWRITE_TEXT_ALIGNMENT_TRAILING = 1; +public static final int DWRITE_TEXT_ALIGNMENT_CENTER = 2; +public static final int DWRITE_TEXT_ALIGNMENT_JUSTIFIED = 3; + +// DWRITE_PARAGRAPH_ALIGNMENT +public static final int DWRITE_PARAGRAPH_ALIGNMENT_NEAR = 0; +public static final int DWRITE_PARAGRAPH_ALIGNMENT_FAR = 1; +public static final int DWRITE_PARAGRAPH_ALIGNMENT_CENTER = 2; + +// DWRITE_MEASURING_MODE +public static final int DWRITE_MEASURING_MODE_NATURAL = 0; +public static final int DWRITE_MEASURING_MODE_GDI_CLASSIC = 1; +public static final int DWRITE_MEASURING_MODE_GDI_NATURAL = 2; + +//-------------------------------------------------------------------------------------- + +/** + * @method flags=no_gen + * @param factoryType cast=(DWRITE_FACTORY_TYPE) + * @param iid cast=(GUID*), flags=no_out + * @param factory cast=(IUnknown**) + */ +public static final native int DWriteCreateFactory(int factoryType, byte[] iid, long /*int*/ [] factory); + + +/** + * @method flags=cpp + * @param This cast=(IDWriteFactory*) + * @param fontFamilyName cast=(const WCHAR *) + * @param fontCollection cast=(IDWriteFontCollection*) + * @param fontWeight cast=(DWRITE_FONT_WEIGHT) + * @param fontStyle cast=(DWRITE_FONT_STYLE) + * @param fontStretch cast=(DWRITE_FONT_STRETCH) + * @param localeName cast=(const WCHAR *) + * @param textFormat cast=(IDWriteTextFormat**), flags=no_in + */ +public static final native int IDWriteFactory_CreateTextFormat(long /*int*/ This, char[] fontFamilyName, long /*int*/ fontCollection, int fontWeight, int fontStyle, int fontStretch, float fontSize, char[] localeName, long /*int*/[] textFormat); + + +/** + * @method flags=cpp + * @param This cast=(IDWriteTextFormat*) + * @param textAlignment cast=(DWRITE_TEXT_ALIGNMENT) + */ +public static final native int IDWriteTextFormat_SetTextAlignment(long /*int*/ This, int textAlignment); +/** + * @method flags=cpp + * @param This cast=(IDWriteTextFormat*) + * @param paragraphAlignment cast=(DWRITE_PARAGRAPH_ALIGNMENT) + */ +public static final native int IDWriteTextFormat_SetParagraphAlignment(long /*int*/ This, int paragraphAlignment); + + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DWRITE_TEXT_RANGE.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DWRITE_TEXT_RANGE.java new file mode 100755 index 0000000..d3ebcf2 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/DWRITE_TEXT_RANGE.java @@ -0,0 +1,8 @@ +/** + * + */ +package org.eclipse.swt.internal.dw; + +public class DWRITE_TEXT_RANGE { + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFactory.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFactory.java new file mode 100755 index 0000000..48d549d --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFactory.java @@ -0,0 +1,38 @@ +/** + * + */ +package org.eclipse.swt.internal.dw; + +import org.eclipse.swt.internal.ole.win32.IUnknown; + +public class IDWriteFactory extends IUnknown { + +public IDWriteFactory(long /*int*/ address) { + super(address); +} + +public IDWriteTextFormat CreateTextFormat(String fontFamilyName, IDWriteFontCollection fontCollection, int fontWeight, int fontStyle,int fontStretch, float fontSize, String localeName) { + char[]buffer1 = null; + if (fontFamilyName != null) { + int length = fontFamilyName.length(); + buffer1 = new char [length]; + fontFamilyName.getChars(0, length, buffer1, 0); + } + + char[]buffer2 = null; + if (localeName != null) { + int length = localeName.length(); + buffer2 = new char [length]; + localeName.getChars(0, length, buffer2, 0); + } + return CreateTextFormat(buffer1, fontCollection, fontWeight, fontStyle, fontStretch, fontSize, buffer2); +} + +public IDWriteTextFormat CreateTextFormat(char[] fontFamilyName, IDWriteFontCollection fontCollection, int fontWeight, int fontStyle,int fontStretch, float fontSize, char[]localeName) { + long /*int*/[] textFormat = new long /*int*/[1]; + textFormat[0] = 0; + int rc = DW.IDWriteFactory_CreateTextFormat(getAddress(), fontFamilyName, fontCollection != null ? fontCollection.getAddress() : 0, fontWeight, fontStyle, fontStretch, fontSize, localeName, textFormat); + return rc == 0 ? new IDWriteTextFormat(textFormat[0]) : null; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFontCollection.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFontCollection.java new file mode 100755 index 0000000..93962fd --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteFontCollection.java @@ -0,0 +1,14 @@ +/** + * + */ +package org.eclipse.swt.internal.dw; + +import org.eclipse.swt.internal.ole.win32.IUnknown; + +public class IDWriteFontCollection extends IUnknown { + +public IDWriteFontCollection(long /*int*/ address) { + super(address); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextFormat.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextFormat.java new file mode 100755 index 0000000..bd944cd --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextFormat.java @@ -0,0 +1,22 @@ +/** + * + */ +package org.eclipse.swt.internal.dw; + +import org.eclipse.swt.internal.ole.win32.IUnknown; + +public class IDWriteTextFormat extends IUnknown { + +public IDWriteTextFormat(long /*int*/ address) { + super(address); +} + +public int SetTextAlignment(int dwriteTextAlignmentCenter) { + return DW.IDWriteTextFormat_SetTextAlignment(getAddress(), dwriteTextAlignmentCenter); +} + +public int SetParagraphAlignment(int dwriteParagraphAlignmentCenter) { + return DW.IDWriteTextFormat_SetParagraphAlignment(getAddress(), dwriteParagraphAlignmentCenter); +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextLayout.java new file mode 100755 index 0000000..e8d786f --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/dw/IDWriteTextLayout.java @@ -0,0 +1,14 @@ +/** + * + */ +package org.eclipse.swt.internal.dw; + +import org.eclipse.swt.internal.ole.win32.IUnknown; + +public class IDWriteTextLayout extends IUnknown { + +public IDWriteTextLayout(long /*int*/ address) { + super(address); +} + +} -- 1.7.9