[cairo-commit] cairo-java/test/snippets Snippets.java, 1.2, 1.3 CairoSnippetsPS.java, 1.1, 1.2 CairoSnippetsPDF.java, 1.2, 1.3

Jeffrey Morgan commit at pdx.freedesktop.org
Sat Apr 23 09:48:30 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/snippets
In directory gabe:/tmp/cvs-serv27983/test/snippets

Modified Files:
	Snippets.java CairoSnippetsPS.java CairoSnippetsPDF.java 
Log Message:
updated methods to reflect upstream API changes.

Index: Snippets.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/Snippets.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Snippets.java	11 Apr 2005 00:47:22 -0000	1.2
+++ Snippets.java	23 Apr 2005 16:48:28 -0000	1.3
@@ -76,8 +76,7 @@
 		cr.stroke();
 
 		/* draw helping lines */
-		cr.setRGBColor(1,0.2,0.2);
-		cr.setAlpha(0.6);
+		cr.setSourceRGBA(1,0.2,0.2, 0.6);
 		cr.arc(xc, yc, 0.05, 0, 2*M_PI);
 		cr.fill();
 		cr.setLineWidth(0.03);
@@ -104,8 +103,7 @@
 		cr.stroke();
 
 		/* draw helping lines */
-		cr.setRGBColor(1,0.2,0.2);
-		cr.setAlpha(0.6);
+		cr.setSourceRGBA(1,0.2,0.2, 0.6);
 		cr.arc(xc, yc, 0.05, 0, 2*M_PI);
 		cr.fill();
 		cr.setLineWidth(0.03);
@@ -129,7 +127,7 @@
 		                         consumed by cairo_clip() */
 		cr.rectangle(0, 0, 1, 1);
 		cr.fill();
-		cr.setRGBColor(0, 1, 0);
+		cr.setSourceRGB(0, 1, 0);
 		cr.moveTo(0, 0);
 		cr.lineTo(1, 1);
 		cr.moveTo(1, 0);
@@ -153,8 +151,7 @@
 
 		cr.stroke();
 
-		cr.setRGBColor(1,0.2,0.2);
-		cr.setAlpha(0.6);
+		cr.setSourceRGBA(1, 0.2, 0.2, 0.6);
 		cr.setLineWidth(0.03);
 		cr.moveTo(x,y);   cr.lineTo(x1,y1);
 		cr.moveTo(x2,y2); cr.lineTo(x3,y3);
@@ -218,11 +215,10 @@
 
 		/* and fill/stroke it */
 		cr.save();
-	    cr.setRGBColor(0.5,0.5,1);
+	    cr.setSourceRGB(0.5, 0.5, 1);
 	    cr.fill();
 		cr.restore();
-		cr.setAlpha(0.5);
-		cr.setRGBColor(0.5, 0,0);
+		cr.setSourceRGBA(0.5, 0, 0, 0.5);
 		cr.stroke();
 	}
 
@@ -238,7 +234,7 @@
 		cr.curveTo(0.2, 0.9, 0.2, 0.5, 0.5, 0.5);
 
 		cr.save();
-		cr.setRGBColor(0, 0, 1);
+		cr.setSourceRGB(0, 0, 1);
 		cr.fill();
 		cr.restore();
 
@@ -266,7 +262,7 @@
 
 
 		cr.save();
-	    cr.setRGBColor(0, 0, 1);
+	    cr.setSourceRGB(0, 0, 1);
 	    cr.fill();
 		cr.restore();
 
@@ -284,14 +280,14 @@
 		pat.addColorStop(1, new RGBColor(0, 0, 0), 1);
 		pat.addColorStop(0, new RGBColor(1, 1, 1), 1);
 		cr.rectangle(0,0,1,1);
-		cr.setPattern(pat);
+		cr.setSource(pat);
 		cr.fill();
 
 		pat.dispose();
 		pat = new Pattern(0.45, 0.4, 0.1, 0.4, 0.4, 0.5);
 		pat.addColorStop(0, new RGBColor(1, 1, 1), 1);
 		pat.addColorStop(1, new RGBColor(0, 0, 0), 1);
-		cr.setPattern(pat);
+		cr.setSource(pat);
 		cr.arc(0.5, 0.5, 0.3, 0, 2 * M_PI);
 		cr.fill();
 		pat.dispose();
@@ -330,7 +326,7 @@
 		cr.stroke();
 
 		/* draw helping lines */
-		cr.setRGBColor(1,0.2,0.2);
+		cr.setSourceRGB(1,0.2,0.2);
 		cr.setLineWidth(0.01);
 		cr.moveTo(0.25, 0.2); 
 		cr.lineTo(0.25, 0.8);
@@ -382,15 +378,14 @@
 		cr.moveTo(0.27, 0.65);
 		cr.textPath("void");
 		cr.save();
-		cr.setRGBColor(0.5,0.5,1);
+		cr.setSourceRGB(0.5,0.5,1);
 		cr.fill();
 		cr.restore();
 		cr.setLineWidth(0.01);
 		cr.stroke();
 
 		/* draw helping lines */
-		cr.setRGBColor(1,0.2,0.2);
-		cr.setAlpha(0.6);
+		cr.setSourceRGBA(1, 0.2, 0.2, 0.6);
 		cr.arc(0.04, 0.53, 0.02, 0, 2*M_PI);
 		cr.arc(0.27, 0.65, 0.02, 0, 2*M_PI);
 		cr.fill();
@@ -413,8 +408,7 @@
 		cr.showText("cairo");
 
 		/* draw helping lines */
-		cr.setRGBColor(1,0.2,0.2);
-		cr.setAlpha(0.6);
+		cr.setSourceRGBA(1, 0.2, 0.2, 0.6);
 		cr.arc(x, y, 0.05, 0, 2*M_PI);
 		cr.fill();
 		cr.moveTo(0.5, 0);
@@ -442,8 +436,7 @@
 		cr.showText(utf8);
 
 		/* draw helping lines */
-		cr.setRGBColor(1,0.2,0.2);
-		cr.setAlpha(0.6);
+		cr.setSourceRGBA(1, 0.2, 0.2, 0.6);
 		cr.arc(x, y, 0.05, 0, 2*M_PI);
 		cr.fill();
 		cr.moveTo(x,y);
@@ -504,22 +497,22 @@
 
 		cr.moveTo(0.1, -50);
 		cr.lineTo(0.1,  50);
-		cr.setRGBColor(1, 0 ,0);
+		cr.setSourceRGB(1, 0 ,0);
 		cr.stroke();
 
 		cr.moveTo(0.2, -60);
 		cr.lineTo(0.2,  60);
-		cr.setRGBColor(1, 1 ,0);
+		cr.setSourceRGB(1, 1 ,0);
 		cr.stroke();
 
 		cr.moveTo(0.3, -70);
 		cr.lineTo(0.3,  70);
-		cr.setRGBColor(0, 1 ,0);
+		cr.setSourceRGB(0, 1 ,0);
 		cr.stroke();
 
 		cr.moveTo(0.4, -80);
 		cr.lineTo(0.4,  80);
-		cr.setRGBColor(0, 0 ,1);
+		cr.setSourceRGB(0, 0 ,1);
 		cr.stroke();
 	}
 

Index: CairoSnippetsPS.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPS.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CairoSnippetsPS.java	15 Mar 2005 02:12:01 -0000	1.1
+++ CairoSnippetsPS.java	23 Apr 2005 16:48:28 -0000	1.2
@@ -22,8 +22,8 @@
 	public static double X_PPI = 300.0;
 	public static double Y_PPI = 300.0;
 
-	public static double WIDTH  = X_INCHES * 96.0;
-	public static double HEIGHT = Y_INCHES * 96.0;
+	public static double WIDTH  = X_INCHES * 72.0;
+	public static double HEIGHT = Y_INCHES * 72.0;
 	
 
 	public static void main(String[] args) throws Exception {

Index: CairoSnippetsPDF.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPDF.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CairoSnippetsPDF.java	15 Mar 2005 02:12:01 -0000	1.2
+++ CairoSnippetsPDF.java	23 Apr 2005 16:48:28 -0000	1.3
@@ -21,8 +21,8 @@
 	public static double X_PPI = 300.0;
 	public static double Y_PPI = 300.0;
 
-	public static double WIDTH  = X_INCHES * 96.0;
-	public static double HEIGHT = Y_INCHES * 96.0;
+	public static double WIDTH  = X_INCHES * 72.0;
+	public static double HEIGHT = Y_INCHES * 72.0;
 	
 
 	public static void main(String[] args) throws Exception {




More information about the cairo-commit mailing list