diff options
author | Alexander Kurtakov <akurtako@redhat.com> | 2012-10-25 15:48:35 +0300 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2012-10-25 15:48:35 +0300 |
commit | 8448d197b76473a9bbdfd0dc7b5d890dae31fb27 (patch) | |
tree | c2052b442e2bcdd7f3f973c025aaa9b54b97f0d0 /bundles | |
parent | 81fc4fbb51e1206ed8a526050d3bdcad1a2f0496 (diff) | |
download | eclipse.platform.swt-8448d197b76473a9bbdfd0dc7b5d890dae31fb27.tar.gz eclipse.platform.swt-8448d197b76473a9bbdfd0dc7b5d890dae31fb27.tar.xz eclipse.platform.swt-8448d197b76473a9bbdfd0dc7b5d890dae31fb27.zip |
Swap gtk_combo_box_entry_new_text with gtk_combo_box_text_new_with_entry
The later is the replacement for the former in GTK 3.x.
Diffstat (limited to 'bundles')
6 files changed, 38 insertions, 1 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 ecf55374b0..0c7f54bebd 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 @@ -9014,6 +9014,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1combo_1box_1text_1new) } #endif +#ifndef NO__1gtk_1combo_1box_1text_1new_1with_1entry +JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1combo_1box_1text_1new_1with_1entry) + (JNIEnv *env, jclass that) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1combo_1box_1text_1new_1with_1entry_FUNC); +/* + rc = (jintLong)gtk_combo_box_text_new_with_entry(); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_combo_box_text_new_with_entry) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)(); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1combo_1box_1text_1new_1with_1entry_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1container_1add JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1container_1add) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) 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 879207f26f..fa5dc0f668 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 @@ -110,6 +110,7 @@ #define gtk_combo_box_popup_LIB LIB_GTK #define gtk_combo_box_popdown_LIB LIB_GTK #define gtk_combo_box_text_new_LIB LIB_GTK +#define gtk_combo_box_text_new_with_entry_LIB LIB_GTK #define gtk_entry_text_index_to_layout_index_LIB LIB_GTK #define gtk_entry_get_inner_border_LIB LIB_GTK #define gtk_font_chooser_dialog_new_LIB LIB_GTK 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 00d61b8a53..ad4d5b44c5 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 @@ -660,6 +660,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1combo_1box_1set_1active", "_1gtk_1combo_1box_1set_1focus_1on_1click", "_1gtk_1combo_1box_1text_1new", + "_1gtk_1combo_1box_1text_1new_1with_1entry", "_1gtk_1container_1add", "_1gtk_1container_1forall", "_1gtk_1container_1get_1border_1width", 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 b1ec174e0b..5e56ad5441 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 @@ -670,6 +670,7 @@ typedef enum { _1gtk_1combo_1box_1set_1active_FUNC, _1gtk_1combo_1box_1set_1focus_1on_1click_FUNC, _1gtk_1combo_1box_1text_1new_FUNC, + _1gtk_1combo_1box_1text_1new_1with_1entry_FUNC, _1gtk_1container_1add_FUNC, _1gtk_1container_1forall_FUNC, _1gtk_1container_1get_1border_1width_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 7a707aff45..4494445d3d 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 @@ -6371,6 +6371,16 @@ public static final long /*int*/ gtk_combo_box_text_new() { } } /** @method flags=dynamic */ +public static final native long /*int*/ _gtk_combo_box_text_new_with_entry(); +public static final long /*int*/ gtk_combo_box_text_new_with_entry() { + lock.lock(); + try { + return _gtk_combo_box_text_new_with_entry(); + } finally { + lock.unlock(); + } +} +/** @method flags=dynamic */ public static final native void _gtk_combo_box_insert_text(long /*int*/ combo_box, int position, byte[] text); public static final void gtk_combo_box_insert_text(long /*int*/ combo_box, int position, byte[] text) { lock.lock(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index cd69ae127f..f54ff074b5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -408,7 +408,11 @@ void createHandle (int index) { cellHandle = OS.gtk_bin_get_child (handle); if (cellHandle == 0) error (SWT.ERROR_NO_HANDLES); } else { - handle = OS.gtk_combo_box_entry_new_text (); + if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + handle = OS.gtk_combo_box_text_new_with_entry(); + } else { + handle = OS.gtk_combo_box_entry_new_text (); + } if (handle == 0) error (SWT.ERROR_NO_HANDLES); entryHandle = OS.gtk_bin_get_child (handle); if (entryHandle == 0) error (SWT.ERROR_NO_HANDLES); |