diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets')
10 files changed, 31 insertions, 23 deletions
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 2e1a82bf05..fb5160890a 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; @@ -761,7 +761,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 84c8c8fbf2..fcff42b2c1 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 @@ -872,7 +872,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 7bdb801a71..de434359d6 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 @@ -2306,7 +2306,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); @@ -3455,7 +3455,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); } @@ -3491,7 +3491,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); } @@ -3992,7 +3992,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); @@ -5077,7 +5077,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 ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) 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 5bd836678d..30b793dac8 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 @@ -401,7 +401,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)) { width = OS.GTK_WIDGET_WIDTH (parent.scrolledHandle) - 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 77cc837b35..c57fdb6de5 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 @@ -450,9 +450,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 5f63d5d518..78588a9b8b 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 @@ -283,7 +283,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 2a62e480cc..d24a5e13ac 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 @@ -501,7 +501,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; @@ -1066,7 +1066,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 c7da6c4393..562089f4db 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 @@ -459,9 +459,9 @@ 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); int /*long*/ tipWindow = OS.GTK_TOOLTIPS_TIP_WINDOW (handle); - return OS.GTK_WIDGET_VISIBLE (tipWindow); + return gtk_widget_get_visible (tipWindow); } int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { @@ -713,10 +713,10 @@ 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 { 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); } } @@ -778,7 +778,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 (); } /** @@ -819,7 +819,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 2a82fb8e45..2838dd37a5 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 @@ -388,7 +388,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 () { @@ -615,7 +615,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) { /* 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..c791d839c7 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 @@ -906,6 +906,14 @@ boolean gtk_widget_get_mapped (int /*long*/ widget) { } } +boolean gtk_widget_get_visible (int /*long*/ widget) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + return OS.gtk_widget_get_visible (widget); + } else { + return OS.GTK_WIDGET_VISIBLE (widget); + } +} + int /*long*/ gtk_window_state_event (int /*long*/ widget, int /*long*/ event) { return 0; } |