diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-01 14:59:11 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-02 09:39:42 -0400 |
commit | fed3ad1e50dcf41c4976b2be1142f80068a3a12a (patch) | |
tree | df1e13f4b6154e9565e0b922f2613471851aaa11 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | a521fb70cf0f8b26019c8a033cb117435dbcf6ed (diff) | |
download | eclipse.platform.swt-fed3ad1e50dcf41c4976b2be1142f80068a3a12a.tar.gz eclipse.platform.swt-fed3ad1e50dcf41c4976b2be1142f80068a3a12a.tar.xz eclipse.platform.swt-fed3ad1e50dcf41c4976b2be1142f80068a3a12a.zip |
Uses gtk_widget_get_sensitive instead of deprecated GTK_WIDGET_SENSITIVE
Conflicts:
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
5 files changed, 15 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index 70c058ee71..dfaa240880 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -419,7 +419,7 @@ public MenuItem getDefaultItem () { */ public boolean getEnabled () { checkWidget(); - return OS.GTK_WIDGET_SENSITIVE (handle); + return gtk_widget_get_sensitive (handle); } /** 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 5ea35ee1c4..9cf8c6bc89 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 @@ -275,7 +275,7 @@ void createHandle (int index) { OS.gtk_accel_label_set_accel_widget (label, 0); } int /*long*/ parentHandle = parent.handle; - boolean enabled = OS.GTK_WIDGET_SENSITIVE (parentHandle); + boolean enabled = gtk_widget_get_sensitive (parentHandle); if (!enabled) OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_SENSITIVE); OS.gtk_menu_shell_insert (parentHandle, handle, index); if (!enabled) OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_SENSITIVE); @@ -346,7 +346,7 @@ int /*long*/ getAccelGroup () { */ public boolean getEnabled () { checkWidget(); - return OS.GTK_WIDGET_SENSITIVE (handle); + return gtk_widget_get_sensitive (handle); } /** @@ -654,7 +654,7 @@ public void setAccelerator (int accelerator) { */ public void setEnabled (boolean enabled) { checkWidget(); - if (OS.GTK_WIDGET_SENSITIVE (handle) == enabled) return; + if (OS.gtk_widget_get_sensitive (handle) == enabled) return; int /*long*/ accelGroup = getAccelGroup (); if (accelGroup != 0) removeAccelerator (accelGroup); OS.gtk_widget_set_sensitive (handle, enabled); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java index 77cc837b35..1551418956 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java @@ -176,7 +176,7 @@ void destroyWidget () { */ public boolean getEnabled () { checkWidget (); - if (handle != 0) return OS.GTK_WIDGET_SENSITIVE (handle); + if (handle != 0) return gtk_widget_get_sensitive (handle); return true; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java index a68418e7d7..cc05d41a01 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java @@ -379,7 +379,7 @@ public Image getDisabledImage () { public boolean getEnabled () { checkWidget(); int /*long*/ topHandle = topHandle (); - return OS.GTK_WIDGET_SENSITIVE (topHandle); + return gtk_widget_get_sensitive (topHandle); } /** @@ -937,7 +937,7 @@ public void setDisabledImage (Image image) { public void setEnabled (boolean enabled) { checkWidget(); int /*long*/ topHandle = topHandle (); - if (OS.GTK_WIDGET_SENSITIVE (topHandle) == enabled) return; + if (OS.gtk_widget_get_sensitive (topHandle) == enabled) return; OS.gtk_widget_set_sensitive (topHandle, enabled); if (enabled) { /* diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index 778e9bb987..6aa4be97f3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1682,6 +1682,14 @@ int /*long*/ sizeRequestProc (int /*long*/ handle, int /*long*/ arg0, int /*long return 0; } +boolean gtk_widget_get_sensitive (int /*long*/ widget) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + return OS.gtk_widget_get_sensitive (widget); + } else { + return OS.GTK_WIDGET_SENSITIVE (widget); + } +} + /** * Returns a string containing a concise, human-readable * description of the receiver. |