[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_Cairo.c, 1.7, 1.8 org_freedesktop_cairo_PsSurface.c, 1.2, 1.3

Jeffrey Morgan commit at pdx.freedesktop.org
Thu Mar 10 11:38:35 PST 2005


Committed by: kuzman

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

Modified Files:
	org_freedesktop_cairo_Cairo.c 
	org_freedesktop_cairo_PsSurface.c 
Log Message:
major upstream API changes

Index: org_freedesktop_cairo_Cairo.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_Cairo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- org_freedesktop_cairo_Cairo.c	10 Mar 2005 19:04:14 -0000	1.7
+++ org_freedesktop_cairo_Cairo.c	10 Mar 2005 19:38:33 -0000	1.8
@@ -729,27 +729,28 @@
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_font
+ * Method:    cairo_get_font
  * Signature: (Lorg/gnu/glib/Handle;)Lorg/gnu/glib/Handle;
  */
-JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1font
+JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1font
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return getHandleFromPointer(env, cairo_current_font(cr));
+	return getHandleFromPointer(env, cairo_get_font(cr));
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_font_extents
+ * Method:    cairo_get_font_extents
  * Signature: (Lorg/gnu/glib/Handle;Lorg/gnu/glib/Handle;)V
  */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1font_1extents
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1font_1extents
   (JNIEnv *env, jclass cls, jobject obj, jobject extents)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
+	/* TODO: should i be initializing to NULL? */
 	cairo_font_extents_t *extents_g = (cairo_font_extents_t*)getPointerFromHandle(env, extents);
-	cairo_current_font_extents(cr, extents_g);
+	cairo_get_font_extents(cr, extents_g);
 	updateHandle(env, extents, extents_g);
 }
 
@@ -841,29 +842,29 @@
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_operator
+ * Method:    cairo_get_operator
  * Signature: (Lorg/gnu/glib/Handle;)I
  */
-JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1operator
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1operator
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jint)cairo_current_operator(cr);
+	return (jint)cairo_get_operator(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_rgb_color
+ * Method:    cairo_get_rgb_color
  * Signature: (Lorg/gnu/glib/Handle;[D[D[D)V
  */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1rgb_1color
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1rgb_1color
   (JNIEnv *env, jclass cls, jobject obj, jdoubleArray red, jdoubleArray green, jdoubleArray blue)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
 	double *r = (double*)(*env)->GetDoubleArrayElements(env, red, NULL);
 	double *g = (double*)(*env)->GetDoubleArrayElements(env, green, NULL);
 	double *b = (double*)(*env)->GetDoubleArrayElements(env, blue, NULL);
-	cairo_current_rgb_color(cr, r, g, b);
+	cairo_get_rgb_color(cr, r, g, b);
 	(*env)->ReleaseDoubleArrayElements(env, red, r, 0);
 	(*env)->ReleaseDoubleArrayElements(env, green, g, 0);
 	(*env)->ReleaseDoubleArrayElements(env, blue, b, 0);
@@ -871,140 +872,140 @@
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_pattern
+ * Method:    cairo_get_pattern
  * Signature: (Lorg/gnu/glib/Handle;)Lorg/gnu/glib/Handle;
  */
-JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1pattern
+JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1pattern
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return getHandleFromPointer(env, cairo_current_pattern(cr));
+	return getHandleFromPointer(env, cairo_get_pattern(cr));
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_alpha
+ * Method:    cairo_get_alpha
  * Signature: (Lorg/gnu/glib/Handle;)D
  */
-JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1alpha
+JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1alpha
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jdouble)cairo_current_alpha(cr);
+	return (jdouble)cairo_get_alpha(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_tolerance
+ * Method:    cairo_get_tolerance
  * Signature: (Lorg/gnu/glib/Handle;)D
  */
-JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1tolerance
+JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1tolerance
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jdouble)cairo_current_tolerance(cr);
+	return (jdouble)cairo_get_tolerance(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_point
+ * Method:    cairo_get_current_point
  * Signature: (Lorg/gnu/glib/Handle;[D[D)V
  */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1point
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1current_1point
   (JNIEnv *env, jclass cls, jobject obj, jdoubleArray x, jdoubleArray y)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
 	double *x_g = (double*)(*env)->GetDoubleArrayElements(env, x, NULL);
 	double *y_g = (double*)(*env)->GetDoubleArrayElements(env, y, NULL);
-	cairo_current_point(cr, x_g, y_g);
+	cairo_get_current_point(cr, x_g, y_g);
 	(*env)->ReleaseDoubleArrayElements(env, x, x_g, 0);
 	(*env)->ReleaseDoubleArrayElements(env, y, y_g, 0);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_fill_rule
+ * Method:    cairo_get_fill_rule
  * Signature: (Lorg/gnu/glib/Handle;)I
  */
-JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1fill_1rule
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1fill_1rule
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jint)cairo_current_fill_rule(cr);
+	return (jint)cairo_get_fill_rule(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_line_width
+ * Method:    cairo_get_line_width
  * Signature: (Lorg/gnu/glib/Handle;)D
  */
-JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1line_1width
+JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1line_1width
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jdouble)cairo_current_line_width(cr);
+	return (jdouble)cairo_get_line_width(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_line_cap
+ * Method:    cairo_get_line_cap
  * Signature: (Lorg/gnu/glib/Handle;)I
  */
-JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1line_1cap
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1line_1cap
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jint)cairo_current_line_cap(cr);
+	return (jint)cairo_get_line_cap(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_line_join
+ * Method:    cairo_get_line_join
  * Signature: (Lorg/gnu/glib/Handle;)I
  */
-JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1line_1join
+JNIEXPORT jint JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1line_1join
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jint)cairo_current_line_join(cr);
+	return (jint)cairo_get_line_join(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_miter_limit
+ * Method:    cairo_get_miter_limit
  * Signature: (Lorg/gnu/glib/Handle;)D
  */
-JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1miter_1limit
+JNIEXPORT jdouble JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1miter_1limit
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return (jdouble)cairo_current_miter_limit(cr);
+	return (jdouble)cairo_get_miter_limit(cr);
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_matrix
+ * Method:    cairo_get_matrix
  * Signature: (Lorg/gnu/glib/Handle;Lorg/gnu/glib/Handle;)V
  */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1matrix
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1matrix
   (JNIEnv *env, jclass cls, jobject obj, jobject matrix)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
 	cairo_matrix_t *matrix_g = (cairo_matrix_t*)getPointerFromHandle(env, matrix);
-	cairo_current_matrix(cr, matrix_g);
+	cairo_get_matrix(cr, matrix_g);
 	updateHandle(env, matrix, matrix_g);
  }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_target_surface
+ * Method:    cairo_get_target_surface
  * Signature: (Lorg/gnu/glib/Handle;)Lorg/gnu/glib/Handle;
  */
-JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1target_1surface
+JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1target_1surface
   (JNIEnv *env, jclass cls, jobject obj)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
-	return getHandleFromPointer(env, cairo_current_target_surface(cr));
+	return getHandleFromPointer(env, cairo_get_target_surface(cr));
 }
 
 /*
@@ -1260,32 +1261,30 @@
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_path
+ * Method:    cairo_get_path
  * Signature: (Lorg/gnu/glib/Handle;Ljava/lang/Object;)V
  */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1path
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1path
   (JNIEnv *env, jclass cls, jobject obj, jobject cb)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
 	CairoCallback *cbdata = callback_data(env, cls, cb);
-	cairo_current_path(cr, move_to_callback, line_to_callback,
+	cairo_get_path(cr, move_to_callback, line_to_callback,
 			curve_to_callback, close_path_callback, cbdata);	
 }
 
 /*
  * Class:     org_freedesktop_cairo_Cairo
- * Method:    cairo_current_path_flat
+ * Method:    cairo_get_path_flat
  * Signature: (Lorg/gnu/glib/Handle;Ljava/lang/Object;)V
  */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1current_1path_1flat
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1get_1path_1flat
   (JNIEnv *env, jclass cls, jobject obj, jobject cb)
 {
 	cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
 	CairoCallback *cbdata = callback_data(env, cls, cb);
-	printf("path_flat\n");
-	cairo_current_path_flat(cr, move_to_callback, line_to_callback,
+	cairo_get_path_flat(cr, move_to_callback, line_to_callback,
 			close_path_callback, cbdata);
-	printf("return\n");	
 }
 
 #ifdef __cplusplus

Index: org_freedesktop_cairo_PsSurface.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_PsSurface.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- org_freedesktop_cairo_PsSurface.c	8 Mar 2005 20:47:44 -0000	1.2
+++ org_freedesktop_cairo_PsSurface.c	10 Mar 2005 19:38:33 -0000	1.3
@@ -8,6 +8,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <jni.h>
 #include <cairo.h>
 #include <jg_jnu.h>




More information about the cairo-commit mailing list