summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-09-07 12:09:23 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-09-07 12:10:08 -0400
commit1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591 (patch)
tree69dd62e55d4e278e0a78b1d545cafafcddc2d025
parentf29e60c3bf36f15f433cda3ac2ae070ac635dffc (diff)
downloadeclipse.platform.swt-1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591.tar.gz
eclipse.platform.swt-1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591.tar.xz
eclipse.platform.swt-1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591.zip
Bug 386893 - Omit use of deprecated GTK_ACCEL_LABEL_SET_ACCEL_STRING and
GTK_ACCEL_LABEL_GET_ACCEL_STRING
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java16
2 files changed, 14 insertions, 7 deletions
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 5bfcd14321..b258d51b75 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
@@ -378,8 +378,13 @@
/* Field accessors */
#define G_OBJECT_CLASS_CONSTRUCTOR(arg0) (arg0)->constructor
#define G_OBJECT_CLASS_SET_CONSTRUCTOR(arg0, arg1) (arg0)->constructor = (GObject* (*) (GType, guint, GObjectConstructParam *))arg1
+#if GTK_CHECK_VERSION(3,0,0)
+#define GTK_ACCEL_LABEL_SET_ACCEL_STRING(arg0, arg1)
+#define GTK_ACCEL_LABEL_GET_ACCEL_STRING(arg0) 0
+#else
#define GTK_ACCEL_LABEL_SET_ACCEL_STRING(arg0, arg1) (arg0)->accel_string = arg1
#define GTK_ACCEL_LABEL_GET_ACCEL_STRING(arg0) (arg0)->accel_string
+#endif
#if GTK_CHECK_VERSION(2,20,0)
#define GTK_RANGE_SLIDER_START(arg0) 0
#else
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 40c3504191..f05769a34c 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
@@ -884,13 +884,15 @@ public void setText (String string) {
int /*long*/ label = OS.gtk_bin_get_child (handle);
if (label != 0 && OS.GTK_IS_LABEL(label)) {
OS.gtk_label_set_text_with_mnemonic (label, buffer);
- buffer = Converter.wcsToMbcs (null, accelString, true);
- int /*long*/ ptr = OS.g_malloc (buffer.length);
- OS.memmove (ptr, buffer, buffer.length);
- if (OS.GTK_IS_ACCEL_LABEL(label)) {
- int /*long*/ oldPtr = OS.GTK_ACCEL_LABEL_GET_ACCEL_STRING (label);
- OS.GTK_ACCEL_LABEL_SET_ACCEL_STRING (label, ptr);
- if (oldPtr != 0) OS.g_free (oldPtr);
+ if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) {
+ if (OS.GTK_IS_ACCEL_LABEL(label)) {
+ buffer = Converter.wcsToMbcs (null, accelString, true);
+ int /*long*/ ptr = OS.g_malloc (buffer.length);
+ OS.memmove (ptr, buffer, buffer.length);
+ int /*long*/ oldPtr = OS.GTK_ACCEL_LABEL_GET_ACCEL_STRING (label);
+ OS.GTK_ACCEL_LABEL_SET_ACCEL_STRING (label, ptr);
+ if (oldPtr != 0) OS.g_free (oldPtr);
+ }
}
}
}