diff options
| author | Alexander Kurtakov | 2011-11-09 12:37:09 +0000 |
|---|---|---|
| committer | Silenio Quarti | 2011-11-25 16:48:51 +0000 |
| commit | ddd03c76ec559fb767478e2193acaf2065b1f45d (patch) | |
| tree | b16a443cb7bc3530dd3a8441a9a65db1a13b497c | |
| parent | 0bab5ef16bf9ed26100e0695fd20f73178a7c073 (diff) | |
| download | eclipse.platform.ui-ddd03c76ec559fb767478e2193acaf2065b1f45d.tar.gz eclipse.platform.ui-ddd03c76ec559fb767478e2193acaf2065b1f45d.tar.xz eclipse.platform.ui-ddd03c76ec559fb767478e2193acaf2065b1f45d.zip | |
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.
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 0c5be840b59..8444a6dc7fa 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 d965f3762fe..d949a80cb34 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 46c6d25277a..41722564369 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 12c16077397..b7f8bdf8de6 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 d0a81f55826..8be098e77ad 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; |
