diff options
| author | Alexander Kurtakov | 2011-11-09 21:19:05 +0000 |
|---|---|---|
| committer | Silenio Quarti | 2011-11-25 17:07:28 +0000 |
| commit | fc36e7255b8f05c052b350823b359de456f7d78b (patch) | |
| tree | cd8cd8d9182376bf31f91bf4bea0fdbbd1fd19ae | |
| parent | fb6589b64340ba0188ea90d333c916c8736110eb (diff) | |
| download | eclipse.platform.ui-fc36e7255b8f05c052b350823b359de456f7d78b.tar.gz eclipse.platform.ui-fc36e7255b8f05c052b350823b359de456f7d78b.tar.xz eclipse.platform.ui-fc36e7255b8f05c052b350823b359de456f7d78b.zip | |
gtk_tooltips_set_tip is dynamic now
Code using it was either conditionalized before or done with this patch.
5 files changed, 20 insertions, 10 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 747b11d9759..2f8f9fc3f11 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 @@ -14304,7 +14304,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tooltips_1set_1tip) OS_NATIVE_ENTER(env, that, _1gtk_1tooltips_1set_1tip_FUNC); if (arg2) if ((lparg2 = (*env)->GetByteArrayElements(env, arg2, NULL)) == NULL) goto fail; if (arg3) if ((lparg3 = (*env)->GetByteArrayElements(env, arg3, NULL)) == NULL) goto fail; - gtk_tooltips_set_tip((GtkTooltips *)arg0, (GtkWidget *)arg1, (const gchar *)lparg2, (const gchar *)lparg3); +/* + gtk_tooltips_set_tip(arg0, arg1, lparg2, lparg3); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_tooltips_set_tip) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, jintLong, jbyte *, jbyte *))fp)(arg0, arg1, lparg2, lparg3); + } + } fail: if (arg3 && lparg3) (*env)->ReleaseByteArrayElements(env, arg3, lparg3, 0); if (arg2 && lparg2) (*env)->ReleaseByteArrayElements(env, arg2, lparg2, 0); 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 d6b55b9b6cd..d993fac1cac 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,10 +19,10 @@ #define NDEBUG #define G_DISABLE_DEPRECATED +#define GTK_DISABLE_SINGLE_INCLUDES /* #define GTK_DISABLE_DEPRECATED #define GDK_DISABLE_DEPRECATED -#define GTK_DISABLE_SINGLE_INCLUDES #define GSEAL_ENABLE */ 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 b31c9ccd1fa..7481ac06d31 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 @@ -128,6 +128,7 @@ #define gtk_window_set_keep_below_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 #define gtk_tree_selection_count_selected_rows_LIB LIB_GTK #define gtk_tree_selection_get_selected_rows_LIB LIB_GTK #define gtk_tree_view_column_get_cell_renderers_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 9fd9813cbef..dc48a3d1050 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 @@ -11159,10 +11159,7 @@ public static final void gtk_tooltips_force_window(int /*long*/ tooltips) { } } /** - * @param tooltips cast=(GtkTooltips *) - * @param widget cast=(GtkWidget *) - * @param tip_text cast=(const gchar *) - * @param tip_private cast=(const gchar *) + * @method flags=dynamic */ public static final native void _gtk_tooltips_set_tip(int /*long*/ tooltips, int /*long*/ widget, byte[] tip_text, byte[] tip_private); public static final void gtk_tooltips_set_tip(int /*long*/ tooltips, int /*long*/ widget, byte[] tip_text, byte[] tip_private) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java index 8fa7d4b1fb6..530b331cdf0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java @@ -794,10 +794,14 @@ public void setVisible (boolean visible) { if (text.length () > 0) string.append ("\n\n"); string.append (message); byte [] buffer = Converter.wcsToMbcs (null, string.toString(), true); - OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); - int /*long*/ data = OS.gtk_tooltips_data_get (vboxHandle); - OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data); - OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_widget_set_tooltip_text(vboxHandle, buffer); + } else { + OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); + int /*long*/ data = OS.gtk_tooltips_data_get (vboxHandle); + OS.GTK_TOOLTIPS_SET_ACTIVE (handle, data); + OS.gtk_tooltips_set_tip (handle, vboxHandle, buffer, null); + } } if (autohide) timerId = OS.g_timeout_add (DELAY, display.windowTimerProc, handle); } else { |
