summaryrefslogtreecommitdiff
path: root/gnu/java/awt/peer/gtk/ComponentGraphics.java
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/awt/peer/gtk/ComponentGraphics.java')
-rw-r--r--gnu/java/awt/peer/gtk/ComponentGraphics.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/gnu/java/awt/peer/gtk/ComponentGraphics.java b/gnu/java/awt/peer/gtk/ComponentGraphics.java
index 193dec4c7..ffa78e9c9 100644
--- a/gnu/java/awt/peer/gtk/ComponentGraphics.java
+++ b/gnu/java/awt/peer/gtk/ComponentGraphics.java
@@ -53,6 +53,7 @@ import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.RenderedImage;
+import gnu.classpath.Pointer;
/**
* ComponentGraphics - context for drawing directly to a component,
@@ -162,6 +163,11 @@ public class ComponentGraphics extends CairoGraphics2D
*/
public static native boolean hasXRender();
+ /**
+ * This is a utility method (used by GtkComponentPeer) for grabbing the
+ * image of a component.
+ */
+ private static native Pointer nativeGrab(GtkComponentPeer component);
private native void copyAreaNative(GtkComponentPeer component, int x, int y,
int width, int height, int dx, int dy);
@@ -172,6 +178,14 @@ public class ComponentGraphics extends CairoGraphics2D
int cw, int ch);
/**
+ * Not really related (moveme?). Utility method used by GtkComponent.
+ */
+ public static GtkImage grab( GtkComponentPeer component )
+ {
+ return new GtkImage( nativeGrab( component ) );
+ }
+
+ /**
* Returns a Graphics2D object for a component, either an instance of this
* class (if xrender is supported), or a context which copies.
*/