public Rectangle getBounds(int part, Rectangle bounds, DrawData data) { checkTheme(); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); return data.getBounds(part, bounds); }
void checkTheme() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); }
int /*long*/ gtkStyle = gtk_widget_get_style (notebookHandle); int /*long*/ 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; if ((state[DrawData.WIDGET_WHOLE] & DrawData.SELECTED) == 0) { 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);
int /*long*/ radioButtonHandle = theme.radioButtonHandle; int /*long*/ 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"); int interior_focus = theme.getWidgetProperty(radioButtonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(radioButtonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(radioButtonHandle, "focus-padding"); int border_width = OS.gtk_container_get_border_width(radioButtonHandle); int /*long*/ checkButtonHandle = theme.checkButtonHandle; int /*long*/ gtkStyle = OS.gtk_widget_get_style (checkButtonHandle); theme.transferClipping (gc, gtkStyle); int indicator_size = theme.getWidgetProperty(checkButtonHandle, "indicator-size"); int indicator_spacing = theme.getWidgetProperty(checkButtonHandle, "indicator-spacing"); int interior_focus = theme.getWidgetProperty(checkButtonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(checkButtonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(checkButtonHandle, "focus-padding"); int border_width = OS.gtk_container_get_border_width(checkButtonHandle); int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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"); int border_width = OS.gtk_container_get_border_width(buttonHandle); int /*long*/ default_border_ptr = theme.getBorderProperty(buttonHandle, "default-border"); if (default_border_ptr != 0) {
@Override void draw(Theme theme, GC gc, Rectangle bounds) { int /*long*/ toolbarHandle = theme.toolbarHandle; int /*long*/ gtkStyle = gtk_widget_get_style (toolbarHandle); int /*long*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; byte[] detail = Converter.wcsToMbcs(null, "toolbar", true); gtk_render_box (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_NONE, null, toolbarHandle, detail, x, y, width, height); if (clientArea != null) { clientArea.x = bounds.x; clientArea.y = bounds.y; clientArea.width = bounds.width; clientArea.height = bounds.height; } }
@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; }
long /*int*/ radioButtonHandle = theme.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"); int interior_focus = theme.getWidgetProperty(radioButtonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(radioButtonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(radioButtonHandle, "focus-padding"); int border_width = OS.gtk_container_get_border_width(radioButtonHandle); long /*int*/ checkButtonHandle = theme.checkButtonHandle; long /*int*/ gtkStyle = OS.gtk_widget_get_style (checkButtonHandle); theme.transferClipping (gc, gtkStyle); int indicator_size = theme.getWidgetProperty(checkButtonHandle, "indicator-size"); int indicator_spacing = theme.getWidgetProperty(checkButtonHandle, "indicator-spacing"); int interior_focus = theme.getWidgetProperty(checkButtonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(checkButtonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(checkButtonHandle, "focus-padding"); int border_width = OS.gtk_container_get_border_width(checkButtonHandle); long /*int*/ buttonHandle = theme.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"); int border_width = OS.gtk_container_get_border_width(buttonHandle); long /*int*/ default_border_ptr = theme.getBorderProperty(buttonHandle, "default-border"); if (default_border_ptr != 0) {
@Override void draw(Theme theme, GC gc, Rectangle bounds) { int /*long*/ toolbarHandle = theme.toolbarHandle; int /*long*/ gtkStyle = gtk_widget_get_style (toolbarHandle); int /*long*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; byte[] detail = Converter.wcsToMbcs(null, "toolbar", true); gtk_render_box (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_NONE, null, toolbarHandle, detail, x, y, width, height); if (clientArea != null) { clientArea.x = bounds.x; clientArea.y = bounds.y; clientArea.width = bounds.width; clientArea.height = bounds.height; } }
@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; }
public Rectangle getBounds(int part, Rectangle bounds, DrawData data) { checkTheme(); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); return data.getBounds(part, bounds); }
int /*long*/ gtkStyle = gtk_widget_get_style (notebookHandle); int /*long*/ 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; if ((state[DrawData.WIDGET_WHOLE] & DrawData.SELECTED) == 0) { 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);
void checkTheme() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); }
int /*long*/ radioButtonHandle = theme.radioButtonHandle; int /*long*/ 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"); int interior_focus = theme.getWidgetProperty(radioButtonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(radioButtonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(radioButtonHandle, "focus-padding"); int border_width = OS.gtk_container_get_border_width(radioButtonHandle); int /*long*/ checkButtonHandle = theme.checkButtonHandle; int /*long*/ gtkStyle = OS.gtk_widget_get_style (checkButtonHandle); theme.transferClipping (gc, gtkStyle); int indicator_size = theme.getWidgetProperty(checkButtonHandle, "indicator-size"); int indicator_spacing = theme.getWidgetProperty(checkButtonHandle, "indicator-spacing"); int interior_focus = theme.getWidgetProperty(checkButtonHandle, "interior-focus"); int focus_line_width = theme.getWidgetProperty(checkButtonHandle, "focus-line-width"); int focus_padding = theme.getWidgetProperty(checkButtonHandle, "focus-padding"); int border_width = OS.gtk_container_get_border_width(checkButtonHandle); int /*long*/ buttonHandle = theme.buttonHandle; int /*long*/ 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"); int border_width = OS.gtk_container_get_border_width(buttonHandle); int /*long*/ default_border_ptr = theme.getBorderProperty(buttonHandle, "default-border"); if (default_border_ptr != 0) {
@Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ toolbarHandle = theme.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; byte[] detail = Converter.wcsToMbcs(null, "toolbar", true); gtk_render_box (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_NONE, null, toolbarHandle, detail, x, y, width, height); if (clientArea != null) { clientArea.x = bounds.x; clientArea.y = bounds.y; clientArea.width = bounds.width; clientArea.height = bounds.height; } }
@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; }
public Rectangle getBounds(int part, Rectangle bounds, DrawData data) { checkTheme(); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); return data.getBounds(part, bounds); }
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; if ((state[DrawData.WIDGET_WHOLE] & DrawData.SELECTED) == 0) { 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);
void checkTheme() { if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); }
@Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ notebookHandle = theme.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; height -= tabsHeight; int gap_x = selectedX, gap_width = selectedWidth, gap_side = OS.GTK_POS_TOP; if ((style & SWT.BOTTOM) != 0) { gap_side = OS.GTK_POS_BOTTOM; } else { y += tabsHeight; } byte[] detail = Converter.wcsToMbcs(null, "notebook", true); gtk_render_frame_gap (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side, gap_x, gap_width); if (tabsArea != null) { tabsArea.x = bounds.x; tabsArea.y = bounds.y; tabsArea.width = bounds.width; tabsArea.height = tabsHeight; if ((style & SWT.BOTTOM) != 0) { tabsArea.y += bounds.height - tabsHeight; } } }
@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); }