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

Jeffrey Morgan commit at pdx.freedesktop.org
Mon May 2 18:36:18 PDT 2005


Committed by: kuzman

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

Modified Files:
	Snippets.java CairoSnippetsPDF.java CairoSnippetsPNG.java 
Removed Files:
	CairoSnippetsPS.java 
Log Message:
Renamed BoundingBox to Box, Cairo to Context, and removed PsSurface

Index: Snippets.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/Snippets.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Snippets.java	23 Apr 2005 16:48:28 -0000	1.3
+++ Snippets.java	3 May 2005 01:36:16 -0000	1.4
@@ -12,7 +12,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
-import org.freedesktop.cairo.Cairo;
+import org.freedesktop.cairo.Context;
 import org.freedesktop.cairo.FontSlant;
 import org.freedesktop.cairo.FontWeight;
 import org.freedesktop.cairo.LineCap;
@@ -49,13 +49,13 @@
 		"xxx_self_intersect"
 	};
 	
-	public static void invokeSnippet(Snippets snip, int num, Cairo cr, double width, double height) 
+	public static void invokeSnippet(Snippets snip, int num, Context cr, double width, double height) 
 			throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
-		Method m = Snippets.class.getMethod(snippets[num], new Class[] {Cairo.class, double.class, double.class});
+		Method m = Snippets.class.getMethod(snippets[num], new Class[] {Context.class, double.class, double.class});
 		m.invoke(snip, new Object[] {cr, new Double(width), new Double(height)});
 	}
 
-	public void normalize(Cairo cr, double width, double height) {
+	public void normalize(Context cr, double width, double height) {
 		cr.scale(width, height);
 		cr.setLineWidth(0.04);
 	}
@@ -63,7 +63,7 @@
 	/**
 	 * arc snippet
 	 */
-	public void arc(Cairo cr, double width, double height) {
+	public void arc(Context cr, double width, double height) {
 		double xc = 0.5;
 		double yc = 0.5;
 		double radius = 0.4;
@@ -90,7 +90,7 @@
 	/**
 	 * arc_negative snippet
 	 */
-	public void arc_negative(Cairo cr, double width, double height) {
+	public void arc_negative(Context cr, double width, double height) {
 		double xc = 0.5;
 		double yc = 0.5;
 		double radius = 0.4;
@@ -117,7 +117,7 @@
 	/**
 	 * clip snippet
 	 */
-	public void clip(Cairo cr, double width, double height) {
+	public void clip(Context cr, double width, double height) {
 		normalize (cr, width, height);
 
 		cr.arc(0.5, 0.5, 0.3, 0, 2 * M_PI);
@@ -138,7 +138,7 @@
 	/**
 	 * curve_to snippet
 	 */
-	public void curve_to(Cairo cr, double width, double height) {
+	public void curve_to(Context cr, double width, double height) {
 		double x=0.1,  y=0.5;
 		double x1=0.4, y1=0.9,
 		       x2=0.6, y2=0.1,
@@ -161,7 +161,7 @@
 	/**
 	 * curve_rectangle snippet
 	 */
-	public void curve_rectangle(Cairo cr, double width, double height) {
+	public void curve_rectangle(Context cr, double width, double height) {
 		/* a custom shape, that could be wrapped in a function */
 		double x0	   = 0.1,   /*< parameters like cairo_rectangle */
 		       y0	   = 0.1,
@@ -225,7 +225,7 @@
 	/**
 	 * fill_and_stroke snippet
 	 */
-	public void fill_and_stroke(Cairo cr, double width, double height) {
+	public void fill_and_stroke(Context cr, double width, double height) {
 		normalize(cr, width, height);
 
 		cr.moveTo(0.5, 0.1);
@@ -245,7 +245,7 @@
 	/**
 	 * fill_and_stroke2 snippet
 	 */
-	public void fill_and_stroke2(Cairo cr, double width, double height) {
+	public void fill_and_stroke2(Context cr, double width, double height) {
 		normalize (cr, width, height);
 
 		cr.moveTo(0.5, 0.1);
@@ -272,7 +272,7 @@
 	/**
 	 * gradient snippet
 	 */
-	public void gradient(Cairo cr, double width, double height) {
+	public void gradient(Context cr, double width, double height) {
 		
 		normalize (cr, width, height);
 
@@ -296,7 +296,7 @@
 	/**
 	 * path snippet
 	 */
-	public void path(Cairo cr, double width, double height) {
+	public void path(Context cr, double width, double height) {
 		normalize(cr, width, height);
 		cr.moveTo(0.5, 0.1);
 		cr.lineTo(0.9, 0.9);
@@ -309,7 +309,7 @@
 	/**
 	 * set_line_cap snippet
 	 */
-	public void set_line_cap(Cairo cr, double width, double height) {
+	public void set_line_cap(Context cr, double width, double height) {
 		normalize(cr, width, height);
 		cr.setLineWidth(0.12);
 		cr.setLineCap(LineCap.BUTT); /* default */
@@ -340,7 +340,7 @@
 	/**
 	 * set_line_join snippet
 	 */
-	public void set_line_join(Cairo cr, double width, double height) {
+	public void set_line_join(Context cr, double width, double height) {
 		normalize(cr, width, height);
 		cr.setLineWidth(0.16);
 		cr.moveTo(0.3, 0.33);
@@ -367,7 +367,7 @@
 	/**
 	 * text snippet
 	 */
-	public void text(Cairo cr, double width, double height) {
+	public void text(Context cr, double width, double height) {
 		normalize (cr, width, height);
 		cr.selectFontFace("Sans", FontSlant.NORMAL, FontWeight.BOLD);
 		cr.setFontSize(0.35);
@@ -394,7 +394,7 @@
 	/**
 	 * text_align_center snippet
 	 */
-	public void text_align_center(Cairo cr, double width, double height) {
+	public void text_align_center(Context cr, double width, double height) {
 
 		normalize (cr, width, height);
 
@@ -421,7 +421,7 @@
 	/**
 	 * text_extents snippet
 	 */
-	public void text_extents(Cairo cr, double width, double height) {
+	public void text_extents(Context cr, double width, double height) {
 		double x=0.1;
 		double y=0.6;
 		String utf8 = "cairo";
@@ -449,7 +449,7 @@
 	/**
 	 * xxx_clip_rectangle snippet
 	 */
-	public void xxx_clip_rectangle(Cairo cr, double width, double height) {
+	public void xxx_clip_rectangle(Context cr, double width, double height) {
 		normalize (cr, width, height);
 
 		cr.newPath();
@@ -470,7 +470,7 @@
 	/**
 	 * xxx_dash snippet
 	 */
-	public void xxx_dash(Cairo cr, double width, double height) {
+	public void xxx_dash(Context cr, double width, double height) {
 		double dashes[] = {0.20,  /* ink */
 		                   0.05,  /* skip */
 		                   0.05,  /* ink */
@@ -492,7 +492,7 @@
 	/**
 	 * xxx_long_lines snippet
 	 */
-	public void xxx_long_lines(Cairo cr, double width, double height) {
+	public void xxx_long_lines(Context cr, double width, double height) {
 		normalize(cr, width, height);
 
 		cr.moveTo(0.1, -50);
@@ -519,7 +519,7 @@
 	/**
 	 * xxx_multi_segment_caps snippet
 	 */
-	public void xxx_multi_segment_caps(Cairo cr, double width, double height) {
+	public void xxx_multi_segment_caps(Context cr, double width, double height) {
 		normalize(cr, width, height);
 
 		cr.moveTo(0.2, 0.3);
@@ -539,7 +539,7 @@
 	/**
 	 * xxx_self_intersect snippet
 	 */
-	public void xxx_self_intersect(Cairo cr, double width, double height) {
+	public void xxx_self_intersect(Context cr, double width, double height) {
 		normalize(cr, width, height);
 
 		cr.moveTo(0.3, 0.3);

--- CairoSnippetsPS.java DELETED ---

Index: CairoSnippetsPDF.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPDF.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CairoSnippetsPDF.java	23 Apr 2005 16:48:28 -0000	1.3
+++ CairoSnippetsPDF.java	3 May 2005 01:36:16 -0000	1.4
@@ -9,7 +9,7 @@
 
 package snippets;
 
-import org.freedesktop.cairo.Cairo;
+import org.freedesktop.cairo.Context;
 import org.freedesktop.cairo.PdfSurface;
 
 /**
@@ -27,7 +27,7 @@
 
 	public static void main(String[] args) throws Exception {
 		// initialize
-		Cairo cr = new Cairo();
+		Context cr = new Context();
 		PdfSurface surface = new PdfSurface("./snippets.pdf", X_INCHES, Y_INCHES, X_PPI, Y_PPI);
 		cr.setTargetSurface(surface);
 		

Index: CairoSnippetsPNG.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPNG.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CairoSnippetsPNG.java	2 Apr 2005 16:07:34 -0000	1.3
+++ CairoSnippetsPNG.java	3 May 2005 01:36:16 -0000	1.4
@@ -9,7 +9,7 @@
 
 package snippets;
 
-import org.freedesktop.cairo.Cairo;
+import org.freedesktop.cairo.Context;
 import org.freedesktop.cairo.Format;
 import org.freedesktop.cairo.ImageSurface;
 import org.freedesktop.cairo.PngSurface;
@@ -28,7 +28,7 @@
 		Snippets snip = new Snippets();
 		for (int i = 0; i < Snippets.snippets.length; i++) {
 			String filename = "./" + Snippets.snippets[i] + ".png";
-			Cairo cr = new Cairo();
+			Context cr = new Context();
 			PngSurface surface = new PngSurface(Format.ARGB32, IMAGE_WIDTH, IMAGE_HEIGHT);
 			//PngSurface surface = new PngSurface(filename);
 			cr.setTargetSurface(surface);




More information about the cairo-commit mailing list