Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2019-01-24 17:20:57 -0500
committerEric Williams2019-01-25 11:41:01 -0500
commit9e36dacf9e3ff7815d0b9e297c84970b37c159fa (patch)
treedecf93d9c01d8403dc535344b44f0f01241b09d8
parentdb19ffcd2efc5e4704166ad3a02c668756e77d85 (diff)
downloadeclipse.platform.swt-9e36dacf9e3ff7815d0b9e297c84970b37c159fa.tar.gz
eclipse.platform.swt-9e36dacf9e3ff7815d0b9e297c84970b37c159fa.tar.xz
eclipse.platform.swt-9e36dacf9e3ff7815d0b9e297c84970b37c159fa.zip
Bug 543806: [GTK4] Remove style property accessors
Disable gtk_widget_get_style() calls on GTK4 until proper replacements have been found. Change-Id: I06414d09e7b1379a3a34a1c988b78a129f2a0f37 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java8
-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.java8
-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/Spinner.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java4
10 files changed, 23 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 8aa2f78bec..0224ce8895 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
@@ -201,16 +201,16 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
if (wrap) {
int borderWidth = gtk_container_get_border_width_or_margin (handle);
int[] focusWidth = new int[1];
- GTK.gtk_widget_style_get (handle, OS.focus_line_width, focusWidth, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.focus_line_width, focusWidth, 0);
int[] focusPadding = new int[1];
- GTK.gtk_widget_style_get (handle, OS.focus_padding, focusPadding, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.focus_padding, focusPadding, 0);
int trimWidth = 2 * (borderWidth + focusWidth [0] + focusPadding [0]), trimHeight = trimWidth;
int indicatorHeight = 0;
if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {
int[] indicatorSize = new int[1];
- GTK.gtk_widget_style_get (handle, OS.indicator_size, indicatorSize, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.indicator_size, indicatorSize, 0);
int[] indicatorSpacing = new int[1];
- GTK.gtk_widget_style_get (handle, OS.indicator_spacing, indicatorSpacing, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.indicator_spacing, indicatorSpacing, 0);
indicatorHeight = indicatorSize [0] + 2 * indicatorSpacing [0];
trimWidth += indicatorHeight + indicatorSpacing [0];
} else {
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 5a8e92a04f..f26e2b8c9f 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
@@ -454,7 +454,7 @@ void resizeControl (int yScroll) {
int width = allocation.width;
int height = allocation.height;
int [] property = new int [1];
- GTK.gtk_widget_style_get (handle, OS.focus_line_width, property, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.focus_line_width, property, 0);
y += property [0] * 2;
height -= property [0] * 2;
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 6aea071f21..6a2da2e7f3 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
@@ -407,13 +407,13 @@ Rectangle getThumbTrackBoundsInPixels () {
checkWidget();
int x = 0, y = 0, width, height;
int[] has_stepper = new int[1];
- GTK.gtk_widget_style_get (handle, OS.has_backward_stepper, has_stepper, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.has_backward_stepper, has_stepper, 0);
boolean hasB = has_stepper[0] != 0;
- GTK.gtk_widget_style_get (handle, OS.has_secondary_backward_stepper, has_stepper, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.has_secondary_backward_stepper, has_stepper, 0);
boolean hasB2 = has_stepper[0] != 0;
- GTK.gtk_widget_style_get (handle, OS.has_forward_stepper, has_stepper, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.has_forward_stepper, has_stepper, 0);
boolean hasF = has_stepper[0] != 0;
- GTK.gtk_widget_style_get (handle, OS.has_secondary_forward_stepper, has_stepper, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.has_secondary_forward_stepper, has_stepper, 0);
boolean hasF2 = has_stepper[0] != 0;
GtkAllocation allocation = new GtkAllocation ();
GTK.gtk_widget_get_allocation (handle, allocation);
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 2458651512..b890aa9b52 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
@@ -531,7 +531,7 @@ private Point scrollBarSize(long /*int*/ scrollBarHandle) {
}
gtk_widget_get_preferred_size (scrollBarHandle, requisition);
int [] padding = new int [1];
- GTK.gtk_widget_style_get(scrolledHandle, OS.scrollbar_spacing, padding, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get(scrolledHandle, OS.scrollbar_spacing, padding, 0);
int spacing = padding[0];
return new Point(requisition.width + spacing, requisition.height + spacing);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index 7c18d10fd9..727a982651 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -265,7 +265,7 @@ Rectangle computeTrimInPixels (int x, int y, int width, int height) {
trim.height += tmp.top + tmp.bottom;
}
int [] property = new int [1];
- GTK.gtk_widget_style_get (handle, OS.interior_focus, property, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.interior_focus, property, 0);
if (property [0] == 0) {
GTK.gtk_widget_style_get (handle, OS.focus_line_width, property, 0);
xborder += property [0];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 3bbf10d6d3..482ba38a71 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -194,7 +194,7 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
Point notebookSize = computeNativeSize (handle, wHint, hHint, changed);
GTK.gtk_notebook_set_scrollable (handle, scrollable);
int[] initialGap = new int[1];
- GTK.gtk_widget_style_get (handle, OS.initial_gap, initialGap, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.initial_gap, initialGap, 0);
notebookSize.x += initialGap[0]*2;
size.x = Math.max (notebookSize.x, size.x);
size.y = Math.max (notebookSize.y, size.y);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index f5af2b0ea9..a8185c83df 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -319,10 +319,10 @@ Rectangle getBoundsinPixels () {
rect.width = w [0];
int [] buffer = new int [1];
if (GTK.gtk_tree_view_get_expander_column (parentHandle) == column) {
- GTK.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0);
rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING;
}
- GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
int horizontalSeparator = buffer[0];
rect.x += horizontalSeparator;
@@ -748,10 +748,10 @@ Rectangle getTextBoundsInPixels (int index) {
parent.ignoreSize = false;
int [] buffer = new int [1];
if (GTK.gtk_tree_view_get_expander_column (parentHandle) == column) {
- GTK.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0);
rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING;
}
- GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
int horizontalSeparator = buffer[0];
rect.x += horizontalSeparator;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index 31d1279a82..2ddd9ab39a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -661,9 +661,9 @@ Rectangle computeTrimInPixels (int x, int y, int width, int height) {
yborder += borderWidth;
}
int [] property = new int [1];
- GTK.gtk_widget_style_get (handle, OS.interior_focus, property, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.interior_focus, property, 0);
if (property [0] == 0) {
- GTK.gtk_widget_style_get (handle, OS.focus_line_width, property, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.focus_line_width, property, 0);
xborder += property [0];
yborder += property [0];
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 33d42f4758..80af7c4ae6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -443,11 +443,11 @@ int calculateWidth (long /*int*/ column, long /*int*/ iter, boolean recurse) {
width += rect.x;
/* expander */
if (!GTK.gtk_tree_view_column_get_visible(column)) {
- GTK.gtk_widget_style_get (handle, OS.expander_size, w, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.expander_size, w, 0);
width += w [0] + TreeItem.EXPANDER_EXTRA_PADDING;
}
}
- GTK.gtk_widget_style_get(handle, OS.focus_line_width, w, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get(handle, OS.focus_line_width, w, 0);
width += 2 * w [0];
long /*int*/ list = GTK.gtk_cell_layout_get_cells(column);
if (list == 0) return 0;
@@ -478,7 +478,7 @@ int calculateWidth (long /*int*/ column, long /*int*/ iter, boolean recurse) {
if (path != 0) GTK.gtk_tree_path_free (path);
if (GTK.gtk_tree_view_get_grid_lines(handle) > GTK.GTK_TREE_VIEW_GRID_LINES_NONE) {
- GTK.gtk_widget_style_get (handle, OS.grid_line_width, w, 0) ;
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (handle, OS.grid_line_width, w, 0) ;
width += 2 * w [0];
}
return width;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index cdc66eae45..4e8d1aaaf2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -509,7 +509,7 @@ Rectangle getBoundsInPixels () {
int [] buffer = new int [1];
GTK.gtk_tree_path_free (path);
- GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
int horizontalSeparator = buffer[0];
rect.x += horizontalSeparator;
@@ -971,7 +971,7 @@ Rectangle getTextBoundsInPixels (int index) {
int [] buffer = new int [1];
GTK.gtk_tree_path_free (path);
- GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
+ if (!GTK.GTK4) GTK.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0);
int horizontalSeparator = buffer[0];
rect.x += horizontalSeparator;
gtk_tree_view_column_cell_get_position (column, textRenderer, x, null);

Back to the top