[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_Matrix.c, 1.3, 1.4 org_freedesktop_cairo_Context.c, 1.1, 1.2

Jeffrey Morgan commit at pdx.freedesktop.org
Fri May 6 04:50:58 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/src/jni
In directory gabe:/tmp/cvs-serv9076/src/jni

Modified Files:
	org_freedesktop_cairo_Matrix.c org_freedesktop_cairo_Context.c 
Log Message:
Ongoing API cleanup - removed Affine, added/removed methods from Context and Matrix.

Index: org_freedesktop_cairo_Matrix.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_Matrix.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- org_freedesktop_cairo_Matrix.c	25 Apr 2005 14:00:53 -0000	1.3
+++ org_freedesktop_cairo_Matrix.c	6 May 2005 11:50:56 -0000	1.4
@@ -19,6 +19,174 @@
 
 /*
  * Class:     org_freedesktop_cairo_Matrix
+ * Method:    getXX
+ * Signature: (Lorg/gnu/javagnome/Handle;)I
+ */
+JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Matrix_getXX
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	return matrix->xx;	
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    getYX
+ * Signature: (Lorg/gnu/javagnome/Handle;)I
+ */
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Matrix_getYX
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	return matrix->yx;	
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    getXY
+ * Signature: (Lorg/gnu/javagnome/Handle;)I
+ */
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Matrix_getXY
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	return matrix->xy;	
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    getYY
+ * Signature: (Lorg/gnu/javagnome/Handle;)I
+ */
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Matrix_getYY
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	return matrix->yy;	
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    getX0
+ * Signature: (Lorg/gnu/javagnome/Handle;)I
+ */
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Matrix_getX0
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	return matrix->x0;	
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    getY0
+ * Signature: (Lorg/gnu/javagnome/Handle;)I
+ */
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Matrix_getY0
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	return matrix->y0;	
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    setXX
+ * Signature: (Lorg/gnu/javagnome/Handle;D)D
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Matrix_setXX
+  (JNIEnv *env, jclass cls, jobject obj, jdouble value)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	matrix->xx = (double)value;
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    setYX
+ * Signature: (Lorg/gnu/javagnome/Handle;D)D
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Matrix_setYX
+  (JNIEnv *env, jclass cls, jobject obj, jdouble value)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	matrix->yx = (double)value;
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    setXY
+ * Signature: (Lorg/gnu/javagnome/Handle;D)D
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Matrix_setXY
+  (JNIEnv *env, jclass cls, jobject obj, jdouble value)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	matrix->xy = (double)value;
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    setYY
+ * Signature: (Lorg/gnu/javagnome/Handle;D)D
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Matrix_setYY
+  (JNIEnv *env, jclass cls, jobject obj, jdouble value)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	matrix->yy = (double)value;
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    setX0
+ * Signature: (Lorg/gnu/javagnome/Handle;D)D
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Matrix_setX0
+  (JNIEnv *env, jclass cls, jobject obj, jdouble value)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	matrix->x0 = (double)value;
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
+ * Method:    setY0
+ * Signature: (Lorg/gnu/javagnome/Handle;D)D
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Matrix_setY0
+  (JNIEnv *env, jclass cls, jobject obj, jdouble value)
+{
+	cairo_matrix_t *matrix;
+	
+	matrix = (cairo_matrix_t*)getPointerFromHandle(env, obj);
+	matrix->y0 = (double)value;
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Matrix
  * Method:    cairo_matrix_create
  * Signature: ()Lorg/gnu/glib/Handle;
  */

Index: org_freedesktop_cairo_Context.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_Context.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- org_freedesktop_cairo_Context.c	3 May 2005 01:36:15 -0000	1.1
+++ org_freedesktop_cairo_Context.c	6 May 2005 11:50:56 -0000	1.2
@@ -41,6 +41,20 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_reference
+ * Signature: (Lorg/gnu/javagnome/Handle;)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1reference
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_t *cr;
+	
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	cairo_reference(cr);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_destroy
  * Signature: (Lorg/gnu/glib/Handle;)V
  */
@@ -155,6 +169,22 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_set_source_surface
+ * Signature: (Lorg/gnu/javagnome/Handle;Lorg/gnu/javagnome/Handle;DD)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1set_1source_1surface
+  (JNIEnv *env, jclass cls, jobject obj, jobject sur, jdouble sx, jdouble sy)
+{
+	cairo_t *cr;
+	cairo_surface_t *surface;
+
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	surface = (cairo_surface_t*)getPointerFromHandle(env, surface);
+	cairo_set_source_surface(cr, surface, sx, sy);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_set_tolerance
  * Signature: (Lorg/gnu/glib/Handle;D)V
  */
@@ -525,6 +555,38 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_mask
+ * Signature: (Lorg/gnu/javagnome/Handle;Lorg/gnu/javagnome/Handle;)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1mask
+   (JNIEnv *env, jclass cls, jobject obj, jobject pat)
+ {
+ 	cairo_t *cr;
+ 	cairo_pattern_t *pattern;
+ 	
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	pattern = (cairo_pattern_t*)getPointerFromHandle(env, pat);
+ 	cairo_mask(cr, pattern);
+ }
+
+/*
+ * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_mask_surface
+ * Signature: (Lorg/gnu/javagnome/Handle;Lorg/gnu/javagnome/Handle;DD)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1mask_1surface
+  (JNIEnv *env, jclass cls, jobject obj, jobject sur, jdouble sx, jdouble sy)
+{
+ 	cairo_t *cr;
+ 	cairo_surface_t *surface;
+ 	
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	surface = (cairo_surface_t*)getPointerFromHandle(env, sur);
+ 	cairo_mask_surface(cr, surface, sx, sy);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_stroke
  * Signature: (Lorg/gnu/glib/Handle;)V
  */
@@ -537,6 +599,20 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_stroke_preserve
+ * Signature: (Lorg/gnu/javagnome/Handle;)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1stroke_1preserve
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_t *cr;
+	
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	cairl_stroke_preserve(cr);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_fill
  * Signature: (Lorg/gnu/glib/Handle;)V
  */
@@ -549,6 +625,20 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_fill_preserve
+ * Signature: (Lorg/gnu/javagnome/Handle;)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1fill_1preserve
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_t *cr;
+	
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	cairl_fill_preserve(cr);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_copy_page
  * Signature: (Lorg/gnu/glib/Handle;)V
  */
@@ -661,6 +751,20 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_clip_preserve
+ * Signature: (Lorg/gnu/javagnome/Handle;)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1clip_1preserve
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_t *cr;
+	
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	cairo_clip_preserve(cr);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_select_font_face
  * Signature: (Lorg/gnu/glib/Handle;Ljava/lang/String;II)V
  */
@@ -700,6 +804,22 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
+ * Method:    cairo_get_font_matrix
+ * Signature: (Lorg/gnu/javagnome/Handle;)Lorg/gnu/javagnome/Handle;
+ */
+JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Context_cairo_1get_1font_1matrix
+  (JNIEnv *env, jclass cls, jobject obj)
+{
+	cairo_t *cr;
+	cairo_matrix_t matrix;
+
+	cr = (cairo_t*)getPointerFromHandle(env, obj);
+	matrix = cairo_get_font_matrix(cr, &matrix);
+	return getHandleFromPointer(env, &matrix);
+}
+
+/*
+ * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_show_text
  * Signature: (Lorg/gnu/glib/Handle;Ljava/lang/String;)V
  */
@@ -832,19 +952,6 @@
 
 /*
  * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_show_surface
- * Signature: (Lorg/gnu/glib/Handle;Lorg/gnu/glib/Handle;II)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1show_1surface
-  (JNIEnv *env, jclass cls, jobject obj, jobject surface, jint width, jint height)
-{
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	cairo_surface_t *surface_g = (cairo_surface_t*)getPointerFromHandle(env, surface);
-	cairo_show_surface(cr, surface_g, width, height);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
  * Method:    cairo_get_operator
  * Signature: (Lorg/gnu/glib/Handle;)I
  */
@@ -1035,126 +1142,6 @@
 	return (*env)->NewStringUTF(env, cairo_status_string(cr));
 }
 
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_quad_to
- * Signature: (Lorg/gnu/glib/Handle;DDDD)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1quad_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble x1, jdouble y1, jdouble x2, jdouble y2)
-{
-    double curx, cury;
-    double controlx0, controly0;
-    double controlx1, controly1;
-
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_current_point(cr, &curx, &cury);
-
-    controlx0 = curx + 2.0 / 3.0 * (x1 - curx);
-    controly0 = cury + 2.0 / 3.0 * (y1 - cury);
-
-    controlx1 = x2 + 2.0 / 3.0 * (x1 - x2);
-    controly1 = y2 + 2.0 / 3.0 * (y1 - y2);
-
-    cairo_curve_to(cr, controlx0, controly0, controlx1, controly1, x2, y2);
-		
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_rel_quad_to
- * Signature: (Lorg/gnu/glib/Handle;DDDD)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1rel_1quad_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble x1, jdouble y1, jdouble x2, jdouble y2)
-{
-	double curx, cury;
-
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_current_point(cr, &curx, &cury);
-    Java_org_freedesktop_cairo_Context_cairo_1quad_1to(env, cls, obj,
-        curx + x1, cury + y1, curx + x2, cury + y2);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_arc_to
- * Signature: (Lorg/gnu/glib/Handle;DDDIIDD)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1arc_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble rx, jdouble ry, jdouble xrot, jint largeArc, jint sweep, jdouble x, jdouble y)
-{
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	//_svg_path_arc(cr, rx, ry, xrot, largeArc, sweep, x, y);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_rel_arc_to
- * Signature: (Lorg/gnu/glib/Handle;DDDIIDD)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1rel_1arc_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble rx, jdouble ry, jdouble xrot, 
-  		jint largeArc, jint sweep, jdouble x, jdouble y)
-{
-    double curx, cury;
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_current_point(cr, &curx, &cury);
-    //_svg_path_arc(cr, rx, ry, xrot, largeArc, sweep, curx + x, cury + y);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_hline_to
- * Signature: (Lorg/gnu/glib/Handle;D)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1hline_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble x)
-{
-    double curx, cury;
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_current_point(cr, &curx, &cury);
-    cairo_line_to(cr, x, cury);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_rel_hline_to
- * Signature: (Lorg/gnu/glib/Handle;D)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1rel_1hline_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble x)
-{
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_rel_line_to(cr, x, 0.0);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_vline_to
- * Signature: (Lorg/gnu/glib/Handle;D)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1vline_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble y)
-{
-    double curx, cury;
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_current_point(cr, &curx, &cury);
-    cairo_line_to(cr, curx, y);
-}
-
-/*
- * Class:     org_freedesktop_cairo_Context
- * Method:    cairo_rel_vline_to
- * Signature: (Lorg/gnu/glib/Handle;D)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1rel_1vline_1to
-  (JNIEnv *env, jclass cls, jobject obj, jdouble y)
-{
-	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-    cairo_rel_line_to(cr, 0.0, y);
-}
-
 
 
 CairoCallback* callback_data(JNIEnv *env, jclass cls, jobject cb)




More information about the cairo-commit mailing list