summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-06-12 10:48:11 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-06-18 15:45:43 -0400
commita8602d3db8252159f84e68a5bee636500a2d5d19 (patch)
treece12472f2a7e4dbcde1d34f0198cbf0cac6efcf0
parent4aa744e8898dfdeafa32c91aa90156619bea3bea (diff)
downloadeclipse.platform.swt-a8602d3db8252159f84e68a5bee636500a2d5d19.tar.gz
eclipse.platform.swt-a8602d3db8252159f84e68a5bee636500a2d5d19.tar.xz
eclipse.platform.swt-a8602d3db8252159f84e68a5bee636500a2d5d19.zip
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 6610d5fef0..3c2ec6a5f0 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 6c36da0615..ef280d588e 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 3c787d8e1a..5d8361232b 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) {