summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAlexander Kurtakov2011-12-13 17:07:19 (EST)
committer Silenio Quarti2012-01-20 12:30:05 (EST)
commit8ec41706f7dfc4f4b8a5be57c3df193eec4545a2 (patch)
tree5cce1faad6c71cf3e9ee77167fb7118578d8a406
parent9d8bc4eaeeb5f3a034598df91710e598770f6a2b (diff)
downloadeclipse.platform.swt-8ec41706f7dfc4f4b8a5be57c3df193eec4545a2.zip
eclipse.platform.swt-8ec41706f7dfc4f4b8a5be57c3df193eec4545a2.tar.gz
eclipse.platform.swt-8ec41706f7dfc4f4b8a5be57c3df193eec4545a2.tar.bz2
Bug 369152 - Make gtk_set_locale dynamic. (reviewed)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c8
-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.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java4
5 files changed, 16 insertions, 2 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 378b22b..714d5b5 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
@@ -13043,7 +13043,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1set_1locale)
{
jintLong rc = 0;
OS_NATIVE_ENTER(env, that, _1gtk_1set_1locale_FUNC);
+/*
rc = (jintLong)gtk_set_locale();
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_set_locale)
+ if (fp) {
+ rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)();
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1set_1locale_FUNC);
return rc;
}
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 9020f7f..f52d929 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
@@ -126,6 +126,7 @@
#define gtk_menu_item_remove_submenu_LIB LIB_GTK
#define gtk_menu_shell_set_take_focus_LIB LIB_GTK
#define gtk_window_set_keep_below_LIB LIB_GTK
+#define gtk_set_locale_LIB LIB_GTK
#define gtk_toolbar_set_orientation_LIB LIB_GTK
#define gtk_tooltip_trigger_tooltip_query_LIB LIB_GTK
#define gtk_tooltips_set_tip_LIB LIB_GTK
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 1c402af..c173280 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
@@ -10077,6 +10077,7 @@ public static final int /*long*/ gtk_separator_menu_item_new() {
lock.unlock();
}
}
+/** @method flags=dynamic */
public static final native int /*long*/ _gtk_set_locale();
public static final int /*long*/ gtk_set_locale() {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index 7957add..73f0404 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -73,7 +73,9 @@ static void gtk_init() {
if (!OS.g_thread_supported ()) {
OS.g_thread_init (0);
}
- OS.gtk_set_locale();
+ if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
+ OS.gtk_set_locale();
+ }
if (!OS.gtk_init_check (new int /*long*/ [] {0}, null)) {
SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 2f05d62..3aadcab 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -905,7 +905,9 @@ void createDisplay (DeviceData data) {
if (!OS.g_thread_supported ()) {
OS.g_thread_init (0);
}
- OS.gtk_set_locale();
+ if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
+ OS.gtk_set_locale();
+ }
if (!OS.gtk_init_check (new int /*long*/ [] {0}, null)) {
SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]"); //$NON-NLS-1$
}