[multiple changes]
authorThomas Fitzsimmons <fitzsim@gcc.gnu.org>
Fri, 27 Apr 2007 18:08:03 +0000 (18:08 +0000)
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>
Fri, 27 Apr 2007 18:08:03 +0000 (18:08 +0000)
2007-03-16  Francis Kung  <fkung@redhat.com>

* gnu/java/awt/peer/gtk/CairoGraphics2D.java
(cairoArc): Make protected rather than private so it can be over-ridden.
(cairoClip): Likewise.
(cairoClosePath): Likewise.
(cairoCurveTo): Likewise.
(cairoDrawGlyphVector): Likewise.
(cairoFill): Likewise.
(cairoLineTo): Likewise.
(cairoMoveTo): Likewise.
(cairoNewPath): Likewise.
(cairoRectangle): Likewise.
(cairoResetClip): Likewise.
(cairoRestore): Likewise.
(cairoSave): Likewise.
(cairoScale): Likewise.
(cairoSetAntialias): Likewise.
(cairoSetDash): Likewise.
(cairoSetFillRule): Likewise.
(cairoSetFont): Likewise.
(cairoSetLine): Likewise.
(cairoSetMatrix): Likewise.
(cairoSetOperator): Likewise.
(cairoSetRGBAColor): Likewise.
(cairoStroke): Likewise.
(drawPixels): Likewise.
(init): Likewise.
(setGradient): Likewise.
(setPaintPixels): Likewise.
(cairoDrawLine): Removed.
(cairoDrawRect): Removed.
(cairoFillRect): Removed.
(cairoPreserveClip): Removed.
(cairoRelCurveTo): Removed.
(cairoRelLineTo): Removed.
(cairoRelMoveTo): Removed.
* gnu/java/awt/peer/gtk/ComponentGraphics.java
(cairoArc): New method wrapping superclass method in locks.
(cairoClip): Likewise.
(cairoClosePath): Likewise.
(cairoCurveTo): Likewise.
(cairoDrawGlyphVector): Likewise.
(cairoFill): Likewise.
(cairoLineTo): Likewise.
(cairoMoveTo): Likewise.
(cairoNewPath): Likewise.
(cairoRectangle): Likewise.
(cairoResetClip): Likewise.
(cairoRestore): Likewise.
(cairoSave): Likewise.
(cairoScale): Likewise.
(cairoSetAntialias): Likewise.
(cairoSetDash): Likewise.
(cairoSetFillRule): Likewise.
(cairoSetFont): Likewise.
(cairoSetLine): Likewise.
(cairoSetMatrix): Likewise.
(cairoSetOperator): Likewise.
(cairoSetRGBAColor): Likewise.
(cairoStroke): Likewise.
(disposeNative): Likewise.
(drawPixels): Likewise.
(init): Likewise.
(setGradient): Likewise.
(setPaintPixels): Likewise.
(draw): Do not lock, as locking is now done in the wrapped native methods.
(drawComposite): Likewise.
(drawGlyphVector): Likewise.
(drawImage): Likewise.
(drawRenderedImage): Likewise.
(fill): Likewise.
(setClip): Removed.
(lock): Added documentation.
(unlock): Added documentation.
* include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Regenerated.
* include/gnu_java_awt_peer_gtk_ComponentGraphics.h: Regenerated.
* lib/gnu/java/awt/peer/gtk/ComponentGraphics.class: Regenerated.
* lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class: Regenerated.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawLine): Removed.
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawRect): Removed.
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFillRect): Removed.
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip): Removed.
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo): Removed.
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelLineTo): Removed.
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelMoveTo): Removed.

2007-04-27  Thomas Fitzsimmons  <fitzsim@redhat.com>

* gnu/java/awt/peer/gtk/CairoGraphics2D.h: Regenerate.
* gnu/java/awt/peer/gtk/ComponentGraphics.h: Regenerate.

From-SVN: r124226

libjava/ChangeLog
libjava/classpath/ChangeLog
libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java
libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h
libjava/classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h
libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class
libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class
libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
libjava/gnu/java/awt/peer/gtk/CairoGraphics2D.h
libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h

index f012fe7..67c1389 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-27  Thomas Fitzsimmons  <fitzsim@redhat.com>
+
+       * gnu/java/awt/peer/gtk/CairoGraphics2D.h: Regenerate.
+       * gnu/java/awt/peer/gtk/ComponentGraphics.h: Regenerate.
+
 2007-04-25  Kyle Galloway  <kgallowa@redhat.com>
 
        * gnu/classpath/jdwp/VMIdManager.java (getObjectId): Deal with null
index 0e6c85c..4877b1d 100644 (file)
@@ -1,3 +1,91 @@
+2007-03-16  Francis Kung  <fkung@redhat.com>
+
+       * gnu/java/awt/peer/gtk/CairoGraphics2D.java
+       (cairoArc): Make protected rather than private so it can be over-ridden.
+       (cairoClip): Likewise.
+       (cairoClosePath): Likewise.
+       (cairoCurveTo): Likewise.
+       (cairoDrawGlyphVector): Likewise.
+       (cairoFill): Likewise.
+       (cairoLineTo): Likewise.
+       (cairoMoveTo): Likewise.
+       (cairoNewPath): Likewise.
+       (cairoRectangle): Likewise.
+       (cairoResetClip): Likewise.
+       (cairoRestore): Likewise.
+       (cairoSave): Likewise.
+       (cairoScale): Likewise.
+       (cairoSetAntialias): Likewise.
+       (cairoSetDash): Likewise.
+       (cairoSetFillRule): Likewise.
+       (cairoSetFont): Likewise.
+       (cairoSetLine): Likewise.
+       (cairoSetMatrix): Likewise.
+       (cairoSetOperator): Likewise.
+       (cairoSetRGBAColor): Likewise.
+       (cairoStroke): Likewise.
+       (drawPixels): Likewise.
+       (init): Likewise.
+       (setGradient): Likewise.
+       (setPaintPixels): Likewise.
+       (cairoDrawLine): Removed.
+       (cairoDrawRect): Removed.
+       (cairoFillRect): Removed.
+       (cairoPreserveClip): Removed.
+       (cairoRelCurveTo): Removed.
+       (cairoRelLineTo): Removed.
+       (cairoRelMoveTo): Removed.
+       * gnu/java/awt/peer/gtk/ComponentGraphics.java
+       (cairoArc): New method wrapping superclass method in locks.
+       (cairoClip): Likewise.
+       (cairoClosePath): Likewise.
+       (cairoCurveTo): Likewise.
+       (cairoDrawGlyphVector): Likewise.
+       (cairoFill): Likewise.
+       (cairoLineTo): Likewise.
+       (cairoMoveTo): Likewise.
+       (cairoNewPath): Likewise.
+       (cairoRectangle): Likewise.
+       (cairoResetClip): Likewise.
+       (cairoRestore): Likewise.
+       (cairoSave): Likewise.
+       (cairoScale): Likewise.
+       (cairoSetAntialias): Likewise.
+       (cairoSetDash): Likewise.
+       (cairoSetFillRule): Likewise.
+       (cairoSetFont): Likewise.
+       (cairoSetLine): Likewise.
+       (cairoSetMatrix): Likewise.
+       (cairoSetOperator): Likewise.
+       (cairoSetRGBAColor): Likewise.
+       (cairoStroke): Likewise.
+       (disposeNative): Likewise.
+       (drawPixels): Likewise.
+       (init): Likewise.
+       (setGradient): Likewise.
+       (setPaintPixels): Likewise.
+       (draw): Do not lock, as locking is now done in the wrapped native methods.
+       (drawComposite): Likewise.
+       (drawGlyphVector): Likewise.
+       (drawImage): Likewise.
+       (drawRenderedImage): Likewise.
+       (fill): Likewise.
+       (setClip): Removed.
+       (lock): Added documentation.
+       (unlock): Added documentation.
+       * include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Regenerated.
+       * include/gnu_java_awt_peer_gtk_ComponentGraphics.h: Regenerated.
+       * lib/gnu/java/awt/peer/gtk/ComponentGraphics.class: Regenerated.
+       * lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class: Regenerated.
+       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawLine): Removed.
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawRect): Removed.
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFillRect): Removed.
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip): Removed.
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo): Removed.
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelLineTo): Removed.
+       (Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelMoveTo): Removed.
+
 2007-04-23  Jeroen Frijters  <jeroen@frijters.net>
 
        PR classpath/31646:
index 3488018..4a6ad00 100644 (file)
@@ -302,7 +302,7 @@ public abstract class CairoGraphics2D extends Graphics2D
    * Allocate the cairographics2d structure and set the cairo_t pointer in it.
    * @param pointer - a cairo_t pointer, casted to a long.
    */
-  private native long init(long pointer);
+  protected native long init(long pointer);
 
   /**
    * These are declared abstract as there may be context-specific issues.
@@ -335,56 +335,56 @@ public abstract class CairoGraphics2D extends Graphics2D
    * @param stride - stride of the array width
    * @param i2u - affine transform array
    */
-  private native void drawPixels(long pointer, int[] pixels, int w, int h,
+  protected native void drawPixels(long pointer, int[] pixels, int w, int h,
                                  int stride, double[] i2u, double alpha,
                                  int interpolation);
 
-  private native void setGradient(long pointer, double x1, double y1,
+  protected native void setGradient(long pointer, double x1, double y1,
                                   double x2, double y2,
                                   int r1, int g1, int b1, int a1, int r2,
                                   int g2, int b2, int a2, boolean cyclic);
   
-  private native void setPaintPixels(long pointer, int[] pixels, int w,
+  protected native void setPaintPixels(long pointer, int[] pixels, int w,
                                        int h, int stride, boolean repeat,
                                        int x, int y);
 
   /**
    * Set the current transform matrix
    */
-  private native void cairoSetMatrix(long pointer, double[] m);
+  protected native void cairoSetMatrix(long pointer, double[] m);
   
   /**
    * Scaling method
    */
-  private native void cairoScale(long pointer, double x, double y);
+  protected native void cairoScale(long pointer, double x, double y);
 
   /**
    * Set the compositing operator
    */
-  private native void cairoSetOperator(long pointer, int cairoOperator);
+  protected native void cairoSetOperator(long pointer, int cairoOperator);
 
   /**
    * Sets the current color in RGBA as a 0.0-1.0 double
    */
-  private native void cairoSetRGBAColor(long pointer, double red, double green,
+  protected native void cairoSetRGBAColor(long pointer, double red, double green,
                                         double blue, double alpha);
 
   /**
    * Sets the current winding rule in Cairo
    */
-  private native void cairoSetFillRule(long pointer, int cairoFillRule);
+  protected native void cairoSetFillRule(long pointer, int cairoFillRule);
 
   /**
    * Set the line style, cap, join and miter limit.
    * Cap and join parameters are in the BasicStroke enumerations.
    */
-  private native void cairoSetLine(long pointer, double width, int cap,
+  protected native void cairoSetLine(long pointer, double width, int cap,
                                    int join, double miterLimit);
 
   /**
    * Set the dash style
    */
-  private native void cairoSetDash(long pointer, double[] dashes, int ndash,
+  protected native void cairoSetDash(long pointer, double[] dashes, int ndash,
                                    double offset);
 
   /*
@@ -397,121 +397,66 @@ public abstract class CairoGraphics2D extends Graphics2D
   /**
    * Set the font in cairo.
    */
-  private native void cairoSetFont(long pointer, GdkFontPeer font);
-
-  private native void cairoRelCurveTo(long pointer, double dx1, double dy1,
-                                      double dx2, double dy2, double dx3,
-                                      double dy3);
+  protected native void cairoSetFont(long pointer, GdkFontPeer font);
 
   /**
    * Appends a rectangle to the current path
    */
-  private native void cairoRectangle(long pointer, double x, double y,
+  protected native void cairoRectangle(long pointer, double x, double y,
                                      double width, double height);
   
   /**
    * Appends an arc to the current path
    */
-  private native void cairoArc(long pointer, double x, double y,
+  protected native void cairoArc(long pointer, double x, double y,
                                double radius, double angle1, double angle2);
 
   /**
    * Save / restore a cairo path
    */
-  private native void cairoSave(long pointer);
-  private native void cairoRestore(long pointer);
+  protected native void cairoSave(long pointer);
+  protected native void cairoRestore(long pointer);
 
   /**
    * New current path
    */
-  private native void cairoNewPath(long pointer);
+  protected native void cairoNewPath(long pointer);
 
   /** 
    * Close current path
    */
-  private native void cairoClosePath(long pointer);
+  protected native void cairoClosePath(long pointer);
 
   /** moveTo */
-  private native void cairoMoveTo(long pointer, double x, double y);
-
-  /** relative moveTo */
-  private native void cairoRelMoveTo(long pointer, double dx, double dy);
+  protected native void cairoMoveTo(long pointer, double x, double y);
 
   /** lineTo */
-  private native void cairoLineTo(long pointer, double x, double y);
-
-  /** relative lineTo */
-  private native void cairoRelLineTo(long pointer, double dx, double dy);
+  protected native void cairoLineTo(long pointer, double x, double y);
 
   /** Cubic curve-to */
-  private native void cairoCurveTo(long pointer, double x1, double y1,
+  protected native void cairoCurveTo(long pointer, double x1, double y1,
                                    double x2, double y2,
                                    double x3, double y3);
 
   /**
    * Stroke current path
    */
-  private native void cairoStroke(long pointer);
+  protected native void cairoStroke(long pointer);
 
   /**
    * Fill current path
    */
-  private native void cairoFill(long pointer, double alpha);
+  protected native void cairoFill(long pointer, double alpha);
 
   /** 
    * Clip current path
    */
-  private native void cairoClip(long pointer);
+  protected native void cairoClip(long pointer);
 
   /** 
    * Save clip
    */
-  private native void cairoPreserveClip(long pointer);
-
-  /** 
-   * Save clip
-   */
-  private native void cairoResetClip(long pointer);
-
-  /**
-   * Draws a line from (x1,y1) to (x2,y2).
-   *
-   * @param pointer the native pointer
-   *
-   * @param x1 the x coordinate of the starting point
-   * @param y1 the y coordinate of the starting point
-   * @param x2 the x coordinate of the end point
-   * @param y2 the y coordinate of the end point
-   */
-  private native void cairoDrawLine(long pointer, double x1, double y1,
-                                    double x2, double y2);
-
-  /**
-   * Draws a rectangle at starting point (x,y) and with the specified width
-   * and height.
-   *
-   * @param pointer the native pointer
-   * @param x the x coordinate of the upper left corner
-   * @param y the y coordinate of the upper left corner
-   * @param w the width of the rectangle
-   * @param h the height of the rectangle
-   */
-  private native void cairoDrawRect(long pointer, double x, double y, double w,
-                                    double h);
-
-  /**
-   * Fills a rectangle at starting point (x,y) and with the specified width
-   * and height.
-   *
-   * @param pointer the native pointer
-   * @param x the x coordinate of the upper left corner
-   * @param y the y coordinate of the upper left corner
-   * @param w the width of the rectangle
-   * @param h the height of the rectangle
-   */
-  private native void cairoFillRect(long pointer, double x, double y, double w,
-                                    double h);
-
+  protected native void cairoResetClip(long pointer);
 
   ///////////////////////// TRANSFORMS ///////////////////////////////////
   /**
@@ -2054,4 +1999,4 @@ public abstract class CairoGraphics2D extends Graphics2D
 
     return rect;
   }
-}
\ No newline at end of file
+}
index 098052a..be82f81 100644 (file)
@@ -112,6 +112,14 @@ public class ComponentGraphics extends CairoGraphics2D
    */
   private native long initState(GtkComponentPeer component);
 
+  /**
+   * Obtain and hold a GDK lock, which is required for all drawing operations
+   * in this graphics context (since it is backed by an X surface).
+   * 
+   * This method causes the GDK locking behaviour to be re-entrant.  No race
+   * conditions are caused since a ThreadLocal is used and each thread has its
+   * own lock counter.
+   */
   private void lock()
   {
     Integer i = (Integer) hasLock.get();
@@ -124,6 +132,9 @@ public class ComponentGraphics extends CairoGraphics2D
       hasLock.set(Integer.valueOf(i.intValue() + 1));
   }
 
+  /**
+   * Release the re-entrant GDK lock.
+   */
   private void unlock()
   {
     Integer i = (Integer) hasLock.get();
@@ -219,78 +230,54 @@ public class ComponentGraphics extends CairoGraphics2D
    */
   public void draw(Shape s)
   {
-    lock();
-    try
-      {
-        if (comp == null || comp instanceof AlphaComposite)
-          super.draw(s);
+    if (comp == null || comp instanceof AlphaComposite)
+      super.draw(s);
         
-        else
-          {
-            createBuffer();
+    else
+      {
+        createBuffer();
             
-            Graphics2D g2d = (Graphics2D)buffer.getGraphics();
-            g2d.setStroke(this.getStroke());
-            g2d.setColor(this.getColor());
-            g2d.draw(s);
+        Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+        g2d.setStroke(this.getStroke());
+        g2d.setColor(this.getColor());
+        g2d.draw(s);
             
-            drawComposite(s.getBounds2D(), null);
-          }
-      }
-    finally
-      {
-       unlock();
+        drawComposite(s.getBounds2D(), null);
       }
   }
 
   public void fill(Shape s)
   {
-    lock();
-    try
-      {
-        if (comp == null || comp instanceof AlphaComposite)
-          super.fill(s);
+    if (comp == null || comp instanceof AlphaComposite)
+      super.fill(s);
         
-        else
-          {
-            createBuffer();
+    else
+      {
+        createBuffer();
             
-            Graphics2D g2d = (Graphics2D)buffer.getGraphics();
-            g2d.setPaint(this.getPaint());
-            g2d.setColor(this.getColor());
-            g2d.fill(s);
+        Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+        g2d.setPaint(this.getPaint());
+        g2d.setColor(this.getColor());
+        g2d.fill(s);
             
-            drawComposite(s.getBounds2D(), null);
-          }
-      }
-    finally
-      {
-       unlock();
+        drawComposite(s.getBounds2D(), null);
       }
   }
 
   public void drawRenderedImage(RenderedImage image, AffineTransform xform)
   {
-    lock();
-    try
-      {
-        if (comp == null || comp instanceof AlphaComposite)
-          super.drawRenderedImage(image, xform);
+    if (comp == null || comp instanceof AlphaComposite)
+      super.drawRenderedImage(image, xform);
         
-        else
-          {
-            createBuffer();
+    else
+      {
+        createBuffer();
 
-            Graphics2D g2d = (Graphics2D)buffer.getGraphics();
-            g2d.setRenderingHints(this.getRenderingHints());
-            g2d.drawRenderedImage(image, xform);
+        Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+        g2d.setRenderingHints(this.getRenderingHints());
+        g2d.drawRenderedImage(image, xform);
             
-            drawComposite(buffer.getRaster().getBounds(), null);
-          }
-      }
-    finally
-      {
-       unlock();
+        drawComposite(buffer.getRaster().getBounds(), null);
       }
   }
 
@@ -298,81 +285,65 @@ public class ComponentGraphics extends CairoGraphics2D
                              Color bgcolor, ImageObserver obs)
   {
     boolean rv;
-    lock();
-    try
-      {
-        if (comp == null || comp instanceof AlphaComposite)
-          rv = super.drawImage(img, xform, bgcolor, obs);
+    if (comp == null || comp instanceof AlphaComposite)
+      rv = super.drawImage(img, xform, bgcolor, obs);
         
-        else
+    else
+      {
+        // Get buffered image of source
+        if( !(img instanceof BufferedImage) )
           {
-            // Get buffered image of source
-            if( !(img instanceof BufferedImage) )
-              {
-                ImageProducer source = img.getSource();
-                if (source == null)
-                  return false;
-                img = Toolkit.getDefaultToolkit().createImage(source);
-              }
-            BufferedImage bImg = (BufferedImage) img;
+            ImageProducer source = img.getSource();
+            if (source == null)
+              return false;
+            img = Toolkit.getDefaultToolkit().createImage(source);
+          }
+        BufferedImage bImg = (BufferedImage) img;
             
-            // Find translated bounds
-            Point2D origin = new Point2D.Double(bImg.getMinX(), bImg.getMinY());
-            Point2D pt = new Point2D.Double(bImg.getWidth() + bImg.getMinX(),
-                                            bImg.getHeight() + bImg.getMinY());
-            if (xform != null)
-              {
-                origin = xform.transform(origin, origin);
-                pt = xform.transform(pt, pt);
-              }
+        // Find translated bounds
+        Point2D origin = new Point2D.Double(bImg.getMinX(), bImg.getMinY());
+        Point2D pt = new Point2D.Double(bImg.getWidth() + bImg.getMinX(),
+                                        bImg.getHeight() + bImg.getMinY());
+        if (xform != null)
+          {
+            origin = xform.transform(origin, origin);
+            pt = xform.transform(pt, pt);
+          }
             
-            // Create buffer and draw image
-            createBuffer();
+        // Create buffer and draw image
+        createBuffer();
             
-            Graphics2D g2d = (Graphics2D)buffer.getGraphics();
-            g2d.setRenderingHints(this.getRenderingHints());
-            g2d.drawImage(img, xform, obs);
-
-            // Perform compositing
-            rv = drawComposite(new Rectangle2D.Double(origin.getX(),
-                                                        origin.getY(),
-                                                        pt.getX(), pt.getY()),
-                                 obs);
-          }
-      }
-    finally
-      {
-       unlock();
+        Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+        g2d.setRenderingHints(this.getRenderingHints());
+        g2d.drawImage(img, xform, obs);
+
+        // Perform compositing
+        rv = drawComposite(new Rectangle2D.Double(origin.getX(),
+                                                  origin.getY(),
+                                                  pt.getX(), pt.getY()),
+                           obs);
       }
     return rv;
   }
 
   public void drawGlyphVector(GlyphVector gv, float x, float y)
   {
-    lock();
-    try
-      {
-        if (comp == null || comp instanceof AlphaComposite)
-          super.drawGlyphVector(gv, x, y);
+    if (comp == null || comp instanceof AlphaComposite)
+      super.drawGlyphVector(gv, x, y);
         
-        else
-          {
-            createBuffer();
+    else
+      {
+        createBuffer();
 
-            Graphics2D g2d = (Graphics2D)buffer.getGraphics();
-            g2d.setPaint(this.getPaint());
-            g2d.setStroke(this.getStroke());
-            g2d.drawGlyphVector(gv, x, y);
+        Graphics2D g2d = (Graphics2D)buffer.getGraphics();
+        g2d.setPaint(this.getPaint());
+        g2d.setStroke(this.getStroke());
+        g2d.drawGlyphVector(gv, x, y);
             
-            Rectangle2D bounds = gv.getLogicalBounds();
-            bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(),
-                                            bounds.getWidth(), bounds.getHeight());
-            drawComposite(bounds, null);
-          }
-      }
-    finally
-      {
-       unlock();
+        Rectangle2D bounds = gv.getLogicalBounds();
+        bounds = new Rectangle2D.Double(x + bounds.getX(), y + bounds.getY(),
+                                        bounds.getWidth(), bounds.getHeight());
+        drawComposite(bounds, null);
       }
   }
   
@@ -466,20 +437,6 @@ public class ComponentGraphics extends CairoGraphics2D
     return super.drawImage(bimg, x, y, width, height, observer);
   }
 
-  public void setClip(Shape s)
-  {
-    lock();
-    try
-      {
-       super.setClip(s);
-      }
-    finally
-      {
-       unlock();
-      }
-  }
-
-  
   private boolean drawComposite(Rectangle2D bounds, ImageObserver observer)
   {
     // Clip source to visible areas that need updating
@@ -507,12 +464,10 @@ public class ComponentGraphics extends CairoGraphics2D
     Rectangle2D.intersect(deviceBounds, this.getClipInDevSpace(), deviceBounds);
     
     // Get current image on the component
-    unlock();
     GtkImage img = grab(component);
     Graphics gr = componentBuffer.createGraphics();
     gr.drawImage(img, 0, 0, null);
     gr.dispose();
-    lock();
     
     BufferedImage cBuffer = componentBuffer;
     if (!deviceBounds.equals(cBuffer.getRaster().getBounds()))
@@ -573,5 +528,417 @@ public class ComponentGraphics extends CairoGraphics2D
   {
     return GtkVolatileImage.gdkColorModel;
   }
+  
+  /* --- START OVERRIDDEN NATIVE METHODS ----
+   * All native methods in CairoGraphics2D should be overridden here and
+   * enclosed in locks, since the cairo surface is backed by an X surface
+   * in this graphics context and the X surface requires external locking.
+   * 
+   * We lock everything "just in case", since it's difficult to know which
+   * calls are and aren't thread-safe.  Overriding and locking the native
+   * methods allows superclass code in CairoGraphics2D to execute properly, 
+   * without the need to override every single method.
+   * 
+   * CAVEAT: if native code obtains a lock (using gdk_threads_enter(), not the
+   * lock() method provided here) and then calls back into Java and one of these
+   * methods ends up being called, we will deadlock.  The lock is only reentrant
+   * when called via our lock() method. 
+   */
+  @Override
+  protected long init(long pointer)
+  {
+    long ret;
+    
+    try
+    {
+      lock();
+      ret = super.init(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+    
+    return ret;
+  }
+  
+  @Override
+  public void disposeNative(long pointer)
+  {
+    try
+    {
+      lock();
+      super.disposeNative(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void drawPixels(long pointer, int[] pixels, int w, int h,
+                            int stride, double[] i2u, double alpha,
+                            int interpolation)
+  {
+    try
+    {
+      lock();
+      super.drawPixels(pointer, pixels, w, h, stride, i2u, alpha,
+                       interpolation);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void setGradient(long pointer, double x1, double y1, 
+                             double x2, double y2, 
+                             int r1, int g1, int b1, int a1,
+                             int r2, int g2, int b2, int a2, boolean cyclic)
+  {
+    try
+    {
+      lock();
+      super.setGradient(pointer, x1, y1, x2, y2, r1, g1, b1, a1, r2, g2, b2, a2,
+                        cyclic);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void setPaintPixels(long pointer, int[] pixels, int w, int h,
+                                int stride, boolean repeat, int x, int y)
+  {
+    try
+    {
+      lock();
+      super.setPaintPixels(pointer, pixels, w, h, stride, repeat, x, y);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetMatrix(long pointer, double[] m)
+  {
+    try
+    {
+      lock();
+      super.cairoSetMatrix(pointer, m);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoScale(long pointer, double x, double y)
+  {
+    try
+    {
+      lock();
+      super.cairoScale(pointer, x, y);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetOperator(long pointer, int cairoOperator)
+  {
+    try
+    {
+      lock();
+      super.cairoSetOperator(pointer, cairoOperator);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetRGBAColor(long pointer, double red, double green,
+                                   double blue, double alpha)
+  {
+    try
+    {
+      lock();
+      super.cairoSetRGBAColor(pointer, red, green, blue, alpha);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetFillRule(long pointer, int cairoFillRule)
+  {
+    try
+    {
+      lock();
+      super.cairoSetFillRule(pointer, cairoFillRule);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetLine(long pointer, double width, int cap, int join,
+                              double miterLimit)
+  {
+    try
+    {
+      lock();
+      super.cairoSetLine(pointer, width, cap, join, miterLimit);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetDash(long pointer, double[] dashes, int ndash, 
+                              double offset)
+  {
+    try
+    {
+      lock();
+      super.cairoSetDash(pointer, dashes, ndash, offset);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoDrawGlyphVector(long pointer, GdkFontPeer font,
+                                      float x, float y, int n,
+                                      int[] codes, float[] positions)
+  {
+    try
+    {
+      lock();
+      super.cairoDrawGlyphVector(pointer, font, x, y, n, codes, positions);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSetFont(long pointer, GdkFontPeer font)
+  {
+    try
+    {
+      lock();
+      super.cairoSetFont(pointer, font);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoRectangle(long pointer, double x, double y,
+                                double width, double height)
+  {
+    try
+    {
+      lock();
+      super.cairoRectangle(pointer, x, y, width, height);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoArc(long pointer, double x, double y, 
+                          double radius, double angle1, double angle2)
+  {
+    try
+    {
+      lock();
+      super.cairoArc(pointer, x, y, radius, angle1, angle2);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoSave(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoSave(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoRestore(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoRestore(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoNewPath(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoNewPath(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoClosePath(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoClosePath(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoMoveTo(long pointer, double x, double y)
+  {
+    try
+    {
+      lock();
+      super.cairoMoveTo(pointer, x, y);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoLineTo(long pointer, double x, double y)
+  {
+    try
+    {
+      lock();
+      super.cairoLineTo(pointer, x, y);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoCurveTo(long pointer, double x1, double y1, double x2,
+                              double y2, double x3, double y3)
+  {
+    try
+    {
+      lock();
+      super.cairoCurveTo(pointer, x1, y1, x2, y2, x3, y3);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoStroke(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoStroke(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoFill(long pointer, double alpha)
+  {
+    try
+    {
+      lock();
+      super.cairoFill(pointer, alpha);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoClip(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoClip(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
+  
+  @Override
+  protected void cairoResetClip(long pointer)
+  {
+    try
+    {
+      lock();
+      super.cairoResetClip(pointer);
+    }
+    finally
+    {
+      unlock();
+    }
+  }
 }
-
index c4a7f1b..3e88d57 100644 (file)
@@ -1,10 +1,10 @@
 /* DO NOT EDIT THIS FILE - it is machine generated */
 
+#include <jni.h>
+
 #ifndef __gnu_java_awt_peer_gtk_CairoGraphics2D__
 #define __gnu_java_awt_peer_gtk_CairoGraphics2D__
 
-#include <jni.h>
-
 #ifdef __cplusplus
 extern "C"
 {
@@ -24,7 +24,6 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetLine (
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetDash (JNIEnv *env, jobject, jlong, jdoubleArray, jint, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector (JNIEnv *env, jobject, jlong, jobject, jfloat, jfloat, jint, jintArray, jfloatArray);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFont (JNIEnv *env, jobject, jlong, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRectangle (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoArc (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSave (JNIEnv *env, jobject, jlong);
@@ -32,18 +31,13 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRestore (
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoNewPath (JNIEnv *env, jobject, jlong);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClosePath (JNIEnv *env, jobject, jlong);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoMoveTo (JNIEnv *env, jobject, jlong, jdouble, jdouble);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelMoveTo (JNIEnv *env, jobject, jlong, jdouble, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoLineTo (JNIEnv *env, jobject, jlong, jdouble, jdouble);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelLineTo (JNIEnv *env, jobject, jlong, jdouble, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoCurveTo (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoStroke (JNIEnv *env, jobject, jlong);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFill (JNIEnv *env, jobject, jlong, jdouble);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClip (JNIEnv *env, jobject, jlong);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip (JNIEnv *env, jobject, jlong);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoResetClip (JNIEnv *env, jobject, jlong);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawLine (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawRect (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFillRect (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
+
 #undef gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_NEAREST
 #define gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_NEAREST 0L
 #undef gnu_java_awt_peer_gtk_CairoGraphics2D_INTERPOLATION_BILINEAR
index 2df1246..3dd8bb4 100644 (file)
@@ -1,10 +1,10 @@
 /* DO NOT EDIT THIS FILE - it is machine generated */
 
+#include <jni.h>
+
 #ifndef __gnu_java_awt_peer_gtk_ComponentGraphics__
 #define __gnu_java_awt_peer_gtk_ComponentGraphics__
 
-#include <jni.h>
-
 #ifdef __cplusplus
 extern "C"
 {
index 2c472c4..10383cb 100644 (file)
Binary files a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class and b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class differ
index 0e67187..54e9916 100644 (file)
Binary files a/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class and b/libjava/classpath/lib/gnu/java/awt/peer/gtk/ComponentGraphics.class differ
index bd63ac3..b183a1b 100644 (file)
@@ -609,40 +609,6 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoCurveTo
 }
 
 JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelMoveTo 
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong pointer, jdouble dx, jdouble dy)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_rel_move_to (gr->cr, dx, dy);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelLineTo 
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong pointer, jdouble dx, jdouble dy)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_rel_line_to (gr->cr, dx, dy);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo 
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong pointer, jdouble dx1, jdouble dy1,
- jdouble dx2, jdouble dy2, jdouble dx3, jdouble dy3)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_rel_curve_to (gr->cr, dx1, dy1, dx2, dy2, dx3, dy3);
-}
-
-JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRectangle 
 (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
  jlong pointer, jdouble x, jdouble y, jdouble width, jdouble height)
@@ -726,57 +692,6 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoResetClip
   cairo_reset_clip( gr->cr );
 }
 
-JNIEXPORT void JNICALL 
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip 
-(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)),
- jlong pointer)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_clip_preserve( gr->cr );
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawLine
-(JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)),
- jlong pointer, jdouble x1, jdouble y1, jdouble x2, jdouble y2)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_new_path(gr->cr);
-  cairo_move_to(gr->cr, x1, y1);
-  cairo_line_to(gr->cr, x2, y2);
-  cairo_stroke(gr->cr);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawRect
-(JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)),
- jlong pointer, jdouble x, jdouble y, jdouble w, jdouble h)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_new_path(gr->cr);
-  cairo_rectangle(gr->cr, x, y, w, h);
-  cairo_stroke(gr->cr);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFillRect
-(JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)),
- jlong pointer, jdouble x, jdouble y, jdouble w, jdouble h)
-{
-  struct cairographics2d *gr = JLONG_TO_PTR(struct cairographics2d, pointer);
-  g_assert (gr != NULL);
-
-  cairo_new_path(gr->cr);
-  cairo_rectangle(gr->cr, x, y, w, h);
-  cairo_fill(gr->cr);
-}
-
 static void 
 update_pattern_transform (struct cairographics2d *gr)
 {
index a20f472..1be46fb 100644 (file)
@@ -88,8 +88,8 @@ public:
   virtual void copy(::gnu::java::awt::peer::gtk::CairoGraphics2D *, jlong);
   virtual void finalize();
   virtual void dispose();
-private:
-  jlong init(jlong);
+public: // actually protected
+  virtual jlong init(jlong);
 public:
   virtual ::java::awt::Graphics * create() = 0;
   virtual ::java::awt::GraphicsConfiguration * getDeviceConfiguration() = 0;
@@ -98,41 +98,34 @@ public: // actually protected
   virtual ::java::awt::geom::Rectangle2D * getRealBounds() = 0;
 public:
   virtual void disposeNative(jlong);
-private:
-  void drawPixels(jlong, JArray< jint > *, jint, jint, jint, JArray< jdouble > *, jdouble, jint);
-  void setGradient(jlong, jdouble, jdouble, jdouble, jdouble, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
-  void setPaintPixels(jlong, JArray< jint > *, jint, jint, jint, jboolean, jint, jint);
-  void cairoSetMatrix(jlong, JArray< jdouble > *);
-  void cairoScale(jlong, jdouble, jdouble);
-  void cairoSetOperator(jlong, jint);
-  void cairoSetRGBAColor(jlong, jdouble, jdouble, jdouble, jdouble);
-  void cairoSetFillRule(jlong, jint);
-  void cairoSetLine(jlong, jdouble, jint, jint, jdouble);
-  void cairoSetDash(jlong, JArray< jdouble > *, jint, jdouble);
+public: // actually protected
+  virtual void drawPixels(jlong, JArray< jint > *, jint, jint, jint, JArray< jdouble > *, jdouble, jint);
+  virtual void setGradient(jlong, jdouble, jdouble, jdouble, jdouble, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
+  virtual void setPaintPixels(jlong, JArray< jint > *, jint, jint, jint, jboolean, jint, jint);
+  virtual void cairoSetMatrix(jlong, JArray< jdouble > *);
+  virtual void cairoScale(jlong, jdouble, jdouble);
+  virtual void cairoSetOperator(jlong, jint);
+  virtual void cairoSetRGBAColor(jlong, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoSetFillRule(jlong, jint);
+  virtual void cairoSetLine(jlong, jdouble, jint, jint, jdouble);
+  virtual void cairoSetDash(jlong, JArray< jdouble > *, jint, jdouble);
 public: // actually package-private
   virtual void cairoDrawGlyphVector(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *, jfloat, jfloat, jint, JArray< jint > *, JArray< jfloat > *);
-private:
-  void cairoSetFont(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *);
-  void cairoRelCurveTo(jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
-  void cairoRectangle(jlong, jdouble, jdouble, jdouble, jdouble);
-  void cairoArc(jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
-  void cairoSave(jlong);
-  void cairoRestore(jlong);
-  void cairoNewPath(jlong);
-  void cairoClosePath(jlong);
-  void cairoMoveTo(jlong, jdouble, jdouble);
-  void cairoRelMoveTo(jlong, jdouble, jdouble);
-  void cairoLineTo(jlong, jdouble, jdouble);
-  void cairoRelLineTo(jlong, jdouble, jdouble);
-  void cairoCurveTo(jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
-  void cairoStroke(jlong);
-  void cairoFill(jlong, jdouble);
-  void cairoClip(jlong);
-  void cairoPreserveClip(jlong);
-  void cairoResetClip(jlong);
-  void cairoDrawLine(jlong, jdouble, jdouble, jdouble, jdouble);
-  void cairoDrawRect(jlong, jdouble, jdouble, jdouble, jdouble);
-  void cairoFillRect(jlong, jdouble, jdouble, jdouble, jdouble);
+public: // actually protected
+  virtual void cairoSetFont(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *);
+  virtual void cairoRectangle(jlong, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoArc(jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoSave(jlong);
+  virtual void cairoRestore(jlong);
+  virtual void cairoNewPath(jlong);
+  virtual void cairoClosePath(jlong);
+  virtual void cairoMoveTo(jlong, jdouble, jdouble);
+  virtual void cairoLineTo(jlong, jdouble, jdouble);
+  virtual void cairoCurveTo(jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoStroke(jlong);
+  virtual void cairoFill(jlong, jdouble);
+  virtual void cairoClip(jlong);
+  virtual void cairoResetClip(jlong);
 public:
   virtual void setTransform(::java::awt::geom::AffineTransform *);
 private:
index 1f11a4b..534834b 100644 (file)
@@ -7,6 +7,8 @@
 #pragma interface
 
 #include <gnu/java/awt/peer/gtk/CairoGraphics2D.h>
+#include <gcj/array.h>
+
 extern "Java"
 {
   namespace gnu
@@ -24,6 +26,7 @@ extern "Java"
           namespace gtk
           {
               class ComponentGraphics;
+              class GdkFontPeer;
               class GtkComponentPeer;
               class GtkImage;
           }
@@ -101,12 +104,40 @@ public:
   virtual void drawGlyphVector(::java::awt::font::GlyphVector *, jfloat, jfloat);
   virtual jboolean drawImage(::java::awt::Image *, jint, jint, ::java::awt::image::ImageObserver *);
   virtual jboolean drawImage(::java::awt::Image *, jint, jint, jint, jint, ::java::awt::image::ImageObserver *);
-  virtual void setClip(::java::awt::Shape *);
 private:
   jboolean drawComposite(::java::awt::geom::Rectangle2D *, ::java::awt::image::ImageObserver *);
   void createBuffer();
 public: // actually protected
   virtual ::java::awt::image::ColorModel * getNativeCM();
+  virtual jlong init(jlong);
+public:
+  virtual void disposeNative(jlong);
+public: // actually protected
+  virtual void drawPixels(jlong, JArray< jint > *, jint, jint, jint, JArray< jdouble > *, jdouble, jint);
+  virtual void setGradient(jlong, jdouble, jdouble, jdouble, jdouble, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
+  virtual void setPaintPixels(jlong, JArray< jint > *, jint, jint, jint, jboolean, jint, jint);
+  virtual void cairoSetMatrix(jlong, JArray< jdouble > *);
+  virtual void cairoScale(jlong, jdouble, jdouble);
+  virtual void cairoSetOperator(jlong, jint);
+  virtual void cairoSetRGBAColor(jlong, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoSetFillRule(jlong, jint);
+  virtual void cairoSetLine(jlong, jdouble, jint, jint, jdouble);
+  virtual void cairoSetDash(jlong, JArray< jdouble > *, jint, jdouble);
+  virtual void cairoDrawGlyphVector(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *, jfloat, jfloat, jint, JArray< jint > *, JArray< jfloat > *);
+  virtual void cairoSetFont(jlong, ::gnu::java::awt::peer::gtk::GdkFontPeer *);
+  virtual void cairoRectangle(jlong, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoArc(jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoSave(jlong);
+  virtual void cairoRestore(jlong);
+  virtual void cairoNewPath(jlong);
+  virtual void cairoClosePath(jlong);
+  virtual void cairoMoveTo(jlong, jdouble, jdouble);
+  virtual void cairoLineTo(jlong, jdouble, jdouble);
+  virtual void cairoCurveTo(jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
+  virtual void cairoStroke(jlong);
+  virtual void cairoFill(jlong, jdouble);
+  virtual void cairoClip(jlong);
+  virtual void cairoResetClip(jlong);
 private:
   static jboolean hasXRenderExtension;
   ::gnu::java::awt::peer::gtk::GtkComponentPeer * __attribute__((aligned(__alignof__( ::gnu::java::awt::peer::gtk::CairoGraphics2D)))) component;