[cairo-commit] cairo-java/src/java/org/freedesktop/cairo PdfSurface.java, 1.6, 1.7 PngSurface.java, 1.4, 1.5

Jeffrey Morgan commit at pdx.freedesktop.org
Fri Apr 1 05:58:47 PST 2005


Committed by: kuzman

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

Modified Files:
	PdfSurface.java PngSurface.java 
Log Message:
Incorporated upstream API changes

Index: PdfSurface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/PdfSurface.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- PdfSurface.java	25 Mar 2005 16:18:54 -0000	1.6
+++ PdfSurface.java	1 Apr 2005 13:58:45 -0000	1.7
@@ -60,20 +60,20 @@
 			if (!dir.canWrite())
 				throw new IOException("Cannot write to file: " + filename);
 		}
-		return cairo_pdf_surface_create_for_file(filename, widthInches, heightInches, xPixels, yPixels);
+		return cairo_pdf_surface_create(filename, widthInches, heightInches, xPixels, yPixels);
 	}
 	
 	void makeTarget(Cairo cr) {
-		cairo_set_target_pdf_as_file(cr.getHandle(), getHandle(), width, height, xPixels, yPixels);
+		cairo_set_target_pdf(cr.getHandle(), getHandle(), width, height, xPixels, yPixels);
 	}
 
 	/*
 	 * Native calls
 	 */
-	native static final private void cairo_set_target_pdf_as_file(Handle cr, Handle sur, 
+	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_for_file(String filename,
+	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);
 	native static final private void close(Handle handle);

Index: PngSurface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/PngSurface.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- PngSurface.java	24 Mar 2005 18:11:40 -0000	1.4
+++ PngSurface.java	1 Apr 2005 13:58:45 -0000	1.5
@@ -18,24 +18,19 @@
 public class PngSurface extends Surface {
 	
 	private String filename;
-	private Format format;
-	private int width;
-	private int height;
+//	private int width;
+//	private int height;
 
-	public PngSurface(String filename, Format format, int width, int height)  
+	public PngSurface(String filename)  
 			throws IOException {
-		super(initialize(filename, format, width, height));
-		this.filename = filename;
-		this.format = format;
-		this.width = width;
-		this.height = height;
+		super(initialize(filename));
 	}
 	
 	public void close() {
 		close(getHandle());
 	}
 	
-	private static Handle initialize(String filename, Format format, int width, int height)
+	private static Handle initialize(String filename)
 			throws IOException {
 		File f = new File(filename);
 		
@@ -58,20 +53,20 @@
 			if (!dir.canWrite())
 				throw new IOException("Cannot write to file: " + filename);
 		}
-		return cairo_png_surface_create(filename, format.getValue(), width, height);
-		
+		int[] w = new int[1];
+		int[] h = new int[1];
+		return cairo_image_surface_create_for_png(filename, w, h);
 	}
 	
 	void makeTarget(Cairo cr) {
-		cairo_set_target_png(cr.getHandle(), getHandle(), format.getValue(), width, height);
+		cairo_set_target_surface(cr.getHandle(), getHandle());
 	}
 
 	/*
 	 * Native calls
 	 */
-	native static final private void cairo_set_target_png(Handle cr, Handle sur,
-				int format, int width, int height);
-	native static final private Handle cairo_png_surface_create(String filename, 
-				int format, int width, int height);
+	native static final private void cairo_set_target_surface(Handle cr, Handle sur);
+	native static final private Handle cairo_image_surface_create_for_png(String filename, 
+				int[] width, int[] height);
 	native static final private void close(Handle handle);
 }




More information about the cairo-commit mailing list