aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor2012-06-12 10:48:11 (EDT)
committerSilenio Quarti2012-06-18 15:45:43 (EDT)
commita8602d3db8252159f84e68a5bee636500a2d5d19 (patch)
treece12472f2a7e4dbcde1d34f0198cbf0cac6efcf0
parent4aa744e8898dfdeafa32c91aa90156619bea3bea (diff)
downloadeclipse.platform.swt-a8602d3db8252159f84e68a5bee636500a2d5d19.zip
eclipse.platform.swt-a8602d3db8252159f84e68a5bee636500a2d5d19.tar.gz
eclipse.platform.swt-a8602d3db8252159f84e68a5bee636500a2d5d19.tar.bz2
Make gdk_draw_polygon function dynamic
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java6
3 files changed, 11 insertions, 20 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 6610d5f..3c2ec6a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -5442,24 +5442,18 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1draw_1polygon)
{
jint *lparg3=NULL;
OS_NATIVE_ENTER(env, that, _1gdk_1draw_1polygon_FUNC);
-#ifdef JNI_VERSION_1_2
- if (IS_JNI_1_2) {
- if (arg3) if ((lparg3 = (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) == NULL) goto fail;
- } else
-#endif
+ if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
+/*
+ gdk_draw_polygon(arg0, arg1, arg2, lparg3, arg4);
+*/
{
- if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail;
+ OS_LOAD_FUNCTION(fp, gdk_draw_polygon)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jintLong, jint, jint *, jint))fp)(arg0, arg1, arg2, lparg3, arg4);
+ }
}
- gdk_draw_polygon((GdkDrawable *)arg0, (GdkGC *)arg1, (gint)arg2, (GdkPoint *)lparg3, (gint)arg4);
fail:
-#ifdef JNI_VERSION_1_2
- if (IS_JNI_1_2) {
- if (arg3 && lparg3) (*env)->ReleasePrimitiveArrayCritical(env, arg3, lparg3, JNI_ABORT);
- } else
-#endif
- {
- if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, JNI_ABORT);
- }
+ if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0);
OS_NATIVE_EXIT(env, that, _1gdk_1draw_1polygon_FUNC);
}
#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 6c36da0..ef280d5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -159,6 +159,7 @@
#define gdk_draw_lines_LIB LIB_GDK
#define gdk_draw_pixbuf_LIB LIB_GDK
#define gdk_draw_point_LIB LIB_GDK
+#define gdk_draw_polygon_LIB LIB_GDK
#define gdk_gc_set_background_LIB LIB_GDK
#define gdk_gc_set_clip_mask_LIB LIB_GDK
#define gdk_gc_set_clip_origin_LIB LIB_GDK
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 3c787d8..5d83612 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -4039,11 +4039,7 @@ public static final void gdk_draw_point(int /*long*/ drawable, int /*long*/ gc,
}
}
/**
- * @param drawable cast=(GdkDrawable *)
- * @param gc cast=(GdkGC *)
- * @param filled cast=(gint)
- * @param points cast=(GdkPoint *),flags=no_out critical
- * @param npoints cast=(gint)
+ * @method flags=dynamic
*/
public static final native void _gdk_draw_polygon(int /*long*/ drawable, int /*long*/ gc, int filled, int[] points, int npoints);
public static final void gdk_draw_polygon(int /*long*/ drawable, int /*long*/ gc, int filled, int[] points, int npoints) {