diff options
author | Silenio Quarti <silenio> | 2005-05-05 19:46:33 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-05-05 19:46:33 +0000 |
commit | e3bb881b0cdd2db55a9a19f1b164cd7160de873a (patch) | |
tree | 262ffa6dd319c19d77a44062f10c38d99e1d30c0 | |
parent | 7d70dc5f4a84a927b2a2132942009b6f3f790ccf (diff) | |
download | eclipse.platform.swt-e3bb881b0cdd2db55a9a19f1b164cd7160de873a.tar.gz eclipse.platform.swt-e3bb881b0cdd2db55a9a19f1b164cd7160de873a.tar.xz eclipse.platform.swt-e3bb881b0cdd2db55a9a19f1b164cd7160de873a.zip |
93759
7 files changed, 71 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties index 96f7703e52..322959e6b1 100644 --- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties +++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.gdip.Gdip.properties @@ -288,6 +288,10 @@ Gdip_Graphics_FillRectangle_3=cast=INT Gdip_Graphics_FillRectangle_4=cast=INT Gdip_Graphics_FillRectangle_5=cast=INT +Gdip_Graphics_Flush=flags=cpp +Gdip_Graphics_Flush_0=cast=Graphics * +Gdip_Graphics_Flush_1=cast=FlushIntention + Gdip_Graphics_GetClip=flags=cpp Gdip_Graphics_GetClip_0=cast=(Graphics *) Gdip_Graphics_GetClip_1=cast=Region * @@ -300,6 +304,9 @@ Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2=flags=cpp Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_0=cast=(Graphics *) Gdip_Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_1= +Gdip_Graphics_GetHDC=flags=cpp +Gdip_Graphics_GetHDC_0=cast=Graphics * + Gdip_Graphics_GetInterpolationMode=flags=cpp Gdip_Graphics_GetInterpolationMode_0=cast=(Graphics *) @@ -330,6 +337,10 @@ Gdip_Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2Lorg_ Gdip_Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2Lorg_eclipse_swt_internal_gdip_RectF_2_4=cast=const PointF *,flags=struct Gdip_Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2Lorg_eclipse_swt_internal_gdip_RectF_2_5=cast=RectF * +Gdip_Graphics_ReleaseHDC=flags=cpp +Gdip_Graphics_ReleaseHDC_0=cast=Graphics * +Gdip_Graphics_ReleaseHDC_1=cast=HDC + Gdip_Graphics_ResetClip=flags=cpp Gdip_Graphics_ResetClip_0=cast=(Graphics *) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp index a217c46691..b486102758 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip.cpp @@ -609,6 +609,16 @@ JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1FillRectangle) } #endif +#ifndef NO_Graphics_1Flush +JNIEXPORT void JNICALL Gdip_NATIVE(Graphics_1Flush) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + Gdip_NATIVE_ENTER(env, that, Graphics_1Flush_FUNC); + ((Graphics *)arg0)->Flush((FlushIntention)arg1); + Gdip_NATIVE_EXIT(env, that, Graphics_1Flush_FUNC); +} +#endif + #ifndef NO_Graphics_1GetClip JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1GetClip) (JNIEnv *env, jclass that, jint arg0, jint arg1) @@ -653,6 +663,18 @@ fail: } #endif +#ifndef NO_Graphics_1GetHDC +JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1GetHDC) + (JNIEnv *env, jclass that, jint arg0) +{ + jint rc = 0; + Gdip_NATIVE_ENTER(env, that, Graphics_1GetHDC_FUNC); + rc = (jint)((Graphics *)arg0)->GetHDC(); + Gdip_NATIVE_EXIT(env, that, Graphics_1GetHDC_FUNC); + return rc; +} +#endif + #ifndef NO_Graphics_1GetInterpolationMode JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1GetInterpolationMode) (JNIEnv *env, jclass that, jint arg0) @@ -745,6 +767,16 @@ fail: } #endif +#ifndef NO_Graphics_1ReleaseHDC +JNIEXPORT void JNICALL Gdip_NATIVE(Graphics_1ReleaseHDC) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + Gdip_NATIVE_ENTER(env, that, Graphics_1ReleaseHDC_FUNC); + ((Graphics *)arg0)->ReleaseHDC((HDC)arg1); + Gdip_NATIVE_EXIT(env, that, Graphics_1ReleaseHDC_FUNC); +} +#endif + #ifndef NO_Graphics_1ResetClip JNIEXPORT jint JNICALL Gdip_NATIVE(Graphics_1ResetClip) (JNIEnv *env, jclass that, jint arg0) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp index 58a04d3a7f..cd8ff589c4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.cpp @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int Gdip_nativeFunctionCount = 120; -int Gdip_nativeFunctionCallCount[120]; +int Gdip_nativeFunctionCount = 123; +int Gdip_nativeFunctionCallCount[123]; char * Gdip_nativeFunctionNames[] = { "Bitmap_1delete", "Bitmap_1new__I", @@ -67,15 +67,18 @@ char * Gdip_nativeFunctionNames[] = { "Graphics_1FillPie", "Graphics_1FillPolygon", "Graphics_1FillRectangle", + "Graphics_1Flush", "Graphics_1GetClip", "Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2", "Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2", + "Graphics_1GetHDC", "Graphics_1GetInterpolationMode", "Graphics_1GetSmoothingMode", "Graphics_1GetTextRenderingHint", "Graphics_1GetTransform", "Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2ILorg_eclipse_swt_internal_gdip_RectF_2", "Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2Lorg_eclipse_swt_internal_gdip_RectF_2", + "Graphics_1ReleaseHDC", "Graphics_1ResetClip", "Graphics_1SetClip__II", "Graphics_1SetClip__III", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h index 7b35d533f6..d222eadd76 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/gdip_stats.h @@ -71,15 +71,18 @@ typedef enum { Graphics_1FillPie_FUNC, Graphics_1FillPolygon_FUNC, Graphics_1FillRectangle_FUNC, + Graphics_1Flush_FUNC, Graphics_1GetClip_FUNC, Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC, Graphics_1GetClipBounds__ILorg_eclipse_swt_internal_gdip_Rect_2_FUNC, + Graphics_1GetHDC_FUNC, Graphics_1GetInterpolationMode_FUNC, Graphics_1GetSmoothingMode_FUNC, Graphics_1GetTextRenderingHint_FUNC, Graphics_1GetTransform_FUNC, Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2ILorg_eclipse_swt_internal_gdip_RectF_2_FUNC, Graphics_1MeasureString__I_3CIILorg_eclipse_swt_internal_gdip_PointF_2Lorg_eclipse_swt_internal_gdip_RectF_2_FUNC, + Graphics_1ReleaseHDC_FUNC, Graphics_1ResetClip_FUNC, Graphics_1SetClip__II_FUNC, Graphics_1SetClip__III_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java index fb895a87ba..8e9889586c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/gdip/Gdip.java @@ -40,6 +40,8 @@ public class Gdip extends Platform { public static final int DashStyleDashDot = 3; public static final int DashStyleDashDotDot = 4; public static final int DashStyleCustom = 5; + public static final int FlushIntentionFlush = 0; + public static final int FlushIntentionSync = 1; public static final int HotkeyPrefixNone = 0; public static final int HotkeyPrefixShow = 1; public static final int HotkeyPrefixHide = 2; @@ -136,12 +138,15 @@ public static final native int Graphics_DrawString(int graphics, char[] string, public static final native int Graphics_DrawString(int graphics, char[] string, int length, int font, PointF origin, int format, int brush); public static final native int Graphics_FillEllipse(int graphics, int brush, int x, int y, int width, int height); public static final native int Graphics_FillPath(int graphics, int brush, int path); +public static final native void Graphics_Flush(int graphics, int intention); public static final native int Graphics_FillPie(int graphics, int brush, int x, int y, int width, int height, float startAngle, float sweepAngle); public static final native int Graphics_FillPolygon(int graphics, int brush, int[] points, int count, int fillMode); public static final native int Graphics_FillRectangle(int graphics, int brush, int x, int y, int width, int height); public static final native int Graphics_GetClipBounds(int graphics, RectF rect); public static final native int Graphics_GetClipBounds(int graphics, Rect rect); public static final native int Graphics_GetClip(int graphics, int region); +public static final native int Graphics_GetHDC(int graphics); +public static final native void Graphics_ReleaseHDC(int graphics, int hdc); public static final native int Graphics_GetInterpolationMode(int graphics); public static final native int Graphics_GetSmoothingMode(int graphics); public static final native int Graphics_GetTextRenderingHint(int graphics); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java index 4f7cb7fd65..b92dfec2c4 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java @@ -794,6 +794,7 @@ void drawBitmap(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, boolean mustRestore = false; GC memGC = srcImage.memGC; if (memGC != null && !memGC.isDisposed()) { + memGC.flush(); mustRestore = true; GCData data = memGC.data; if (data.hNullBitmap != 0) { @@ -2279,6 +2280,19 @@ void fillRoundRectangleGdip (int gdipGraphics, int brush, int x, int y, int widt } } +void flush () { + if (data.gdipGraphics != 0) { + Gdip.Graphics_Flush(data.gdipGraphics, 0); + /* + * Note Flush() does not flush the output to the + * underline HDC. This is done by calling GetHDC() + * followed by ReleaseHDC(). + */ + int hdc = Gdip.Graphics_GetHDC(data.gdipGraphics); + Gdip.Graphics_ReleaseHDC(data.gdipGraphics, hdc); + } +} + /** * Returns the <em>advance width</em> of the specified character in * the font which is currently selected into the receiver. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java index 19243334c6..c87e0ce59d 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java @@ -1232,6 +1232,7 @@ public ImageData getImageData() { if (!isDib) { boolean mustRestore = false; if (memGC != null && !memGC.isDisposed()) { + memGC.flush (); mustRestore = true; GCData data = memGC.data; if (data.hNullBitmap != 0) { |