diff options
author | Alexander Kurtakov | 2012-11-14 09:44:06 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2012-11-14 09:44:06 +0000 |
commit | 7d46d43cd21b835d179c72bde7bab59e61f13803 (patch) | |
tree | bde3cb0bec6bf2bc3d791cce062b69b8f96b1249 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library | |
parent | f0c3863919f76488edb06642c9a462968a147799 (diff) | |
download | eclipse.platform.swt-7d46d43cd21b835d179c72bde7bab59e61f13803.tar.gz eclipse.platform.swt-7d46d43cd21b835d179c72bde7bab59e61f13803.tar.xz eclipse.platform.swt-7d46d43cd21b835d179c72bde7bab59e61f13803.zip |
Bug 393856 - Consider using pango_layout_get_pixel_size
Binding for the function added and used where possible. This allows to
not convert them after fetching via OS.PANGO_PIXELS calls.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library')
3 files changed, 19 insertions, 0 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 c7505cdde7..d53ab8d43f 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 @@ -20201,6 +20201,23 @@ fail: } #endif +#ifndef NO__1pango_1layout_1get_1pixel_1size +JNIEXPORT void JNICALL OS_NATIVE(_1pango_1layout_1get_1pixel_1size) + (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintArray arg2) +{ + jint *lparg1=NULL; + jint *lparg2=NULL; + OS_NATIVE_ENTER(env, that, _1pango_1layout_1get_1pixel_1size_FUNC); + if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; + if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; + pango_layout_get_pixel_size((PangoLayout *)arg0, (int *)lparg1, (int *)lparg2); +fail: + if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); + if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); + OS_NATIVE_EXIT(env, that, _1pango_1layout_1get_1pixel_1size_FUNC); +} +#endif + #ifndef NO__1pango_1layout_1get_1size JNIEXPORT void JNICALL OS_NATIVE(_1pango_1layout_1get_1size) (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintArray arg2) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index b9f2860800..f0850429dd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -1496,6 +1496,7 @@ char * OS_nativeFunctionNames[] = { "_1pango_1layout_1get_1line", "_1pango_1layout_1get_1line_1count", "_1pango_1layout_1get_1log_1attrs", + "_1pango_1layout_1get_1pixel_1size", "_1pango_1layout_1get_1size", "_1pango_1layout_1get_1spacing", "_1pango_1layout_1get_1tabs", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index 494ad5f1e0..acd559a0b8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -1506,6 +1506,7 @@ typedef enum { _1pango_1layout_1get_1line_FUNC, _1pango_1layout_1get_1line_1count_FUNC, _1pango_1layout_1get_1log_1attrs_FUNC, + _1pango_1layout_1get_1pixel_1size_FUNC, _1pango_1layout_1get_1size_FUNC, _1pango_1layout_1get_1spacing_FUNC, _1pango_1layout_1get_1tabs_FUNC, |