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); }
@Override int getStateType(int part) { if (part == DrawData.WIDGET_WHOLE) { int state_type = OS.GTK_STATE_NORMAL; if ((state[DrawData.WIDGET_WHOLE] & DrawData.DISABLED) != 0) { state_type = OS.GTK_STATE_INSENSITIVE; } return state_type; } return super.getStateType(part); }
void drawText(Theme theme, String text, int flags, GC gc, Rectangle bounds) { int /*long*/ widget = getTextHandle(theme); int /*long*/ gtkStyle = gtk_widget_get_style(widget); int /*long*/ drawable = gc.getGCData().drawable; theme.transferClipping (gc, gtkStyle); y += bounds.height - height[0]; int state_type = getStateType(DrawData.WIDGET_WHOLE); byte[] detail = Converter.wcsToMbcs(null, "label", true); gtk_render_layout(gtkStyle, drawable, state_type, false, null, widget, detail, x, y, layout); OS.g_object_unref(layout);
public void drawImage(GC gc, Rectangle bounds, DrawData data, Image image, int flags) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); data.drawImage(this, image, gc, bounds); }
public int hitBackground(Point position, Rectangle bounds, DrawData data) { checkTheme(); if (position == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); return data.hit(this, position, bounds); }
public Rectangle computeTrim(GC gc, DrawData data) { if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); return data.computeTrim(this, gc); }
public void drawText(GC gc, Rectangle bounds, DrawData data, String text, int flags) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); data.drawText(this, text, flags, gc, bounds); }
public Rectangle measureText(GC gc, Rectangle bounds, DrawData data, String text, int flags) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); return data.measureText(this, text, flags, gc, bounds); } }
public void drawBackground(GC gc, Rectangle bounds, DrawData data) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); data.draw(this, gc, bounds); }
void drawImage(Theme theme, Image image, GC gc, Rectangle bounds) { int /*long*/ drawable = gc.getGCData().drawable; Rectangle rect = image.getBounds(); int state_type = getStateType(DrawData.WIDGET_WHOLE); if (state_type == OS.GTK_STATE_NORMAL) { gc.drawImage(image, 0, 0, rect.width, rect.height, bounds.x, bounds.y, bounds.width, bounds.height); int /*long*/ gtkStyle = gtk_widget_get_style (buttonHandle); theme.transferClipping(gc, gtkStyle); int /*long*/ rendered = OS.gtk_style_render_icon(gtkStyle, source, OS.GTK_TEXT_DIR_NONE, state_type, -1, buttonHandle, null);
Rectangle measureText(Theme theme, String text, int flags, GC gc, Rectangle bounds) { long /*int*/ widget = getTextHandle(theme); byte[] buffer = Converter.wcsToMbcs(null, text, true); long /*int*/ layout = OS.gtk_widget_create_pango_layout(widget, buffer); if (bounds != null) OS.pango_layout_set_width(layout, bounds.width); if ((flags & DrawData.DRAW_LEFT) != 0) { OS.pango_layout_set_alignment(layout, OS.PANGO_ALIGN_LEFT); } if ((flags & DrawData.DRAW_HCENTER) != 0) { OS.pango_layout_set_alignment(layout, OS.PANGO_ALIGN_CENTER); } if ((flags & DrawData.DRAW_RIGHT) != 0) { OS.pango_layout_set_alignment(layout, OS.PANGO_ALIGN_RIGHT); } int[] width = new int[1], height = new int[1]; OS.pango_layout_get_pixel_size(layout, width, height); OS.g_object_unref(layout); return new Rectangle(0, 0, width[0], height[0]); }
void drawText(Theme theme, String text, int flags, GC gc, Rectangle bounds) { long /*int*/ widget = getTextHandle(theme); long /*int*/ gtkStyle = gtk_widget_get_style(widget); long /*int*/ drawable = gc.getGCData().drawable; theme.transferClipping (gc, gtkStyle); y += bounds.height - height[0]; int state_type = getStateType(DrawData.WIDGET_WHOLE); byte[] detail = Converter.wcsToMbcs(null, "label", true); gtk_render_layout(gtkStyle, drawable, state_type, false, null, widget, detail, x, y, layout); OS.g_object_unref(layout);
public void drawImage(GC gc, Rectangle bounds, DrawData data, Image image, int flags) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); data.drawImage(this, image, gc, bounds); }
public int hitBackground(Point position, Rectangle bounds, DrawData data) { checkTheme(); if (position == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); return data.hit(this, position, bounds); }
public Rectangle computeTrim(GC gc, DrawData data) { if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); return data.computeTrim(this, gc); }
public void drawText(GC gc, Rectangle bounds, DrawData data, String text, int flags) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); data.drawText(this, text, flags, gc, bounds); }
public Rectangle measureText(GC gc, Rectangle bounds, DrawData data, String text, int flags) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); return data.measureText(this, text, flags, gc, bounds); }
public void drawBackground(GC gc, Rectangle bounds, DrawData data) { checkTheme(); if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (data == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); data.draw(this, gc, bounds); }
void drawImage(Theme theme, Image image, GC gc, Rectangle bounds) { int /*long*/ drawable = gc.getGCData().drawable; Rectangle rect = image.getBounds(); int state_type = getStateType(DrawData.WIDGET_WHOLE); if (state_type == OS.GTK_STATE_NORMAL) { gc.drawImage(image, 0, 0, rect.width, rect.height, bounds.x, bounds.y, bounds.width, bounds.height); int /*long*/ gtkStyle = gtk_widget_get_style (buttonHandle); theme.transferClipping(gc, gtkStyle); int /*long*/ rendered = OS.gtk_style_render_icon(gtkStyle, source, OS.GTK_TEXT_DIR_NONE, state_type, -1, buttonHandle, null);
Rectangle measureText(Theme theme, String text, int flags, GC gc, Rectangle bounds) { int /*long*/ widget = getTextHandle(theme); byte[] buffer = Converter.wcsToMbcs(null, text, true); int /*long*/ layout = OS.gtk_widget_create_pango_layout(widget, buffer); if (bounds != null) OS.pango_layout_set_width(layout, bounds.width); if ((flags & DrawData.DRAW_LEFT) != 0) { OS.pango_layout_set_alignment(layout, OS.PANGO_ALIGN_LEFT); } if ((flags & DrawData.DRAW_HCENTER) != 0) { OS.pango_layout_set_alignment(layout, OS.PANGO_ALIGN_CENTER); } if ((flags & DrawData.DRAW_RIGHT) != 0) { OS.pango_layout_set_alignment(layout, OS.PANGO_ALIGN_RIGHT); } int[] width = new int[1], height = new int[1]; OS.pango_layout_get_pixel_size(layout, width, height); OS.g_object_unref(layout); return new Rectangle(0, 0, width[0], height[0]); }