[cairo-commit] cairo-java/src/java/org/freedesktop/cairo Matrix.java, 1.6, 1.7 Context.java, 1.3, 1.4 PngSurface.java, 1.8, NONE Surface.java, 1.7, 1.8 PDFSurface.java, 1.1, 1.2 ImageSurface.java, 1.7, 1.8 Operator.java, 1.3, 1.4 Status.java, 1.5, 1.6

Jeffrey Morgan commit at pdx.freedesktop.org
Fri May 6 17:27:04 PDT 2005


Committed by: kuzman

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

Modified Files:
	Matrix.java Context.java Surface.java PDFSurface.java 
	ImageSurface.java Operator.java Status.java 
Removed Files:
	PngSurface.java 
Log Message:
update so we compile after massive upstream API change.

Index: Matrix.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Matrix.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Matrix.java	6 May 2005 14:58:40 -0000	1.6
+++ Matrix.java	7 May 2005 00:27:02 -0000	1.7
@@ -21,51 +21,6 @@
 	}
 
 	/**
-	 * Default constructor. Creates a default identity matrix.
-	 */
-	public Matrix() {
-		super(cairo_matrix_create());
-	}
-
-	public Matrix(Matrix copy) {
-		super(copy(copy));
-	}
-
-	/**
-	 * Constructs a matrix using the affine parameters.
-	 */
-	public Matrix(double xx, double yx, double xy, double yy,
-			double x0, double y0) {
-		super(cairo_matrix_create());
-		setXX(getHandle(), xx);
-		setYX(getHandle(), yx);
-		setXY(getHandle(), xy);
-		setYY(getHandle(), yy);
-		setX0(getHandle(), x0);
-		setY0(getHandle(), y0);
-	}
-
-	private static Handle copy(Matrix copy) {
-		Handle hndl = Struct.getNullHandle();
-		cairo_matrix_copy(hndl, copy.getHandle());
-		return hndl;
-	}
-
-	/**
-	 * Disposes all the native resources used by the matrix.
-	 */
-	public void dispose() {
-		cairo_matrix_destroy(getHandle());
-	}
-
-	/**
-	 * Sets the matrix to identity matrix (no transformations).
-	 */
-	public void setIdentity() {
-		cairo_matrix_set_identity(getHandle());
-	}
-
-	/**
 	 * Appends a transaltion transformation to this matrix.
 	 * 
 	 * @param tx
@@ -204,14 +159,7 @@
 	native static final private void setYY(Handle matrix, double yy);
 	native static final private void setX0(Handle matrix, double x0);
 	native static final private void setY0(Handle matrix, double y0);
-	
-	native static final private Handle cairo_matrix_create();
-	native static final private void cairo_matrix_destroy(Handle matrix);
-	native static final private void cairo_matrix_copy(Handle matrix,
-			Handle other);
-	native static final private void cairo_matrix_set_identity(Handle matrix);
-	native static final private void cairo_matrix_set_affine(Handle matrix,
-			double a, double b, double c, double d, double tx, double ty);
+
 	native static final private void cairo_matrix_get_affine(Handle matrix,
 			double[] a, double[] b, double[] c, double[] d, double[] tx,
 			double[] ty);

Index: Context.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Context.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Context.java	6 May 2005 13:22:01 -0000	1.3
+++ Context.java	7 May 2005 00:27:02 -0000	1.4
@@ -13,50 +13,17 @@
 
 public class Context extends CairoObject {
 	
-	private CurrentPath currentPath;
-	
 	/**
 	 * Create a new cairo target (cairo_t) 
 	 */
-	public Context() {
-		super(cairo_create());
+	public Context(Surface surface) {
+		super(cairo_create(surface.getHandle()));
 	}
 	
-    /**
-     * This function copies all current state information in
-     * another <tt>Cairo</tt>.
-     * This includes the current point and path, the target surface,
-     * the transformation matrix, and so forth.
-     * The stack of states saved with {@link #save()} is not not copied;
-     * nor are any saved states on the destination target cleared.
-     * The operation only copies the current state of this <tt>Target</tt>
-     * to the current state of the destination <tt>Target</tt>.
-     */
-    public Context(Context copy) {
-        super(copy(copy));
-    }
-    
-	/**
-     * Constructs a new cairo state that draws on an cairo surface.
-     * 
-     * @param surface
-     *            cairo surface
-     */
-    public Context(Surface surface) {
-        this();
-        setTargetSurface(surface);
-    }
-    
     Context(Handle hndl) {
         super(hndl);
     }
 
-    static private Handle copy(Context copy) {
-    	Handle hndl = Struct.getNullHandle();
-    	cairo_copy(hndl, copy.getHandle());
-    	return hndl;
-    }
-    
     /**
      * Disposes all the native resources used by the object.
      *  
@@ -85,27 +52,6 @@
 		cairo_restore(getHandle());
 	}
     
-    /**
-     * This function copies all current state information from the current
-     * context. This includes the current point and path, the target surface,
-     * the transformation matrix, and so forth.
-     *
-     * The stack of states saved with save() is <emphasis>not</emphasis>
-     * copied. 
-     * @return a copy of the current Contexst
-     */
-    public Context copy() {
-        return new Context(copy(this));
-    }
-	
-	/**
-	 * Directs output for to a given {@link Surface}.
-	 * @param surface the surface to draw on.
-	 */
-	public void setTargetSurface(Surface surface) {
-		surface.makeTarget(this);
-	}
-	
 	/**
 	 * Sets the drawing operator. 
 	 * @param op
@@ -789,10 +735,6 @@
 		return new Pattern(hndl);
 	}
 	
-	public double getAlpha() {
-		return cairo_get_alpha(getHandle());
-	}
-	
     /**
      * Returns the tesselation tolerance of the current state.
      * 
@@ -860,17 +802,6 @@
 		return new Matrix(hndl);
 	}
 
-    /**
-     * Returns the target surface (the surface used to draw shapes on) of this
-     * state.
-     * 
-     * @return The target surface of this state.
-     */
-	public Surface getTargetSurface() {
-		Handle hndl = cairo_get_target_surface(getHandle());
-		return new Surface(hndl);
-	}
-    
 	public void arc(double xc, double yc, double radius, double angle1, double angle2) {
 		cairo_arc(getHandle(), xc, yc, radius, angle1, angle2);
 	}
@@ -938,45 +869,15 @@
         return cairo_status_string(getHandle());
     }
     
-    public void getPath(CurrentPath path) {
-    	currentPath = path;
-        cairo_get_path(getHandle(), this);
-    }
-    
-    public void getPathFlat(CurrentPath path) {
-    	currentPath = path;
-        cairo_get_path_flat(getHandle(), this);
-    }
-	
-    private void move_to(double x, double y) {
-    	currentPath.moveTo(x, y);
-    }
-
-    private void line_to(double x, double y) {
-    	currentPath.lineTo(x, y);
-    }
-
-    private void curve_to(double x1, double y1, double x2, double y2, double x3, double y3) {
-    	currentPath.curveTo(x1, y1, x2, y2, x3, y3);
-    }
-
-    private void close_path() {
-    	currentPath.closePath();
-    }
-
     /*
      * Native calls
      */
-	native static final private Handle cairo_create();
+	native static final private Handle cairo_create(Handle surface);
 	// TODO: API
 	native static final private void cairo_reference(Handle obj);
 	native static final private void cairo_destroy(Handle obj);
 	native static final private void cairo_save(Handle obj);
 	native static final private void cairo_restore(Handle obj);
-	native static final private void cairo_copy(Handle obj, Handle src);
-	native static final void cairo_set_target_surface(Handle obj, Handle surface);
-	native static final void cairo_set_target_image(Handle obj, char[] data, int format, int width, int height, int stride);
-	native static final void cairo_set_target_image_no_data(Handle obj, int format, int width, int height);
 	native static final private void cairo_set_operator(Handle obj, int operator);
 	native static final private void cairo_set_source(Handle obj, Handle pattern);
 	native static final private void cairo_set_source_rgb(Handle obj, double red, double green, double blue);
@@ -1042,7 +943,6 @@
 	native static final private int cairo_get_operator(Handle obj);
 	native static final private void cairo_get_rgb_color(Handle obj, double[] red, double[] green, double[] blue);
 	native static final private Handle cairo_get_source(Handle obj);
-	native static final private double cairo_get_alpha(Handle obj);
 	native static final private double cairo_get_tolerance(Handle obj);
 	native static final private void cairo_get_current_point(Handle obj, double[] x, double[] y);
 	native static final private int cairo_get_fill_rule(Handle obj);
@@ -1051,9 +951,8 @@
 	native static final private int cairo_get_line_join(Handle obj);
 	native static final private double cairo_get_miter_limit(Handle obj);
 	native static final private void cairo_get_matrix(Handle obj, Handle matrix);
-	native static final Handle cairo_get_target_surface(Handle obj);
-	native static final private void cairo_get_path(Handle obj, Object cairo);
-    native static final private void cairo_get_path_flat(Handle obj, Object cairo);
+	// TODO: API JNI
+	native static final Handle cairo_get_target(Handle obj);
 	native static final private int cairo_status(Handle obj);
 	native static final private String cairo_status_string(Handle obj);
 	

--- PngSurface.java DELETED ---

Index: Surface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Surface.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Surface.java	6 May 2005 14:58:40 -0000	1.7
+++ Surface.java	7 May 2005 00:27:02 -0000	1.8
@@ -8,7 +8,6 @@
  */
 package org.freedesktop.cairo;
 
-import org.gnu.javagnome.Struct;
 import org.gnu.javagnome.Handle;
 
 /**
@@ -41,63 +40,14 @@
                 format.getValue(), width, height));
     }
     
-    /**
-     * Sets the repeat count for filling (//TODO: Figure out what this is)
-     * 
-     * @param repeat
-     *            The repeat count.
-     */
-    public void setRepeat(int repeat) {
-    	int status = cairo_surface_set_repeat(getHandle(), repeat);
-    }
-    
     public void finish() {
     	int status = cairo_surface_finish(getHandle());
     }
     
-    /**
-     * Sets the transformation matrix for the surface.
-     * 
-     * @param matrix
-     *            Transformation matrix
-     */
-    public void setMatrix(Matrix matrix) {
-        int status = cairo_surface_set_matrix(getHandle(), matrix.getHandle());
-    }
-    
-    /**
-     * Returns the transformation matrix of the surface.
-     * 
-     * @return The transformation matrix.
-     */
-    public Matrix getMatrix() {
-    	Handle hndl = Struct.getNullHandle();
-    	int status = cairo_surface_get_matrix(getHandle(), hndl);
-    	return new Matrix(hndl);
-    }
-
-    /**
-     * Sets the filter for the surface (???)
-     * 
-     * @param filter
-     *            The filter specification
-     */
-    public void setFilter(Filter filter) {
-        int status = cairo_surface_set_filter(getHandle(), filter.getValue());
-    }
-    
-    public Filter getFilter() {
-    	return Filter.intern(cairo_surface_get_filter(getHandle()));
-    }
-    
     public void setDeviceOffset(double xOffset, double yOffset) {
     	cairo_surface_set_device_offset(getHandle(), xOffset, yOffset);
     }
     
-    void makeTarget(Context cairo) {
-    	Context.cairo_set_target_surface(cairo.getHandle(), getHandle());
-    }
-
     /*
      * Native calls
      */
@@ -106,12 +56,6 @@
     native static final private void cairo_surface_destroy(Handle obj);
     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);
-    native static final private int cairo_surface_get_filter(Handle obj);
     native static final private void cairo_surface_set_device_offset(Handle obj, double xOff, double yOff);
 
 }

Index: PDFSurface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/PDFSurface.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PDFSurface.java	3 May 2005 01:40:40 -0000	1.1
+++ PDFSurface.java	7 May 2005 00:27:02 -0000	1.2
@@ -63,16 +63,9 @@
 		return cairo_pdf_surface_create(filename, widthInches, heightInches, xPixels, yPixels);
 	}
 	
-	void makeTarget(Context cr) {
-		cairo_set_target_pdf(cr.getHandle(), getHandle(), width, height, xPixels, yPixels);
-	}
-
 	/*
 	 * Native calls
 	 */
-	native static final private void cairo_set_target_pdf(Handle cr, Handle sur, 
-				double width_inches, double height_inches,
-				double x_pixels_per_inch, double y_pixels_per_inch);
 	native static final private Handle cairo_pdf_surface_create(String filename,
 				double width_inches, double height_inches,
 				double x_pixels_per_inch, double y_pixels_per_inch);

Index: ImageSurface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/ImageSurface.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ImageSurface.java	3 May 2005 01:36:15 -0000	1.7
+++ ImageSurface.java	7 May 2005 00:27:02 -0000	1.8
@@ -41,14 +41,6 @@
 		super(hndl);
 	}
 	
-	void makeTarget(Context cr) {
-		if (null == data)
-			Context.cairo_set_target_image_no_data(cr.getHandle(), format.getValue(), width, height);
-		else
-			Context.cairo_set_target_image(cr.getHandle(), data, format.getValue(), width, height, stride);
-		setHandle(Context.cairo_get_target_surface(cr.getHandle()));
-	}
-	
 	/*
 	 * Native calls
 	 */

Index: Operator.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Operator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Operator.java	6 May 2005 13:24:57 -0000	1.3
+++ Operator.java	7 May 2005 00:27:02 -0000	1.4
@@ -15,26 +15,26 @@
 public class Operator extends Enum {
     static final private int _CLEAR = 0;
     static final public Operator CLEAR = new Operator (_CLEAR);
-    static final private int _SRC = 1;
-    static final public Operator SRC = new Operator (_SRC);
-    static final private int _DST = 2;
-    static final public Operator DST = new Operator (_DST);
-    static final private int _OVER = 3;
+    static final private int _SOURCE = 1;
+    static final public Operator SOURCE = new Operator (_SOURCE);
+    static final private int _OVER = 2;
     static final public Operator OVER = new Operator (_OVER);
-    static final private int _OVER_REVERSE = 4;
-    static final public Operator OVER_REVERSE = new Operator (_OVER_REVERSE);
-    static final private int _IN = 5;
+    static final private int _IN = 3;
     static final public Operator IN = new Operator (_IN);
-    static final private int _IN_REVERSE = 6;
-    static final public Operator IN_REVERSE = new Operator (_IN_REVERSE);
-    static final private int _OUT = 7;
+    static final private int _OUT = 4;
     static final public Operator OUT = new Operator (_OUT);
-    static final private int _OUT_REVERSE = 8;
-    static final public Operator OUT_REVERSE = new Operator (_OUT_REVERSE);
-    static final private int _ATOP = 9;
+    static final private int _ATOP = 5;
     static final public Operator ATOP = new Operator (_ATOP);
-    static final private int _ATOP_REVERSE = 10;
-    static final public Operator ATOP_REVERSE = new Operator (_ATOP_REVERSE);
+    static final private int _DEST = 6;
+    static final public Operator DEST = new Operator (_DEST);
+    static final private int _DEST_OVER = 7;
+    static final public Operator DEST_OVER = new Operator (_DEST_OVER);
+    static final private int _DEST_IN = 8;
+    static final public Operator DEST_IN = new Operator (_DEST_IN);
+    static final private int _DEST_OUT = 9;
+    static final public Operator DEST_OUT = new Operator (_DEST_OUT);
+    static final private int _DEST_ATOP = 10;
+    static final public Operator DEST_ATOP = new Operator (_DEST_ATOP);
     static final private int _XOR = 11;
     static final public Operator XOR = new Operator (_XOR);
     static final private int _ADD = 12;
@@ -42,8 +42,8 @@
     static final private int _SATURATE = 13;
     static final public Operator SATURATE = new Operator (_SATURATE);
     static final private Operator[] theInterned = new Operator[] {
-        CLEAR, SRC, DST, OVER, OVER_REVERSE, IN, IN_REVERSE, OUT, OUT_REVERSE,
-        ATOP, ATOP_REVERSE, XOR, ADD, SATURATE
+        CLEAR, SOURCE, OVER, IN, OUT, ATOP, DEST, DEST_OVER, DEST_IN,
+        DEST_OUT, DEST_ATOP, XOR, ADD, SATURATE
     };
     static private java.util.Hashtable theInternedExtras;
     static final private Operator theSacrificialOne = new Operator (0);

Index: Status.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Status.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Status.java	6 May 2005 11:50:55 -0000	1.5
+++ Status.java	7 May 2005 00:27:02 -0000	1.6
@@ -30,21 +30,23 @@
     static final public Status NULL_POINTER = new Status (_NULL_POINTER);
     static final private int _INVALID_STRING = 8;
     static final public Status INVALID_STRING = new Status (_INVALID_STRING);
-    static final private int _INVALID_DATA_PATH = 9;
-    static final public Status INVALID_DATA_PATH = new Status (_INVALID_DATA_PATH);
-    static final private int _WRITE_ERROR = 10;
+    static final private int _INVALID_PATH_DATA = 9;
+    static final public Status INVALID_PATH_DATA = new Status (_INVALID_PATH_DATA);
+    static final private int _READ_ERROR = 10;
+    static final public Status READ_ERROR = new Status (_READ_ERROR);
+    static final private int _WRITE_ERROR = 11;
     static final public Status WRITE_ERROR = new Status (_WRITE_ERROR);
-    static final private int _SURFACE_FINISHED = 9;
+    static final private int _SURFACE_FINISHED = 12;
     static final public Status SURFACE_FINISHED = new Status (_SURFACE_FINISHED);
-    static final private int _SURFACE_TYPE_MISMATCH = 10;
+    static final private int _SURFACE_TYPE_MISMATCH = 13;
     static final public Status SURFACE_TYPE_MISMATCH = new Status (_SURFACE_TYPE_MISMATCH);
-    static final private int _BAD_NESTING = 11;
+    static final private int _BAD_NESTING = 14;
     static final public Status BAD_NESTING = new Status (_BAD_NESTING);
 
     static final private Status[] theInterned = new Status[] {
         SUCCESS, NO_MEMORY, INVALID_RESTORE, INVALID_POP_GROUP, NO_CURRENT_POINT,
-        INVALID_MATRIX, NO_TARGET_SURFACE, NULL_POINTER, INVALID_STRING, INVALID_DATA_PATH,
-        WRITE_ERROR, SURFACE_FINISHED, SURFACE_TYPE_MISMATCH, BAD_NESTING
+        INVALID_MATRIX, NO_TARGET_SURFACE, NULL_POINTER, INVALID_STRING, INVALID_PATH_DATA,
+        READ_ERROR, WRITE_ERROR, SURFACE_FINISHED, SURFACE_TYPE_MISMATCH, BAD_NESTING
     };
     static private java.util.Hashtable theInternedExtras;
     static final private Status theSacrificialOne = new Status (0);




More information about the cairo-commit mailing list