summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-03 15:05:43 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-03 20:33:29 -0400
commit6a88076d643ac9b570062b746912ac639cf39eaf (patch)
tree9327e21210c6700b04b8b3140d94b508851a1157
parent88dc3a4dc3c68bb6669db018f4d6d63689ecddba (diff)
downloadeclipse.platform.swt-6a88076d643ac9b570062b746912ac639cf39eaf.tar.gz
eclipse.platform.swt-6a88076d643ac9b570062b746912ac639cf39eaf.tar.xz
eclipse.platform.swt-6a88076d643ac9b570062b746912ac639cf39eaf.zip
Bug 386594 - Use gtk_widget_get_visible instead of GTK_WIDGET_VISIBLE for newer GTK+
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java4
11 files changed, 27 insertions, 23 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
index 9c2821c9f5..114bd1a926 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
@@ -476,7 +476,7 @@ public class Accessible {
int /*long*/ temp = list;
while (temp != 0) {
int /*long*/ widget = OS.g_list_data( temp);
- if (OS.GTK_WIDGET_VISIBLE (widget)) {
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0) ? OS.gtk_widget_get_visible (widget) : OS.GTK_WIDGET_VISIBLE (widget)) {
result = widget;
break;
}
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 271d03c36e..910a624466 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
@@ -205,6 +205,7 @@
#define gtk_widget_is_composited_LIB LIB_GTK
#define gtk_widget_get_allocation_LIB LIB_GTK
#define gtk_widget_get_tooltip_text_LIB LIB_GTK
+#define gtk_widget_get_visible_LIB LIB_GTK
#define gtk_widget_has_default_LIB LIB_GTK
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_has_window_LIB LIB_GTK
@@ -384,6 +385,9 @@
#ifndef GTK_OBJECT_FLAGS
#define GTK_OBJECT_FLAGS(arg0) 0
#endif
+#ifndef GTK_WIDGET_VISIBLE
+#define GTK_WIDGET_VISIBLE(arg0) 0
+#endif
#if GTK_CHECK_VERSION(2,18,0)
#define GTK_WIDGET_HEIGHT(arg0) 0
#else
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index bc11b73d58..8a1d466bc9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -214,7 +214,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
}
}
int imageWidth = 0, imageHeight = 0;
- if (OS.GTK_WIDGET_VISIBLE (imageHandle)) {
+ if (gtk_widget_get_visible (imageHandle)) {
GtkRequisition requisition = new GtkRequisition ();
OS.gtk_widget_size_request (imageHandle, requisition);
imageWidth = requisition.width;
@@ -677,7 +677,7 @@ void _setAlignment (int alignment) {
style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
/* Alignment not honoured when image and text are visible */
- boolean bothVisible = OS.GTK_WIDGET_VISIBLE (labelHandle) && OS.GTK_WIDGET_VISIBLE (imageHandle);
+ boolean bothVisible = gtk_widget_get_visible (labelHandle) && gtk_widget_get_visible (imageHandle);
if (bothVisible) {
if ((style & (SWT.RADIO | SWT.CHECK)) != 0) alignment = SWT.LEFT;
if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) alignment = SWT.CENTER;
@@ -770,7 +770,7 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
OS.pango_layout_get_size (labelLayout, w, h);
OS.pango_layout_set_width (labelLayout, pangoWidth);
int imageWidth = 0;
- if (OS.GTK_WIDGET_VISIBLE (imageHandle)) {
+ if (gtk_widget_get_visible (imageHandle)) {
GtkRequisition requisition = new GtkRequisition ();
OS.gtk_widget_size_request (imageHandle, requisition);
imageWidth = requisition.width;
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 efaa7dddf5..695e23ebc9 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
@@ -902,7 +902,7 @@ public String [] getItems () {
*/
public boolean getListVisible () {
checkWidget ();
- return popupHandle != 0 && OS.GTK_WIDGET_VISIBLE (popupHandle);
+ return popupHandle != 0 && gtk_widget_get_visible (popupHandle);
}
String getNameText () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 6fb59684c9..46c7f8a438 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -2374,7 +2374,7 @@ int /*long*/ fixedMapProc (int /*long*/ widget) {
int /*long*/ widgets = widgetList;
while (widgets != 0) {
int /*long*/ child = OS.g_list_data (widgets);
- if (OS.GTK_WIDGET_VISIBLE (child) && OS.gtk_widget_get_child_visible (child) && !gtk_widget_get_mapped (child)) {
+ if (gtk_widget_get_visible (child) && OS.gtk_widget_get_child_visible (child) && !gtk_widget_get_mapped (child)) {
OS.gtk_widget_map (child);
}
widgets = OS.g_list_next (widgets);
@@ -3523,7 +3523,7 @@ public void redraw () {
void redraw (boolean all) {
// checkWidget();
- if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return;
+ if (!gtk_widget_get_visible (topHandle ())) return;
redrawWidget (0, 0, 0, 0, true, all, false);
}
@@ -3559,7 +3559,7 @@ void redraw (boolean all) {
*/
public void redraw (int x, int y, int width, int height, boolean all) {
checkWidget();
- if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return;
+ if (!gtk_widget_get_visible (topHandle ())) return;
if ((style & SWT.MIRRORED) != 0) x = getClientWidth () - width - x;
redrawWidget (x, y, width, height, false, all, false);
}
@@ -4070,7 +4070,7 @@ public void setEnabled (boolean enabled) {
} else {
restackWindow (enableWindow, OS.GTK_WIDGET_WINDOW (topHandle), true);
}
- if (OS.GTK_WIDGET_VISIBLE (topHandle)) OS.gdk_window_show_unraised (enableWindow);
+ if (gtk_widget_get_visible (topHandle)) OS.gdk_window_show_unraised (enableWindow);
}
}
if (fixFocus) fixFocus (control);
@@ -5165,7 +5165,7 @@ public void update () {
void update (boolean all, boolean flush) {
// checkWidget();
- if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return;
+ if (!gtk_widget_get_visible (topHandle ())) return;
if (!gtk_widget_get_realized (handle)) return;
int /*long*/ window = paintWindow ();
if (flush) display.flushExposes (window, all);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
index c354332c85..8a53c5cdc2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
@@ -424,7 +424,7 @@ void resizeControl (int yScroll) {
*/
ScrollBar vBar = parent.verticalBar;
if (vBar != null) {
- if (OS.GTK_WIDGET_VISIBLE (vBar.handle)) {
+ if (gtk_widget_get_visible (vBar.handle)) {
if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
OS.gtk_widget_get_allocation(parent.scrolledHandle, allocation);
width = allocation.width - parent.vScrollBarWidth () - 2 * parent.spacing;
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 ac426e3c69..8172a57080 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
@@ -490,9 +490,9 @@ public boolean getVisible () {
int [] hsp = new int [1], vsp = new int [1];
OS.gtk_scrolled_window_get_policy (scrolledHandle, hsp, vsp);
if ((style & SWT.HORIZONTAL) != 0) {
- return hsp [0] != OS.GTK_POLICY_NEVER && OS.GTK_WIDGET_VISIBLE(handle);
+ return hsp [0] != OS.GTK_POLICY_NEVER && gtk_widget_get_visible (handle);
} else {
- return vsp [0] != OS.GTK_POLICY_NEVER && OS.GTK_WIDGET_VISIBLE(handle);
+ return vsp [0] != OS.GTK_POLICY_NEVER && gtk_widget_get_visible (handle);
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
index 8feccf7df0..a2e8c07f8a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
@@ -296,7 +296,7 @@ int /*long*/ gtk_scroll_event (int /*long*/ widget, int /*long*/ eventPtr) {
} else {
scrollBar = horizontalBar;
}
- if (scrollBar != null && !OS.GTK_WIDGET_VISIBLE (scrollBar.handle) && scrollBar.getEnabled()) {
+ if (scrollBar != null && !gtk_widget_get_visible (scrollBar.handle) && scrollBar.getEnabled()) {
GtkAdjustment adjustment = new GtkAdjustment ();
OS.memmove (adjustment, scrollBar.adjustmentHandle);
/* Calculate wheel delta to match GTK+ 2.4 and higher */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index 78f8e6ea52..bd91287d3d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -510,7 +510,7 @@ void adjustTrim () {
}
void bringToTop (boolean force) {
- if (!OS.GTK_WIDGET_VISIBLE (shellHandle)) return;
+ if (!gtk_widget_get_visible (shellHandle)) return;
Display display = this.display;
Shell activeShell = display.activeShell;
if (activeShell == this) return;
@@ -1106,7 +1106,7 @@ public Point getSize () {
public boolean getVisible () {
checkWidget();
- return OS.GTK_WIDGET_VISIBLE (shellHandle);
+ return gtk_widget_get_visible (shellHandle);
}
/**
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 dc4ff1f1df..53ef0845bc 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
@@ -464,7 +464,7 @@ public String getText () {
*/
public boolean getVisible () {
checkWidget ();
- if ((style & SWT.BALLOON) != 0) return OS.GTK_WIDGET_VISIBLE (handle);
+ if ((style & SWT.BALLOON) != 0) return gtk_widget_get_visible (handle);
if (OS.GTK_VERSION < OS.VERSION (2, 12, 0)) {
int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (handle);
return OS.GTK_WIDGET_VISIBLE (tipWindow);
@@ -734,11 +734,11 @@ public void setLocation (int x, int y) {
this.x = x;
this.y = y;
if ((style & SWT.BALLOON) != 0) {
- if (OS.GTK_WIDGET_VISIBLE (handle)) configure ();
+ if (gtk_widget_get_visible (handle)) configure ();
} else {
if (OS.GTK_VERSION < OS.VERSION (2, 12, 0)) {
int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (handle);
- if (OS.GTK_WIDGET_VISIBLE (tipWindow)) {
+ if (gtk_widget_get_visible (tipWindow)) {
OS.gtk_window_move (tipWindow, x, y);
}
}
@@ -801,7 +801,7 @@ public void setMessage (String string) {
}
OS.pango_layout_set_wrap (layoutMessage, OS.PANGO_WRAP_WORD_CHAR);
}
- if (OS.GTK_WIDGET_VISIBLE (handle)) configure ();
+ if (gtk_widget_get_visible (handle)) configure ();
}
/**
@@ -842,7 +842,7 @@ public void setText (String string) {
OS.pango_attr_list_unref (attrList);
OS.pango_layout_set_wrap (layoutText, OS.PANGO_WRAP_WORD_CHAR);
}
- if (OS.GTK_WIDGET_VISIBLE (handle)) configure ();
+ if (gtk_widget_get_visible (handle)) configure ();
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
index a13c3141b3..ac59b4c9c0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java
@@ -397,7 +397,7 @@ public boolean getVisible () {
if (OS.GTK_VERSION >= OS.VERSION (2, 10, 0)) {
return OS.gtk_status_icon_get_visible (handle);
}
- return OS.GTK_WIDGET_VISIBLE (handle);
+ return gtk_widget_get_visible (handle);
}
void register () {
@@ -625,7 +625,7 @@ public void setVisible (boolean visible) {
if (OS.GTK_VERSION >= OS.VERSION (2, 10, 0)) {
if(OS.gtk_status_icon_get_visible (handle) == visible) return;
} else {
- if (OS.GTK_WIDGET_VISIBLE (handle) == visible) return;
+ if (gtk_widget_get_visible (handle) == visible) return;
}
if (visible) {
/*