@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; if ((style & SWT.DROP_DOWN) != 0) { int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); int arrow_width = ARROW_WIDTH; int arrow_x = bounds.x + bounds.width - arrow_width - xthickness - focus_padding; if (interior_focus == 0) arrow_x -= focus_line_width; if (arrow_x <= position.x) return DrawData.TOOLITEM_ARROW; } return DrawData.WIDGET_WHOLE; }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; if ((style & SWT.DROP_DOWN) != 0) { int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); int arrow_width = ARROW_WIDTH; int arrow_x = bounds.x + bounds.width - arrow_width - xthickness - focus_padding; if (interior_focus == 0) arrow_x -= focus_line_width; if (arrow_x <= position.x) return DrawData.TOOLITEM_ARROW; } return DrawData.WIDGET_WHOLE; }
@Override 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 = 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"); int focus_padding = theme.getWidgetProperty(buttonHandle, "focus-padding"); int arrow_width = ARROW_WIDTH; int arrow_x = bounds.x + bounds.width - arrow_width - xthickness - focus_padding; if (interior_focus == 0) arrow_x -= focus_line_width; if (arrow_x <= position.x) return DrawData.TOOLITEM_ARROW; } return DrawData.WIDGET_WHOLE; }
@Override Rectangle computeTrim(Theme theme, GC gc) { int /*long*/ notebookHandle = theme.notebookHandle; int /*long*/ 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"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); int ythickness = OS.gtk_style_get_ythickness(gtkStyle); int borderX = xthickness + TAB_CURVATURE + focus_width + hborder; int borderY = ythickness + TAB_CURVATURE + focus_width + vborder; int x = clientArea.x - borderX; int y = clientArea.y - borderY; int width = clientArea.width + 2 * borderX; int height = clientArea.height + 2 * borderY; return new Rectangle(x, y, width, height); }
@Override Rectangle computeTrim(Theme theme, GC gc) { long /*int*/ notebookHandle = theme.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"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); int ythickness = OS.gtk_style_get_ythickness(gtkStyle); int borderX = xthickness + TAB_CURVATURE + focus_width + hborder; int borderY = ythickness + TAB_CURVATURE + focus_width + vborder; int x = clientArea.x - borderX; int y = clientArea.y - borderY; int width = clientArea.width + 2 * borderX; int height = clientArea.height + 2 * borderY; return new Rectangle(x, y, width, height); }
@Override Rectangle computeTrim(Theme theme, GC gc) { int /*long*/ notebookHandle = theme.notebookHandle; int /*long*/ 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"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); int ythickness = OS.gtk_style_get_ythickness(gtkStyle); int borderX = xthickness + TAB_CURVATURE + focus_width + hborder; int borderY = ythickness + TAB_CURVATURE + focus_width + vborder; int x = clientArea.x - borderX; int y = clientArea.y - borderY; int width = clientArea.width + 2 * borderX; int height = clientArea.height + 2 * borderY; return new Rectangle(x, y, width, height); }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; long /*int*/ buttonHandle = theme.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"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); // int ythickness = OS.gtk_style_get_xthickness(gtkStyle); int arrow_width = MIN_ARROW_SIZE; int x_border = xthickness + focus_padding; //int y_border = ythickness + focus_padding; if (interior_focus == 0) { x_border += focus_line_width; //y_border += focus_line_width; } int arrow_button_width = arrow_width + x_border * 2; int arrow_button_x = bounds.x + bounds.width - arrow_button_width; Rectangle arrowRect = new Rectangle(arrow_button_x, bounds.y, arrow_button_width, bounds.height); if (arrowRect.contains(position)) return DrawData.COMBO_ARROW; return DrawData.WIDGET_WHOLE; }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); // int ythickness = OS.gtk_style_get_xthickness(gtkStyle); int arrow_width = MIN_ARROW_SIZE; int x_border = xthickness + focus_padding; //int y_border = ythickness + focus_padding; if (interior_focus == 0) { x_border += focus_line_width; //y_border += focus_line_width; } int arrow_button_width = arrow_width + x_border * 2; int arrow_button_x = bounds.x + bounds.width - arrow_button_width; Rectangle arrowRect = new Rectangle(arrow_button_x, bounds.y, arrow_button_width, bounds.height); if (arrowRect.contains(position)) return DrawData.COMBO_ARROW; return DrawData.WIDGET_WHOLE; }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); // int ythickness = OS.gtk_style_get_xthickness(gtkStyle); int arrow_width = MIN_ARROW_SIZE; int x_border = xthickness + focus_padding; //int y_border = ythickness + focus_padding; if (interior_focus == 0) { x_border += focus_line_width; //y_border += focus_line_width; } int arrow_button_width = arrow_width + x_border * 2; int arrow_button_x = bounds.x + bounds.width - arrow_button_width; Rectangle arrowRect = new Rectangle(arrow_button_x, bounds.y, arrow_button_width, bounds.height); if (arrowRect.contains(position)) return DrawData.COMBO_ARROW; return DrawData.WIDGET_WHOLE; }
@Override Rectangle computeTrim(Theme theme, GC gc) { int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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); int ythickness = OS.gtk_style_get_ythickness(gtkStyle); int borderX = xthickness + focus_width + focus_padding; int borderY = ythickness + focus_width + focus_padding; int x = clientArea.x - borderX; int y = clientArea.y - borderY; int width = clientArea.width + 2 * borderX; int height = clientArea.height + 2 * borderY; if ((style & SWT.DROP_DOWN) != 0) { width += ARROW_WIDTH; } return new Rectangle(x, y, width, height); }
@Override Rectangle computeTrim(Theme theme, GC gc) { int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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); int ythickness = OS.gtk_style_get_ythickness(gtkStyle); int borderX = xthickness + focus_width + focus_padding; int borderY = ythickness + focus_width + focus_padding; int x = clientArea.x - borderX; int y = clientArea.y - borderY; int width = clientArea.width + 2 * borderX; int height = clientArea.height + 2 * borderY; if ((style & SWT.DROP_DOWN) != 0) { width += ARROW_WIDTH; } return new Rectangle(x, y, width, height); }
@Override Rectangle computeTrim(Theme theme, GC gc) { long /*int*/ buttonHandle = theme.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); int ythickness = OS.gtk_style_get_ythickness(gtkStyle); int borderX = xthickness + focus_width + focus_padding; int borderY = ythickness + focus_width + focus_padding; int x = clientArea.x - borderX; int y = clientArea.y - borderY; int width = clientArea.width + 2 * borderX; int height = clientArea.height + 2 * borderY; if ((style & SWT.DROP_DOWN) != 0) { width += ARROW_WIDTH; } return new Rectangle(x, y, width, height); }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; int /*long*/ treeHandle = theme.treeHandle; int expander_size = theme.getWidgetProperty(treeHandle, "expander-size"); if (new Rectangle(bounds.x, bounds.y, expander_size, expander_size).contains(position)) { return DrawData.WIDGET_WHOLE; } return DrawData.WIDGET_NOWHERE; }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; long /*int*/ treeHandle = theme.treeHandle; int expander_size = theme.getWidgetProperty(treeHandle, "expander-size"); if (new Rectangle(bounds.x, bounds.y, expander_size, expander_size).contains(position)) { return DrawData.WIDGET_WHOLE; } return DrawData.WIDGET_NOWHERE; }
@Override int hit(Theme theme, Point position, Rectangle bounds) { if (!bounds.contains(position)) return DrawData.WIDGET_NOWHERE; int /*long*/ treeHandle = theme.treeHandle; int expander_size = theme.getWidgetProperty(treeHandle, "expander-size"); if (new Rectangle(bounds.x, bounds.y, expander_size, expander_size).contains(position)) { return DrawData.WIDGET_WHOLE; } return DrawData.WIDGET_NOWHERE; }
gtk_render_extension (gtkStyle, drawable, state_type, OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side); if (clientArea != null) { int hborder = theme.getWidgetProperty(notebookHandle, "tab-hborder"); int vborder = theme.getWidgetProperty(notebookHandle, "tab-vborder"); int focus_line_width = theme.getWidgetProperty(notebookHandle, "focus-line-width"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); int ythickness = OS.gtk_style_get_ythickness(gtkStyle);
gtk_render_extension (gtkStyle, drawable, state_type, OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side); if (clientArea != null) { int hborder = theme.getWidgetProperty(notebookHandle, "tab-hborder"); int vborder = theme.getWidgetProperty(notebookHandle, "tab-vborder"); int focus_line_width = theme.getWidgetProperty(notebookHandle, "focus-line-width"); int xthickness = OS.gtk_style_get_xthickness(gtkStyle); int ythickness = OS.gtk_style_get_ythickness(gtkStyle);
@Override void draw(Theme theme, GC gc, Rectangle bounds) { int /*long*/ treeHandle = theme.treeHandle; int /*long*/ gtkStyle = gtk_widget_get_style (treeHandle); int /*long*/ drawable = OS.GTK3 ? gc.getGCData().cairo : gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int state_type = getStateType(DrawData.WIDGET_WHOLE); int expander_style = OS.GTK_EXPANDER_COLAPSED; if ((this.style & SWT.DOWN) != 0) expander_style = OS.GTK_EXPANDER_EXPANDED; byte[] detail = Converter.wcsToMbcs(null, "treeview", true); int expander_size = theme.getWidgetProperty(treeHandle, "expander-size"); int x = bounds.x + expander_size / 2; int y = bounds.y + expander_size / 2; if (OS.GTK3) { 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); } }
@Override void draw(Theme theme, GC gc, Rectangle bounds) { int /*long*/ treeHandle = theme.treeHandle; int /*long*/ gtkStyle = gtk_widget_get_style (treeHandle); int /*long*/ drawable = OS.GTK3 ? gc.getGCData().cairo : gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int state_type = getStateType(DrawData.WIDGET_WHOLE); int expander_style = OS.GTK_EXPANDER_COLAPSED; if ((this.style & SWT.DOWN) != 0) expander_style = OS.GTK_EXPANDER_EXPANDED; byte[] detail = Converter.wcsToMbcs(null, "treeview", true); int expander_size = theme.getWidgetProperty(treeHandle, "expander-size"); int x = bounds.x + expander_size / 2; int y = bounds.y + expander_size / 2; if (OS.GTK3) { 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); } }
@Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ treeHandle = theme.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); int expander_style = OS.GTK_EXPANDER_COLAPSED; if ((this.style & SWT.DOWN) != 0) expander_style = OS.GTK_EXPANDER_EXPANDED; byte[] detail = Converter.wcsToMbcs(null, "treeview", true); int expander_size = theme.getWidgetProperty(treeHandle, "expander-size"); int x = bounds.x + expander_size / 2; int y = bounds.y + expander_size / 2; if (OS.GTK3) { 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); } }