diff options
author | Felipe Heidrich | 2006-11-17 17:07:19 +0000 |
---|---|---|
committer | Felipe Heidrich | 2006-11-17 17:07:19 +0000 |
commit | 2666a72decba4f694d1ccebe2f8b920f7e88f95b (patch) | |
tree | 5746cd4b79e14c767cbb1457ba5a014646c93cf6 /bundles/org.eclipse.swt/Eclipse SWT PI | |
parent | c903253271c1cee79998b8482d477bab6399a627 (diff) | |
download | eclipse.platform.swt-2666a72decba4f694d1ccebe2f8b920f7e88f95b.tar.gz eclipse.platform.swt-2666a72decba4f694d1ccebe2f8b920f7e88f95b.tar.xz eclipse.platform.swt-2666a72decba4f694d1ccebe2f8b920f7e88f95b.zip |
FIX set text antialias for gtk 2.8 in GC
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
5 files changed, 84 insertions, 5 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 34f294ce71..d8a1cfc294 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 @@ -15292,6 +15292,61 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1pango_1attr_1weight_1new) } #endif +#ifndef NO__1pango_1cairo_1context_1get_1font_1options +JNIEXPORT jint JNICALL OS_NATIVE(_1pango_1cairo_1context_1get_1font_1options) + (JNIEnv *env, jclass that, jint arg0) +{ + jint rc = 0; + OS_NATIVE_ENTER(env, that, _1pango_1cairo_1context_1get_1font_1options_FUNC); +/* + rc = (jint)pango_cairo_context_get_font_options((PangoContext *)arg0); +*/ + { + static int initialized = 0; + static void *handle = NULL; + typedef jint (*FPTR)(PangoContext *); + static FPTR fptr; + rc = 0; + if (!initialized) { + if (!handle) handle = dlopen(pango_cairo_context_get_font_options_LIB, RTLD_LAZY); + if (handle) fptr = (FPTR)dlsym(handle, "pango_cairo_context_get_font_options"); + initialized = 1; + } + if (fptr) { + rc = (jint)(*fptr)((PangoContext *)arg0); + } + } + OS_NATIVE_EXIT(env, that, _1pango_1cairo_1context_1get_1font_1options_FUNC); + return rc; +} +#endif + +#ifndef NO__1pango_1cairo_1context_1set_1font_1options +JNIEXPORT void JNICALL OS_NATIVE(_1pango_1cairo_1context_1set_1font_1options) + (JNIEnv *env, jclass that, jint arg0, jint arg1) +{ + OS_NATIVE_ENTER(env, that, _1pango_1cairo_1context_1set_1font_1options_FUNC); +/* + pango_cairo_context_set_font_options((PangoContext *)arg0, (const cairo_font_options_t *)arg1); +*/ + { + static int initialized = 0; + static void *handle = NULL; + typedef void (*FPTR)(PangoContext *, const cairo_font_options_t *); + static FPTR fptr; + if (!initialized) { + if (!handle) handle = dlopen(pango_cairo_context_set_font_options_LIB, RTLD_LAZY); + if (handle) fptr = (FPTR)dlsym(handle, "pango_cairo_context_set_font_options"); + initialized = 1; + } + if (fptr) { + (*fptr)((PangoContext *)arg0, (const cairo_font_options_t *)arg1); + } + } + OS_NATIVE_EXIT(env, that, _1pango_1cairo_1context_1set_1font_1options_FUNC); +} +#endif + #ifndef NO__1pango_1cairo_1create_1layout JNIEXPORT jint JNICALL OS_NATIVE(_1pango_1cairo_1create_1layout) (JNIEnv *env, jclass that, jint arg0) @@ -15299,12 +15354,12 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1pango_1cairo_1create_1layout) jint rc = 0; OS_NATIVE_ENTER(env, that, _1pango_1cairo_1create_1layout_FUNC); /* - rc = (jint)pango_cairo_create_layout(arg0); + rc = (jint)pango_cairo_create_layout((cairo_t *)arg0); */ { static int initialized = 0; static void *handle = NULL; - typedef jint (*FPTR)(jint); + typedef jint (*FPTR)(cairo_t *); static FPTR fptr; rc = 0; if (!initialized) { @@ -15313,7 +15368,7 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1pango_1cairo_1create_1layout) initialized = 1; } if (fptr) { - rc = (jint)(*fptr)(arg0); + rc = (jint)(*fptr)((cairo_t *)arg0); } } OS_NATIVE_EXIT(env, that, _1pango_1cairo_1create_1layout_FUNC); 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 c36058511e..d8bb98d4dd 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 @@ -91,6 +91,8 @@ #define atk_object_add_relationship_LIB "libatk-1.0.so.0" #define pango_layout_set_auto_dir_LIB "libpango-1.0.so.0" #define pango_cairo_create_layout_LIB "libpangocairo-1.0.so.0" +#define pango_cairo_context_set_font_options_LIB "libpangocairo-1.0.so.0" +#define pango_cairo_context_get_font_options_LIB "libpangocairo-1.0.so.0" #define pango_cairo_layout_path_LIB "libpangocairo-1.0.so.0" #define pango_cairo_show_layout_LIB "libpangocairo-1.0.so.0" #define pango_cairo_font_map_create_context_LIB "libpangocairo-1.0.so.0" 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 f2c05c79a5..f3b353a086 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 @@ -18,8 +18,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1212; -int OS_nativeFunctionCallCount[1212]; +int OS_nativeFunctionCount = 1214; +int OS_nativeFunctionCallCount[1214]; char * OS_nativeFunctionNames[] = { "Call", "GDK_1EVENT_1TYPE", @@ -1084,6 +1084,8 @@ char * OS_nativeFunctionNames[] = { "_1pango_1attr_1strikethrough_1new", "_1pango_1attr_1underline_1new", "_1pango_1attr_1weight_1new", + "_1pango_1cairo_1context_1get_1font_1options", + "_1pango_1cairo_1context_1set_1font_1options", "_1pango_1cairo_1create_1layout", "_1pango_1cairo_1font_1map_1create_1context", "_1pango_1cairo_1font_1map_1get_1default", 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 bfb1c824d7..772ae3accb 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 @@ -1088,6 +1088,8 @@ typedef enum { _1pango_1attr_1strikethrough_1new_FUNC, _1pango_1attr_1underline_1new_FUNC, _1pango_1attr_1weight_1new_FUNC, + _1pango_1cairo_1context_1get_1font_1options_FUNC, + _1pango_1cairo_1context_1set_1font_1options_FUNC, _1pango_1cairo_1create_1layout_FUNC, _1pango_1cairo_1font_1map_1create_1context_FUNC, _1pango_1cairo_1font_1map_1get_1default_FUNC, 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 39aac5cb20..ce0ba584fe 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 @@ -9516,6 +9516,24 @@ public static final int /*long*/ pango_cairo_create_layout(int /*long*/ cairo) { lock.unlock(); } } +public static final native int /*long*/ _pango_cairo_context_get_font_options(int /*long*/ context); +public static final int /*long*/ pango_cairo_context_get_font_options(int /*long*/ context) { + lock.lock(); + try { + return _pango_cairo_context_get_font_options(context); + } finally { + lock.unlock(); + } +} +public static final native void _pango_cairo_context_set_font_options(int /*long*/ context, int /*long*/ options); +public static final void pango_cairo_context_set_font_options(int /*long*/ context, int /*long*/ options) { + lock.lock(); + try { + _pango_cairo_context_set_font_options(context, options); + } finally { + lock.unlock(); + } +} public static final native void _pango_cairo_font_map_set_resolution(int /*long*/ fontmap, double dpi); public static final void pango_cairo_font_map_set_resolution(int /*long*/ fontmap, double dpi) { lock.lock(); |