org.eclipse.swt.graphics.GC.initCairo()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.eclipse.swt.graphics.GC.initCairo()方法的一些代码示例,展示了GC.initCairo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GC.initCairo()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.GC
类名称:GC
方法名:initCairo

GC.initCairo介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Sets the receiver's alpha value which must be
 * between 0 (transparent) and 255 (opaque).
 * <p>
 * This operation requires the operating system's advanced
 * graphics subsystem which may not be available on some
 * platforms.
 * </p>
 * @param alpha the alpha value
 *
 * @exception SWTException <ul>
 *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
 * </ul>
 *
 * @see #getAdvanced
 * @see #setAdvanced
 *
 * @since 3.1
 */
public void setAlpha(int alpha) {
  if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
  if (data.cairo == 0 && (alpha & 0xff) == 0xff) return;
  initCairo();
  data.alpha = alpha & 0xff;
  data.state &= ~(BACKGROUND | FOREGROUND | BACKGROUND_BG);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Sets the receiver's alpha value which must be
 * between 0 (transparent) and 255 (opaque).
 * <p>
 * This operation requires the operating system's advanced
 * graphics subsystem which may not be available on some
 * platforms.
 * </p>
 * @param alpha the alpha value
 *
 * @exception SWTException <ul>
 *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
 * </ul>
 *
 * @see #getAdvanced
 * @see #setAdvanced
 *
 * @since 3.1
 */
public void setAlpha(int alpha) {
  if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
  if (data.cairo == 0 && (alpha & 0xff) == 0xff) return;
  initCairo();
  data.alpha = alpha & 0xff;
  data.state &= ~(BACKGROUND | FOREGROUND | BACKGROUND_BG);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Sets the receiver's alpha value which must be
 * between 0 (transparent) and 255 (opaque).
 * <p>
 * This operation requires the operating system's advanced
 * graphics subsystem which may not be available on some
 * platforms.
 * </p>
 * @param alpha the alpha value
 *
 * @exception SWTException <ul>
 *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
 * </ul>
 *
 * @see #getAdvanced
 * @see #setAdvanced
 *
 * @since 3.1
 */
public void setAlpha(int alpha) {
  if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
  if (data.cairo == 0 && (alpha & 0xff) == 0xff) return;
  initCairo();
  data.alpha = alpha & 0xff;
  data.state &= ~(BACKGROUND | FOREGROUND | BACKGROUND_BG);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET);
} else if (OS.INIT_CAIRO) {
   initCairo();
 initCairo();
 long /*int*/ cairo = data.cairo;
 Cairo.cairo_set_matrix(cairo, identity());

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET);
} else if (OS.INIT_CAIRO) {
   initCairo();
 initCairo();
 int /*long*/ cairo = data.cairo;
 Cairo.cairo_set_matrix(cairo, identity());

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

data.state &= ~(BACKGROUND | FOREGROUND | FONT | LINE_WIDTH | LINE_CAP | LINE_JOIN | LINE_STYLE | DRAW_OFFSET);
} else if (OS.INIT_CAIRO) {
   initCairo();
 initCairo();
 int /*long*/ cairo = data.cairo;
 Cairo.cairo_set_matrix(cairo, identity());

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && pattern == null) return;
initCairo();
if (data.foregroundPattern == pattern) return;
data.foregroundPattern = pattern;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && pattern == null) return;
initCairo();
if (data.backgroundPattern == pattern) return;
data.backgroundPattern = pattern;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && pattern == null) return;
initCairo();
if (data.backgroundPattern == pattern) return;
data.backgroundPattern = pattern;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

initCairo();
int /*long*/ cairo = data.cairo;
if (cairo != 0) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && pattern == null) return;
initCairo();
if (data.foregroundPattern == pattern) return;
data.foregroundPattern = pattern;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && pattern == null) return;
initCairo();
if (data.foregroundPattern == pattern) return;
data.foregroundPattern = pattern;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

initCairo();
long /*int*/ cairo = data.cairo;
if (cairo != 0) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && pattern == null) return;
initCairo();
if (data.backgroundPattern == pattern) return;
data.backgroundPattern = pattern;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

if (transform != null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
if (data.cairo == 0 && transform == null) return;
initCairo();
int /*long*/ cairo = data.cairo;
double[] identity = identity();

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

boolean containsInPixels(float x, float y, GC gc, boolean outline) {
  //TODO - see Windows
  gc.initCairo();
  gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH);
  boolean result = false;
  int /*long*/ cairo = gc.data.cairo;
  int /*long*/ copy = Cairo.cairo_copy_path(handle);
  if (copy == 0) SWT.error(SWT.ERROR_NO_HANDLES);
  Cairo.cairo_append_path(cairo, copy);
  Cairo.cairo_path_destroy(copy);
  if (outline) {
    result = Cairo.cairo_in_stroke(cairo, x, y) != 0;
  } else {
    result = Cairo.cairo_in_fill(cairo, x, y) != 0;
  }
  Cairo.cairo_new_path(cairo);
  return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

boolean containsInPixels(float x, float y, GC gc, boolean outline) {
  //TODO - see Windows
  gc.initCairo();
  gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH);
  boolean result = false;
  int /*long*/ cairo = gc.data.cairo;
  int /*long*/ copy = Cairo.cairo_copy_path(handle);
  if (copy == 0) SWT.error(SWT.ERROR_NO_HANDLES);
  Cairo.cairo_append_path(cairo, copy);
  Cairo.cairo_path_destroy(copy);
  if (outline) {
    result = Cairo.cairo_in_stroke(cairo, x, y) != 0;
  } else {
    result = Cairo.cairo_in_fill(cairo, x, y) != 0;
  }
  Cairo.cairo_new_path(cairo);
  return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

boolean containsInPixels(float x, float y, GC gc, boolean outline) {
  //TODO - see Windows
  gc.initCairo();
  gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH);
  boolean result = false;
  long /*int*/ cairo = gc.data.cairo;
  long /*int*/ copy = Cairo.cairo_copy_path(handle);
  if (copy == 0) SWT.error(SWT.ERROR_NO_HANDLES);
  Cairo.cairo_append_path(cairo, copy);
  Cairo.cairo_path_destroy(copy);
  if (outline) {
    result = Cairo.cairo_in_stroke(cairo, x, y) != 0;
  } else {
    result = Cairo.cairo_in_fill(cairo, x, y) != 0;
  }
  Cairo.cairo_new_path(cairo);
  return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
initCairo();
checkGC(FILL);
int /*long*/ cairo = data.cairo;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (path.handle == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
initCairo();
checkGC(FILL);
long /*int*/ cairo = data.cairo;

相关文章

GC类方法