[cairo-commit] cairo-java/src/java/org/freedesktop/cairo PDFSurface.java, 1.2, 1.3

Jeffrey Morgan commit at pdx.freedesktop.org
Mon May 16 07:44:15 PDT 2005


Committed by: kuzman

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

Modified Files:
	PDFSurface.java 
Log Message:
Updated PDFSurface to reflect upstream changes.

Index: PDFSurface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/PDFSurface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PDFSurface.java	7 May 2005 00:27:02 -0000	1.2
+++ PDFSurface.java	16 May 2005 14:44:13 -0000	1.3
@@ -20,25 +20,25 @@
 	private String filename;
 	private double width;
 	private double height;
-	private double xPixels;
-	private double yPixels;
 	
-	public PDFSurface(String filename, double widthInches, double heightInches,
-				double xPixelsPerInch, double yPixelsPerInch) throws IOException {
-		super(initialize(filename, widthInches, heightInches, xPixelsPerInch, yPixelsPerInch));
+	public PDFSurface(String filename, double widthInches, double heightInches)
+				throws IOException {
+		super(initialize(filename, widthInches, heightInches));
 		this.filename = filename;
 		width = widthInches;
 		height = heightInches;
-		xPixels = xPixelsPerInch;
-		yPixels = yPixelsPerInch;
 	}
 	
 	public void close() {
 		close(getHandle());
 	}
 	
-	private static Handle initialize(String filename, double widthInches, double heightInches,
-				double xPixels, double yPixels) throws IOException {
+	public void setPPI(double xPPI, double yPPI) {
+		cairo_pdf_surface_set_ppi(getHandle(), xPPI, yPPI);
+	}
+	
+	private static Handle initialize(String filename, double widthInches, double heightInches)
+				throws IOException {
 		File f = new File(filename);
 		
 		if (f.isDirectory())
@@ -60,14 +60,14 @@
 			if (!dir.canWrite())
 				throw new IOException("Cannot write to file: " + filename);
 		}
-		return cairo_pdf_surface_create(filename, widthInches, heightInches, xPixels, yPixels);
+		return cairo_pdf_surface_create(filename, widthInches, heightInches);
 	}
 	
 	/*
 	 * Native calls
 	 */
 	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);
+				double width_inches, double height_inches);
 	native static final private void close(Handle handle);
+	native static final private void cairo_pdf_surface_set_ppi(Handle handle, double x, double y);
 }




More information about the cairo-commit mailing list