aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2011-11-09 07:37:09 (EST)
committerSilenio Quarti2011-11-25 11:48:51 (EST)
commitddd03c76ec559fb767478e2193acaf2065b1f45d (patch)
treeb16a443cb7bc3530dd3a8441a9a65db1a13b497c
parent0bab5ef16bf9ed26100e0695fd20f73178a7c073 (diff)
downloadeclipse.platform.swt-ddd03c76ec559fb767478e2193acaf2065b1f45d.zip
eclipse.platform.swt-ddd03c76ec559fb767478e2193acaf2065b1f45d.tar.gz
eclipse.platform.swt-ddd03c76ec559fb767478e2193acaf2065b1f45d.tar.bz2
Conditionaly use gtk_menu_item_remove_submenu and make it dynamic.
The new API is to use gtk_menu_item_set_submenu with null/0.
-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.h1
-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.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java6
5 files changed, 19 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 0c5be84..8444a6d 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
@@ -10541,7 +10541,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1menu_1item_1remove_1submenu)
(JNIEnv *env, jclass that, jintLong arg0)
{
OS_NATIVE_ENTER(env, that, _1gtk_1menu_1item_1remove_1submenu_FUNC);
+/*
gtk_menu_item_remove_submenu((GtkMenuItem *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_menu_item_remove_submenu)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GtkMenuItem *))fp)((GtkMenuItem *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1menu_1item_1remove_1submenu_FUNC);
}
#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
index d965f37..d949a80 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h
@@ -19,6 +19,7 @@
#define NDEBUG
#define G_DISABLE_DEPRECATED
+/*
#define GTK_DISABLE_DEPRECATED
/*
*/
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 46c6d25..4172256 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
@@ -122,6 +122,7 @@
#define gtk_icon_info_free_LIB LIB_GTK
#define gtk_icon_theme_lookup_by_gicon_LIB LIB_GTK
#define gtk_icon_theme_get_default_LIB LIB_GTK
+#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_toolbar_set_orientation_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 12c1607..b7f8bdf 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
@@ -8253,7 +8253,10 @@ public static final int /*long*/ gtk_menu_get_attach_widget(int /*long*/ menu) {
lock.unlock();
}
}
-/** @param menu_item cast=(GtkMenuItem *) */
+/**
+ * @method flags=dynamic
+ * @param menu_item cast=(GtkMenuItem *)
+ */
public static final native void _gtk_menu_item_remove_submenu(int /*long*/ menu_item);
public static final void gtk_menu_item_remove_submenu(int /*long*/ menu_item) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index d0a81f5..8be098e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -772,7 +772,11 @@ public void setMenu (Menu menu) {
* to replace or GTK will destroy it.
*/
OS.g_object_ref (oldMenu.handle);
- OS.gtk_menu_item_remove_submenu (handle);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) {
+ OS.gtk_menu_item_set_submenu (handle, 0);
+ } else {
+ OS.gtk_menu_item_remove_submenu (handle);
+ }
}
if ((this.menu = menu) != null) {
menu.cascade = this;