diff options
author | Alexander Kurtakov | 2016-01-13 12:31:20 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-01-13 14:11:56 +0000 |
commit | be1e40be8a29256b9afb7e0499ed71f5c342fabf (patch) | |
tree | f6cf2641805d4d32f19c7c61e30d05fc182d61da | |
parent | af6ff22aa421db7125839c2ff4ca47e1287f50f9 (diff) | |
download | eclipse.platform.swt-be1e40be8a29256b9afb7e0499ed71f5c342fabf.tar.gz eclipse.platform.swt-be1e40be8a29256b9afb7e0499ed71f5c342fabf.tar.xz eclipse.platform.swt-be1e40be8a29256b9afb7e0499ed71f5c342fabf.zip |
Bug 485548 - Selecting date causes crash in Ubuntu 15.10
When on GTK3 GtkStyleContext should be used instead of GtkStyle. Adjust
accordingly.
Change-Id: Ibbee264edcdf94e61f528e80bd51b808a0805080
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
10 files changed, 47 insertions, 56 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java index fe25e9162e..943df8e5ca 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java @@ -29,7 +29,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ drawable = gc.getGCData().drawable; if ((style & SWT.RADIO) != 0) { long /*int*/ radioButtonHandle = theme.radioButtonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (radioButtonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (radioButtonHandle); theme.transferClipping (gc, gtkStyle); int indicator_size = theme.getWidgetProperty(radioButtonHandle, "indicator-size"); int indicator_spacing = theme.getWidgetProperty(radioButtonHandle, "indicator-spacing"); @@ -124,7 +124,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { if ((style & SWT.PUSH) != 0) { long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (buttonHandle); theme.transferClipping (gc, gtkStyle); int focus_line_width = theme.getWidgetProperty(buttonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); @@ -220,8 +220,7 @@ int hit(Theme theme, Point position, Rectangle bounds) { void gtk_render_option (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_option (context, window, x, y, width, height); + OS.gtk_render_option (style, window, x, y, width, height); } else { OS.gtk_paint_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); } @@ -229,8 +228,7 @@ void gtk_render_option (long /*int*/ style, long /*int*/ window, int state_type, void gtk_render_check(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_check (context, window, x, y, width, height); + OS.gtk_render_check (style, window, x, y, width, height); } else { OS.gtk_paint_check (style, window, state_type, shadow_type, null, widget, detail, x, y, width, height); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java index 50250cba96..9c11665106 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java @@ -26,7 +26,7 @@ public ComboDrawData() { @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style(buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style(buttonHandle); long /*int*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); @@ -66,7 +66,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { gtk_render_arrow (gtkStyle, drawable, state_type, OS.GTK_SHADOW_OUT, null, arrowHandle, arrow_detail, OS.GTK_ARROW_DOWN, true, arrow_x, arrow_y, arrow_width, arrow_height); long /*int*/ entryHandle = theme.entryHandle; - gtkStyle = OS.gtk_widget_get_style(entryHandle); + gtkStyle = gtk_widget_get_style(entryHandle); theme.transferClipping(gc, gtkStyle); state_type = getStateType(DrawData.WIDGET_WHOLE); byte[] detail = Converter.wcsToMbcs(null, "entry", true); @@ -104,7 +104,7 @@ int getStateType(int part) { int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style(buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style(buttonHandle); int interior_focus = theme.getWidgetProperty(buttonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(buttonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); @@ -127,10 +127,9 @@ int hit(Theme theme, Point position, Rectangle bounds) { void gtk_render_shadow(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_style_context_save(context); + OS.gtk_style_context_save(style); OS.gtk_style_context_set_state (style, state_type); - OS.gtk_render_frame (context, window, x, y, width, height); + OS.gtk_render_frame (style, window, x, y, width, height); } else { OS.gtk_paint_shadow(style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java index 3a0f947bd7..316c2a1f85 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java @@ -92,7 +92,7 @@ void drawImage(Theme theme, Image image, GC gc, Rectangle bounds) { OS.gtk_icon_source_set_pixbuf(source, pixbuf); //TODO - always uses buttonHandle long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (buttonHandle); theme.transferClipping(gc, gtkStyle); long /*int*/ rendered = OS.gtk_style_render_icon(gtkStyle, source, OS.GTK_TEXT_DIR_NONE, state_type, -1, buttonHandle, null); OS.g_object_unref(pixbuf); @@ -116,7 +116,7 @@ void drawImage(Theme theme, Image image, GC gc, Rectangle bounds) { void drawText(Theme theme, String text, int flags, GC gc, Rectangle bounds) { long /*int*/ widget = getTextHandle(theme); - long /*int*/ gtkStyle = OS.gtk_widget_get_style(widget); + long /*int*/ gtkStyle = gtk_widget_get_style(widget); long /*int*/ drawable = gc.getGCData().drawable; theme.transferClipping (gc, gtkStyle); byte[] buffer = Converter.wcsToMbcs(null, text, true); @@ -199,8 +199,7 @@ Rectangle measureText(Theme theme, String text, int flags, GC gc, Rectangle boun void gtk_render_frame (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_frame (context, window, x, y, width, height); + OS.gtk_render_frame (style, window, x, y, width, height); } else { OS.gtk_paint_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); } @@ -208,9 +207,8 @@ void gtk_render_frame (long /*int*/ style, long /*int*/ window, int state_type, void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_frame (context, window, x, y, width, height); - OS.gtk_render_background (context, window, x, y, width, height); + OS.gtk_render_frame (style, window, x, y, width, height); + OS.gtk_render_background (style, window, x, y, width, height); } else { OS.gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); } @@ -219,8 +217,7 @@ void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, in void gtk_render_layout (long /*int*/ style, long /*int*/ window, int state_type, boolean use_text, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, long /*int*/ layout) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_layout (context, window, x, y, layout); + OS.gtk_render_layout (style, window, x, y, layout); } else { OS.gtk_paint_layout (style, window, state_type, use_text, area, widget, detail, x , y, layout); } @@ -228,13 +225,12 @@ void gtk_render_layout (long /*int*/ style, long /*int*/ window, int state_type, void gtk_render_focus (long /*int*/ style, long /*int*/ window, int state_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_style_context_save (context); - OS.gtk_style_context_set_state (context, OS.gtk_widget_get_state_flags (widget)); + OS.gtk_style_context_save (style); + OS.gtk_style_context_set_state (style, OS.gtk_widget_get_state_flags (widget)); Cairo.cairo_save (window); - OS.gtk_render_focus(context, window, x, y, width, height); + OS.gtk_render_focus(style, window, x, y, width, height); Cairo.cairo_restore (window); - OS.gtk_style_context_restore (context); + OS.gtk_style_context_restore (style); } else { OS.gtk_paint_focus (style, window, state_type, area, widget, detail, x, y, width, height); @@ -263,14 +259,18 @@ void gtk_render_arrow(long /*int*/ style, long /*int*/ window, int state_type, i size = height; break; } - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_style_context_set_state(context, state_type); - OS.gtk_render_background(context, window, x, y, width, height); - OS.gtk_render_frame (context, window, x, y, width, height); - OS.gtk_render_arrow(context, window, angle, x, y, size); + OS.gtk_style_context_set_state(style, state_type); + OS.gtk_render_background(style, window, x, y, width, height); + OS.gtk_render_frame (style, window, x, y, width, height); + OS.gtk_render_arrow(style, window, angle, x, y, size); } else { OS.gtk_paint_arrow(style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height); } } +long /*int*/ gtk_widget_get_style(long /*int*/ handle) { + return OS.GTK3 ? OS.gtk_widget_get_style_context(handle) : OS.gtk_widget_get_style(handle); +} + + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java index 982a9db533..d88107e2b4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java @@ -24,7 +24,7 @@ public ExpanderDrawData() { @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ treeHandle = theme.treeHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (treeHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (treeHandle); long /*int*/ drawable = OS.GTK3 ? gc.getGCData().cairo : gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int state_type = getStateType(DrawData.WIDGET_WHOLE); @@ -35,8 +35,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { int x = bounds.x + expander_size / 2; int y = bounds.y + expander_size / 2; if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (gtkStyle); - OS.gtk_render_expander (context, drawable, bounds.x, bounds.y, expander_size, expander_size); + OS.gtk_render_expander (gtkStyle, drawable, bounds.x, bounds.y, expander_size, expander_size); } else { OS.gtk_paint_expander(gtkStyle, drawable, state_type, null, treeHandle, detail, x, y, expander_style); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java index 6b793ea6e6..118ca1e297 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/GroupDrawData.java @@ -31,7 +31,7 @@ static final int GROUP_HEADER_PAD = 2; @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ frameHandle = theme.frameHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (frameHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (frameHandle); long /*int*/ drawable = OS.GTK3 ? gc.getGCData().cairo : gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); @@ -70,10 +70,9 @@ int hit(Theme theme, Point position, Rectangle bounds) { void gtk_render_shadow_gap (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height, int gap_side, int gap_x, int gap_width) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_style_context_save (context); - OS.gtk_style_context_set_state (context, state_type); - OS.gtk_render_frame_gap (context, window, context, y, gap_width, height, gap_side, gap_x, gap_x + gap_width); + OS.gtk_style_context_save (style); + OS.gtk_style_context_set_state (style, state_type); + OS.gtk_render_frame_gap (style, window, style, y, gap_width, height, gap_side, gap_x, gap_x + gap_width); } else { OS.gtk_paint_shadow_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java index 1a8249210c..045e39a7f2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java @@ -24,7 +24,7 @@ public ProgressBarDrawData() { @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ progressHandle = theme.progressHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (progressHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (progressHandle); long /*int*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); byte[] detail = Converter.wcsToMbcs(null, "trough", true); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java index beda20329f..84e9d4c4b2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java @@ -33,7 +33,7 @@ public TabFolderDrawData() { @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ notebookHandle = theme.notebookHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (notebookHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (notebookHandle); long /*int*/ drawable = OS.GTK3 ? gc.getGCData().cairo : gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; @@ -69,8 +69,7 @@ int hit(Theme theme, Point position, Rectangle bounds) { void gtk_render_frame_gap (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height, int gap_side, int gap_x, int gap_width) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_frame_gap (context, window, context, y, gap_width, height, gap_side, gap_x, gap_x + gap_width); + OS.gtk_render_frame_gap (style, window, style, y, gap_width, height, gap_side, gap_x, gap_x + gap_width); } else { OS.gtk_paint_box_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java index de90090216..7006467096 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java @@ -29,7 +29,7 @@ public TabItemDrawData() { @Override Rectangle computeTrim(Theme theme, GC gc) { long /*int*/ notebookHandle = theme.notebookHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style(notebookHandle); + long /*int*/ gtkStyle = gtk_widget_get_style(notebookHandle); int hborder = theme.getWidgetProperty(notebookHandle, "tab-hborder"); int vborder = theme.getWidgetProperty(notebookHandle, "tab-vborder"); int focus_width = theme.getWidgetProperty(notebookHandle, "focus-line-width"); @@ -47,7 +47,7 @@ Rectangle computeTrim(Theme theme, GC gc) { @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ notebookHandle = theme.notebookHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (notebookHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (notebookHandle); long /*int*/ drawable = OS.GTK3 ? gc.getGCData().cairo : gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; @@ -94,8 +94,7 @@ int hit(Theme theme, Point position, Rectangle bounds) { void gtk_render_extension(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height, int gap_side) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (style); - OS.gtk_render_extension(context, window, x, y, width, height, gap_side); + OS.gtk_render_extension(style, window, x, y, width, height, gap_side); } else { OS.gtk_paint_extension (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java index 553d93b0dc..8d7aa3757a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java @@ -23,7 +23,7 @@ public ToolBarDrawData() { @Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ toolbarHandle = theme.toolbarHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (toolbarHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (toolbarHandle); long /*int*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java index d422015ed1..ff20e883ee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java @@ -29,7 +29,7 @@ public ToolItemDrawData() { @Override Rectangle computeTrim(Theme theme, GC gc) { long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style(buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style(buttonHandle); int focus_width = theme.getWidgetProperty(buttonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); @@ -55,19 +55,17 @@ void draw(Theme theme, GC gc, Rectangle bounds) { int state_type = getStateType(DrawData.WIDGET_WHOLE); long /*int*/ separatorHandle = theme.separatorHandle; byte[] detail = Converter.wcsToMbcs(null, "vseparator", true); - long /*int*/ gtkStyle = OS.gtk_widget_get_style (separatorHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (separatorHandle); theme.transferClipping(gc, gtkStyle); if ((parent.style & SWT.VERTICAL) != 0) { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (separatorHandle); - OS.gtk_render_line (context, drawable, bounds.x, bounds.y + bounds.height / 2, bounds.x + bounds.width, bounds.y + bounds.height / 2); + OS.gtk_render_line (gtkStyle, drawable, bounds.x, bounds.y + bounds.height / 2, bounds.x + bounds.width, bounds.y + bounds.height / 2); } else { OS.gtk_paint_hline(gtkStyle, drawable, state_type, null, separatorHandle, detail, bounds.x, bounds.x + bounds.width, bounds.y + bounds.height / 2); } } else { if (OS.GTK3) { - long /*int*/ context = OS.gtk_widget_get_style_context (separatorHandle); - OS.gtk_render_line (context, drawable, bounds.x + bounds.width / 2, bounds.y, bounds.x + bounds.width / 2, bounds.y + bounds.height); + OS.gtk_render_line (gtkStyle, drawable, bounds.x + bounds.width / 2, bounds.y, bounds.x + bounds.width / 2, bounds.y + bounds.height); } else { OS.gtk_paint_vline(gtkStyle, drawable, state_type, null, separatorHandle, detail, bounds.y, bounds.y + bounds.height, bounds.x + bounds.width / 2); } @@ -76,7 +74,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { } long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (buttonHandle); theme.transferClipping (gc, gtkStyle); int focus_line_width = theme.getWidgetProperty(buttonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); @@ -160,7 +158,7 @@ int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; if ((style & SWT.DROP_DOWN) != 0) { long /*int*/ buttonHandle = theme.buttonHandle; - long /*int*/ gtkStyle = OS.gtk_widget_get_style (buttonHandle); + long /*int*/ gtkStyle = gtk_widget_get_style (buttonHandle); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); int interior_focus = theme.getWidgetProperty(buttonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(buttonHandle, "focus-line-width"); |