diff options
8 files changed, 4 insertions, 269 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 dfe86c15ed..48ecc4a2d8 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 @@ -891,18 +891,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(GtkColorSelectionDialog_1sizeof) } #endif -#ifndef NO_GtkCombo_1sizeof -JNIEXPORT jint JNICALL OS_NATIVE(GtkCombo_1sizeof) - (JNIEnv *env, jclass that) -{ - jint rc = 0; - OS_NATIVE_ENTER(env, that, GtkCombo_1sizeof_FUNC); - rc = (jint)GtkCombo_sizeof(); - OS_NATIVE_EXIT(env, that, GtkCombo_1sizeof_FUNC); - return rc; -} -#endif - #ifndef NO_GtkFileSelection_1sizeof JNIEXPORT jint JNICALL OS_NATIVE(GtkFileSelection_1sizeof) (JNIEnv *env, jclass that) @@ -8311,48 +8299,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1box_1set_1focus_1on_1click) } #endif -#ifndef NO__1gtk_1combo_1disable_1activate -JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1disable_1activate) - (JNIEnv *env, jclass that, jintLong arg0) -{ - OS_NATIVE_ENTER(env, that, _1gtk_1combo_1disable_1activate_FUNC); - gtk_combo_disable_activate((GtkCombo *)arg0); - OS_NATIVE_EXIT(env, that, _1gtk_1combo_1disable_1activate_FUNC); -} -#endif - -#ifndef NO__1gtk_1combo_1new -JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1combo_1new) - (JNIEnv *env, jclass that) -{ - jintLong rc = 0; - OS_NATIVE_ENTER(env, that, _1gtk_1combo_1new_FUNC); - rc = (jintLong)gtk_combo_new(); - OS_NATIVE_EXIT(env, that, _1gtk_1combo_1new_FUNC); - return rc; -} -#endif - -#ifndef NO__1gtk_1combo_1set_1case_1sensitive -JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1set_1case_1sensitive) - (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) -{ - OS_NATIVE_ENTER(env, that, _1gtk_1combo_1set_1case_1sensitive_FUNC); - gtk_combo_set_case_sensitive((GtkCombo *)arg0, (gboolean)arg1); - OS_NATIVE_EXIT(env, that, _1gtk_1combo_1set_1case_1sensitive_FUNC); -} -#endif - -#ifndef NO__1gtk_1combo_1set_1popdown_1strings -JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1set_1popdown_1strings) - (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) -{ - OS_NATIVE_ENTER(env, that, _1gtk_1combo_1set_1popdown_1strings_FUNC); - gtk_combo_set_popdown_strings((GtkCombo *)arg0, (GList *)arg1); - OS_NATIVE_EXIT(env, that, _1gtk_1combo_1set_1popdown_1strings_FUNC); -} -#endif - #ifndef NO__1gtk_1container_1add JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1container_1add) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) @@ -19745,27 +19691,6 @@ JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkColor } #endif -#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J) && defined(JNI64)) -#ifndef JNI64 -JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) -#else -JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) -#endif -{ -#ifndef JNI64 - OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I_FUNC); -#else - OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J_FUNC); -#endif - if (arg0) setGtkComboFields(env, arg0, (GtkCombo *)arg1); -#ifndef JNI64 - OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I_FUNC); -#else - OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J_FUNC); -#endif -} -#endif - #if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1) 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 0f233ad5a2..d15477374c 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 = 1398; -int OS_nativeFunctionCallCount[1398]; +int OS_nativeFunctionCount = 1392; +int OS_nativeFunctionCallCount[1392]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -102,7 +102,6 @@ char * OS_nativeFunctionNames[] = { "GtkCellRendererToggleClass_1sizeof", "GtkCellRendererToggle_1sizeof", "GtkColorSelectionDialog_1sizeof", - "GtkCombo_1sizeof", "GtkFileSelection_1sizeof", "GtkFixedClass_1sizeof", "GtkFixed_1sizeof", @@ -671,10 +670,6 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1combo_1box_1remove_1text", "_1gtk_1combo_1box_1set_1active", "_1gtk_1combo_1box_1set_1focus_1on_1click", - "_1gtk_1combo_1disable_1activate", - "_1gtk_1combo_1new", - "_1gtk_1combo_1set_1case_1sensitive", - "_1gtk_1combo_1set_1popdown_1strings", "_1gtk_1container_1add", "_1gtk_1container_1forall", "_1gtk_1container_1get_1border_1width", @@ -1709,11 +1704,6 @@ char * OS_nativeFunctionNames[] = { "memmove__Lorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2J", #endif #ifndef JNI64 - "memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I", -#else - "memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J", -#endif -#ifndef JNI64 "memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I", #else "memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J", 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 b47f2c6c58..2e3ff07606 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 @@ -110,7 +110,6 @@ typedef enum { GtkCellRendererToggleClass_1sizeof_FUNC, GtkCellRendererToggle_1sizeof_FUNC, GtkColorSelectionDialog_1sizeof_FUNC, - GtkCombo_1sizeof_FUNC, GtkFileSelection_1sizeof_FUNC, GtkFixedClass_1sizeof_FUNC, GtkFixed_1sizeof_FUNC, @@ -679,10 +678,6 @@ typedef enum { _1gtk_1combo_1box_1remove_1text_FUNC, _1gtk_1combo_1box_1set_1active_FUNC, _1gtk_1combo_1box_1set_1focus_1on_1click_FUNC, - _1gtk_1combo_1disable_1activate_FUNC, - _1gtk_1combo_1new_FUNC, - _1gtk_1combo_1set_1case_1sensitive_FUNC, - _1gtk_1combo_1set_1popdown_1strings_FUNC, _1gtk_1container_1add_FUNC, _1gtk_1container_1forall_FUNC, _1gtk_1container_1get_1border_1width_FUNC, @@ -1717,11 +1712,6 @@ typedef enum { memmove__Lorg_eclipse_swt_internal_gtk_GtkColorSelectionDialog_2J_FUNC, #endif #ifndef JNI64 - memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2I_FUNC, -#else - memmove__Lorg_eclipse_swt_internal_gtk_GtkCombo_2J_FUNC, -#endif -#ifndef JNI64 memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2I_FUNC, #else memmove__Lorg_eclipse_swt_internal_gtk_GtkFileSelection_2J_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c index 8c72e96604..df702c6589 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved. * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that * accompanies this distribution (lgpl-v21.txt). The LGPL is also @@ -1506,40 +1506,6 @@ void setGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSel } #endif -#ifndef NO_GtkCombo -typedef struct GtkCombo_FID_CACHE { - int cached; - jclass clazz; - jfieldID entry, list; -} GtkCombo_FID_CACHE; - -GtkCombo_FID_CACHE GtkComboFc; - -void cacheGtkComboFields(JNIEnv *env, jobject lpObject) -{ - if (GtkComboFc.cached) return; - GtkComboFc.clazz = (*env)->GetObjectClass(env, lpObject); - GtkComboFc.entry = (*env)->GetFieldID(env, GtkComboFc.clazz, "entry", I_J); - GtkComboFc.list = (*env)->GetFieldID(env, GtkComboFc.clazz, "list", I_J); - GtkComboFc.cached = 1; -} - -GtkCombo *getGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct) -{ - if (!GtkComboFc.cached) cacheGtkComboFields(env, lpObject); - lpStruct->entry = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkComboFc.entry); - lpStruct->list = (GtkWidget *)(*env)->GetIntLongField(env, lpObject, GtkComboFc.list); - return lpStruct; -} - -void setGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct) -{ - if (!GtkComboFc.cached) cacheGtkComboFields(env, lpObject); - (*env)->SetIntLongField(env, lpObject, GtkComboFc.entry, (jintLong)lpStruct->entry); - (*env)->SetIntLongField(env, lpObject, GtkComboFc.list, (jintLong)lpStruct->list); -} -#endif - #ifndef NO_GtkFileSelection typedef struct GtkFileSelection_FID_CACHE { int cached; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h index 6435b83221..42322a4246 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved. * The contents of this file are made available under the terms * of the GNU Lesser General Public License (LGPL) Version 2.1 that * accompanies this distribution (lgpl-v21.txt). The LGPL is also @@ -363,18 +363,6 @@ void setGtkColorSelectionDialogFields(JNIEnv *env, jobject lpObject, GtkColorSel #define GtkColorSelectionDialog_sizeof() 0 #endif -#ifndef NO_GtkCombo -void cacheGtkComboFields(JNIEnv *env, jobject lpObject); -GtkCombo *getGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct); -void setGtkComboFields(JNIEnv *env, jobject lpObject, GtkCombo *lpStruct); -#define GtkCombo_sizeof() sizeof(GtkCombo) -#else -#define cacheGtkComboFields(a,b) -#define getGtkComboFields(a,b,c) NULL -#define setGtkComboFields(a,b,c) -#define GtkCombo_sizeof() 0 -#endif - #ifndef NO_GtkFileSelection void cacheGtkFileSelectionFields(JNIEnv *env, jobject lpObject); GtkFileSelection *getGtkFileSelectionFields(JNIEnv *env, jobject lpObject, GtkFileSelection *lpStruct); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java deleted file mode 100644 index d9e4a585c7..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GtkCombo.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.internal.gtk; - - -public class GtkCombo { - /** @field cast=(GtkWidget *) */ - public int /*long*/ entry; - /** @field cast=(GtkWidget *) */ - public int /*long*/ list; -} 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 32f995ea98..0990c783c9 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 @@ -604,7 +604,6 @@ public static final native int GtkAdjustment_sizeof(); public static final native int GtkAllocation_sizeof(); public static final native int GtkBorder_sizeof(); public static final native int GtkColorSelectionDialog_sizeof(); -public static final native int GtkCombo_sizeof(); public static final native int GtkFileSelection_sizeof(); public static final native int GtkFixed_sizeof(); public static final native int GtkFixedClass_sizeof(); @@ -6352,38 +6351,6 @@ public static final void gtk_color_selection_set_has_palette(int /*long*/ colors lock.unlock(); } } -/** @param combo cast=(GtkCombo *) */ -public static final native void _gtk_combo_disable_activate(int /*long*/ combo); -public static final void gtk_combo_disable_activate(int /*long*/ combo) { - lock.lock(); - try { - _gtk_combo_disable_activate(combo); - } finally { - lock.unlock(); - } -} -public static final native int /*long*/ _gtk_combo_new(); -public static final int /*long*/ gtk_combo_new() { - lock.lock(); - try { - return _gtk_combo_new(); - } finally { - lock.unlock(); - } -} -/** - * @param combo cast=(GtkCombo *) - * @param val cast=(gboolean) - */ -public static final native void _gtk_combo_set_case_sensitive(int /*long*/ combo, boolean val); -public static final void gtk_combo_set_case_sensitive(int /*long*/ combo, boolean val) { - lock.lock(); - try { - _gtk_combo_set_case_sensitive(combo, val); - } finally { - lock.unlock(); - } -} /** @method flags=dynamic */ public static final native void _gtk_combo_box_set_focus_on_click(int /*long*/ combo, boolean val); public static final void gtk_combo_box_set_focus_on_click(int /*long*/ combo, boolean val) { @@ -6394,19 +6361,6 @@ public static final void gtk_combo_box_set_focus_on_click(int /*long*/ combo, bo lock.unlock(); } } -/** - * @param combo cast=(GtkCombo *) - * @param strings cast=(GList *) - */ -public static final native void _gtk_combo_set_popdown_strings(int /*long*/ combo, int /*long*/ strings); -public static final void gtk_combo_set_popdown_strings(int /*long*/ combo, int /*long*/ strings) { - lock.lock(); - try { - _gtk_combo_set_popdown_strings(combo, strings); - } finally { - lock.unlock(); - } -} /** @method flags=dynamic */ public static final native int /*long*/ _gtk_combo_box_entry_new_text(); public static final int /*long*/ gtk_combo_box_entry_new_text() { @@ -13984,11 +13938,6 @@ public static final native void memmove(GtkTargetPair dest, int /*long*/ src, in * @param dest cast=(void *),flags=no_in * @param src cast=(const void *) */ -public static final native void memmove(GtkCombo dest, int /*long*/ src); -/** - * @param dest cast=(void *),flags=no_in - * @param src cast=(const void *) - */ public static final native void memmove(GtkAdjustment dest, int /*long*/ src); /** * @param dest cast=(void *),flags=no_in 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 3582fac77e..32b4049f15 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 @@ -420,7 +420,6 @@ void createHandle (int index) { fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_fixed_set_has_window (fixedHandle, true); - if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { int /*long*/ oldList = OS.gtk_window_list_toplevels (); if ((style & SWT.READ_ONLY) != 0) { handle = OS.gtk_combo_box_new_text (); @@ -476,55 +475,6 @@ void createHandle (int index) { if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) { OS.GTK_WIDGET_UNSET_FLAGS (buttonHandle, OS.GTK_RECEIVES_DEFAULT); } - } else { - handle = OS.gtk_combo_new (); - if (handle == 0) error (SWT.ERROR_NO_HANDLES); - OS.gtk_container_add (fixedHandle, handle); - GtkCombo combo = new GtkCombo (); - OS.memmove (combo, handle); - entryHandle = combo.entry; - listHandle = combo.list; - - if (OS.GTK_VERSION < OS.VERSION (2, 4, 0)) { - int /*long*/ parentHandle = 0; - int /*long*/ temp = listHandle; - while ((temp = OS.gtk_widget_get_parent(temp)) != 0) { - parentHandle = temp; - } - popupHandle = parentHandle; - if (popupHandle != 0) { - int /*long*/ modalGroup = getShell().modalGroup; - if (modalGroup != 0) { - OS.gtk_window_group_add_window (modalGroup, popupHandle); - } - } - } - /* - * Feature in GTK. There is no API to query the arrow - * handle from a combo box although it is possible to - * get the list and text field. The arrow handle is needed - * to hook events. The fix is to find the first child that is - * not the entry or list and assume this is the arrow handle. - */ - int /*long*/ list = OS.gtk_container_get_children (handle); - if (list != 0) { - int i = 0, count = OS.g_list_length (list); - while (i<count) { - int /*long*/ childHandle = OS.g_list_nth_data (list, i); - if (childHandle != entryHandle && childHandle != listHandle) { - buttonHandle = childHandle; - break; - } - i++; - } - OS.g_list_free (list); - } - - boolean editable = (style & SWT.READ_ONLY) == 0; - OS.gtk_editable_set_editable (entryHandle, editable); - OS.gtk_combo_disable_activate (handle); - OS.gtk_combo_set_case_sensitive (handle, true); - } } /** |