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

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

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

GC.gtk_new介绍

[英]Invokes platform specific functionality to wrap a graphics context.

IMPORTANT: This method is not part of the public API for GC. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.
[中]

代码示例

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

private GC getGC(int /*long*/ cr) {
  GC gc;
  if (OS.GTK3){
    GCData gcData = new GCData();
    gcData.cairo = cr;
    gc = GC.gtk_new(this, gcData );
  } else {
    gc = new GC (this);
  }
  return gc;
}

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

private GC getGC(long /*int*/ cr) {
  GC gc;
  if (OS.GTK3){
    GCData gcData = new GCData();
    gcData.cairo = cr;
    gc = GC.gtk_new(this, gcData );
  } else {
    gc = new GC (this);
  }
  return gc;
}

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

private GC getGC(long /*int*/ cr) {
  GC gc;
  if (OS.GTK3){
    GCData gcData = new GCData();
    gcData.cairo = cr;
    gc = GC.gtk_new(this, gcData );
  } else {
    gc = new GC (this);
  }
  return gc;
}

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

private GC getGC(int /*long*/ cr) {
  GC gc;
  if (OS.GTK3){
    GCData gcData = new GCData();
    gcData.cairo = cr;
    gc = GC.gtk_new(this, gcData );
  } else {
    gc = new GC (this);
  }
  return gc;
}

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

private GC getGC(int /*long*/ cr) {
  GC gc;
  if (OS.GTK3){
    GCData gcData = new GCData();
    gcData.cairo = cr;
    gc = GC.gtk_new(this, gcData );
  } else {
    gc = new GC (this);
  }
  return gc;
}

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

private GC getGC(int /*long*/ cr) {
  GC gc;
  if (OS.GTK3){
    GCData gcData = new GCData();
    gcData.cairo = cr;
    gc = GC.gtk_new(this, gcData );
  } else {
    gc = new GC (this);
  }
  return gc;
}

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

@Override
int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ eventPtr) {
  if ((state & OBSCURED) != 0) return 0;
  if (!hooksPaint ()) return 0;
  GdkEventExpose gdkEvent = new GdkEventExpose ();
  OS.memmove(gdkEvent, eventPtr, GdkEventExpose.sizeof);
  Event event = new Event ();
  event.count = gdkEvent.count;
  Rectangle eventRect = new Rectangle (gdkEvent.area_x, gdkEvent.area_y, gdkEvent.area_width, gdkEvent.area_height);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
  GCData data = new GCData ();
  data.damageRgn = gdkEvent.region;
  GC gc = event.gc = GC.gtk_new (this, data);
  drawWidget (gc);
  sendEvent (SWT.Paint, event);
  gc.dispose ();
  event.gc = null;
  return 0;
}

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

@Override
int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ eventPtr) {
  if ((state & OBSCURED) != 0) return 0;
  if (!hooksPaint ()) return 0;
  GdkEventExpose gdkEvent = new GdkEventExpose ();
  OS.memmove(gdkEvent, eventPtr, GdkEventExpose.sizeof);
  Event event = new Event ();
  event.count = gdkEvent.count;
  Rectangle eventRect = new Rectangle (gdkEvent.area_x, gdkEvent.area_y, gdkEvent.area_width, gdkEvent.area_height);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
  GCData data = new GCData ();
  data.damageRgn = gdkEvent.region;
  GC gc = event.gc = GC.gtk_new (this, data);
  drawWidget (gc);
  sendEvent (SWT.Paint, event);
  gc.dispose ();
  event.gc = null;
  return 0;
}

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

@Override
long /*int*/ gtk_expose_event (long /*int*/ widget, long /*int*/ eventPtr) {
  if ((state & OBSCURED) != 0) return 0;
  if (!hooksPaint ()) return 0;
  GdkEventExpose gdkEvent = new GdkEventExpose ();
  OS.memmove(gdkEvent, eventPtr, GdkEventExpose.sizeof);
  Event event = new Event ();
  event.count = gdkEvent.count;
  Rectangle eventRect = new Rectangle (gdkEvent.area_x, gdkEvent.area_y, gdkEvent.area_width, gdkEvent.area_height);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
  GCData data = new GCData ();
  data.damageRgn = gdkEvent.region;
  GC gc = event.gc = GC.gtk_new (this, data);
  drawWidget (gc);
  sendEvent (SWT.Paint, event);
  gc.dispose ();
  event.gc = null;
  return 0;
}

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

@Override
int /*long*/ gtk_draw (int /*long*/ widget, int /*long*/ cairo) {
  if ((state & OBSCURED) != 0) return 0;
  if (!hooksPaint ()) return 0;
  GdkRectangle rect = new GdkRectangle ();
  OS.gdk_cairo_get_clip_rectangle (cairo, rect);
  Event event = new Event ();
  event.count = 1;
  Rectangle eventRect = new Rectangle (rect.x, rect.y, rect.width, rect.height);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
  GCData data = new GCData ();
//    data.damageRgn = gdkEvent.region;
  if (OS.GTK_VERSION <= OS.VERSION (3, 9, 0)) {
    data.cairo = cairo;
  }
  GC gc = event.gc = GC.gtk_new (this, data);
  Rectangle rect2 = DPIUtil.autoScaleDown(new Rectangle(rect.x, rect.y, rect.width, rect.height));
  // Caveat: rect2 is necessary because GC#setClipping(Rectangle) got broken by bug 446075
  gc.setClipping (rect2.x, rect2.y, rect2.width, rect2.height);
  drawWidget (gc);
  sendEvent (SWT.Paint, event);
  gc.dispose ();
  event.gc = null;
  return 0;
}

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

@Override
long /*int*/ gtk_draw (long /*int*/ widget, long /*int*/ cairo) {
  if ((state & OBSCURED) != 0) return 0;
  if (!hooksPaint ()) return 0;
  GdkRectangle rect = new GdkRectangle ();
  OS.gdk_cairo_get_clip_rectangle (cairo, rect);
  Event event = new Event ();
  event.count = 1;
  Rectangle eventRect = new Rectangle (rect.x, rect.y, rect.width, rect.height);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
  GCData data = new GCData ();
//    data.damageRgn = gdkEvent.region;
  if (OS.GTK_VERSION <= OS.VERSION (3, 9, 0)) {
    data.cairo = cairo;
  }
  GC gc = event.gc = GC.gtk_new (this, data);
  Rectangle rect2 = DPIUtil.autoScaleDown(new Rectangle(rect.x, rect.y, rect.width, rect.height));
  // Caveat: rect2 is necessary because GC#setClipping(Rectangle) got broken by bug 446075
  gc.setClipping (rect2.x, rect2.y, rect2.width, rect2.height);
  drawWidget (gc);
  sendEvent (SWT.Paint, event);
  gc.dispose ();
  event.gc = null;
  return 0;
}

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

@Override
int /*long*/ gtk_draw (int /*long*/ widget, int /*long*/ cairo) {
  if ((state & OBSCURED) != 0) return 0;
  if (!hooksPaint ()) return 0;
  GdkRectangle rect = new GdkRectangle ();
  OS.gdk_cairo_get_clip_rectangle (cairo, rect);
  Event event = new Event ();
  event.count = 1;
  Rectangle eventRect = new Rectangle (rect.x, rect.y, rect.width, rect.height);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
  GCData data = new GCData ();
//    data.damageRgn = gdkEvent.region;
  if (OS.GTK_VERSION <= OS.VERSION (3, 9, 0)) {
    data.cairo = cairo;
  }
  GC gc = event.gc = GC.gtk_new (this, data);
  Rectangle rect2 = DPIUtil.autoScaleDown(new Rectangle(rect.x, rect.y, rect.width, rect.height));
  // Caveat: rect2 is necessary because GC#setClipping(Rectangle) got broken by bug 446075
  gc.setClipping (rect2.x, rect2.y, rect2.width, rect2.height);
  drawWidget (gc);
  sendEvent (SWT.Paint, event);
  gc.dispose ();
  event.gc = null;
  return 0;
}

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

GCData data = new GCData ();
data.damageRgn = damageRgn;
GC gc = event.gc = GC.gtk_new (this, data);
sendEvent (SWT.Paint, event);
gc.dispose ();

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

GCData data = new GCData ();
data.damageRgn = damageRgn;
GC gc = event.gc = GC.gtk_new (this, data);
sendEvent (SWT.Paint, event);
gc.dispose ();

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

GCData data = new GCData ();
data.damageRgn = damageRgn;
GC gc = event.gc = GC.gtk_new (this, data);
sendEvent (SWT.Paint, event);
gc.dispose ();

相关文章

GC类方法