[cairo-commit] cairo-java/src/java/org/freedesktop/cairo Matrix.java, 1.5, 1.6 Surface.java, 1.6, 1.7

Jeffrey Morgan commit at pdx.freedesktop.org
Fri May 6 07:58:42 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo
In directory gabe:/tmp/cvs-serv24750/src/java/org/freedesktop/cairo

Modified Files:
	Matrix.java Surface.java 
Log Message:
ongoing API cleanup

Index: Matrix.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Matrix.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Matrix.java	6 May 2005 13:22:01 -0000	1.5
+++ Matrix.java	6 May 2005 14:58:40 -0000	1.6
@@ -90,16 +90,6 @@
 	}
 
 	/**
-	 * Appends uniform scaling transformation to this matrix.
-	 * 
-	 * @param scaleFactor
-	 *            The uniform scaling factor.
-	 */
-	public void scale(double scaleFactor) {
-		scale(scaleFactor, scaleFactor);
-	}
-
-	/**
 	 * Appends rotation transformation to this matrix.
 	 * 
 	 * @param radians
@@ -110,22 +100,6 @@
 	}
 
 	/**
-	 * Appends rotation around a given point, to this transformation.
-	 * 
-	 * @param radians
-	 *            Rotation angle in radians.
-	 * @param cx
-	 *            The X co-ordinate of the center of rotation
-	 * @param cy
-	 *            The Y co-ordinate of the center of rotation
-	 */
-	public void rotate(double radians, double cx, double cy) {
-		cairo_matrix_translate(getHandle(), cx, cy);
-		cairo_matrix_rotate(getHandle(), radians);
-		cairo_matrix_translate(getHandle(), -cx, -cy);
-	}
-
-	/**
 	 * Inverts this matrix.
 	 */
 	public void invert() {

Index: Surface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Surface.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Surface.java	3 May 2005 01:36:15 -0000	1.6
+++ Surface.java	6 May 2005 14:58:40 -0000	1.7
@@ -17,21 +17,28 @@
  */
 public class Surface extends CairoObject {
 	
-    public Surface(Surface other, Format format, int width, int height) {
-        super(cairo_surface_create_similar(other.getHandle(), format.getValue(), width, height));
+    public Surface() {
+        super(initRef());
+    }
+    
+    static Handle initRef() {
+        Handle hndl = getNullHandle();
+        cairo_surface_reference(hndl);
+        return hndl;
     }
     
     Surface(Handle hndl) {
     	super(hndl);
     }
     
-    /**
-     * Disposes native resources used by the surface. Do not use the surface
-     * once it is disposed.
-     *  
-     */
-    public void dispose() {
-    	cairo_surface_destroy(getHandle());
+    protected void finalize() throws Throwable {
+        cairo_surface_destroy(getHandle());
+        super.finalize();
+    }
+    
+    public Surface createSimilar(Format format, int width, int height) {
+        return new Surface(cairo_surface_create_similar(getHandle(), 
+                format.getValue(), width, height));
     }
     
     /**
@@ -97,8 +104,10 @@
     native static final private Handle cairo_surface_create_similar(Handle other, int format, int width, int height);
     native static final private void cairo_surface_reference(Handle obj);
     native static final private void cairo_surface_destroy(Handle obj);
-    native static final private int cairo_surface_set_repeat(Handle obj, int repeat);
     native static final private int cairo_surface_finish(Handle obj);
+    
+
+    native static final private int cairo_surface_set_repeat(Handle obj, int repeat);
     native static final private int cairo_surface_set_matrix(Handle obj, Handle matrix);
     native static final private int cairo_surface_get_matrix(Handle obj, Handle matrix);
     native static final private int cairo_surface_set_filter(Handle obj, int filter);




More information about the cairo-commit mailing list