[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_Cairo.c,
1.13, 1.14
Jeffrey Morgan
commit at pdx.freedesktop.org
Sat Apr 2 05:46:43 PST 2005
Committed by: kuzman
Update of /cvs/cairo/cairo-java/src/jni
In directory gabe:/tmp/cvs-serv2580/src/jni
Modified Files:
org_freedesktop_cairo_Cairo.c
Log Message:
added cairo_set_target_image_no_data to Cairo and fixed makeTarget for ImageSurface
Index: org_freedesktop_cairo_Cairo.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_Cairo.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- org_freedesktop_cairo_Cairo.c 25 Mar 2005 16:53:33 -0000 1.13
+++ org_freedesktop_cairo_Cairo.c 2 Apr 2005 13:46:40 -0000 1.14
@@ -104,20 +104,6 @@
/*
* Class: org_freedesktop_cairo_Cairo
- * Method: cairo_set_target_image
- * Signature: (Lorg/gnu/glib/Handle;Ljava/lang/String;IIII)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1set_1target_1image
- (JNIEnv *env, jclass cls, jobject obj, jstring data, jint format, jint width, jint height, jint stride)
-{
- cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
- char* data_g = (char*)(*env)->GetStringUTFChars(env, data, NULL);
- cairo_set_target_image(cr, data_g, (cairo_format_t)format, width, height, stride);
- (*env)->ReleaseStringUTFChars(env, data, data_g);
-}
-
-/*
- * Class: org_freedesktop_cairo_Cairo
* Method: cairo_set_operator
* Signature: (Lorg/gnu/glib/Handle;I)V
*/
@@ -1315,6 +1301,33 @@
close_path_callback, cbdata);
}
+/*
+ * Class: org_freedesktop_cairo_Cairo
+ * Method: cairo_set_target_image
+ * Signature: (Lorg/gnu/glib/Handle;[BIIII)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1set_1target_1image
+ (JNIEnv *env, jclass cls, jobject obj, jbyteArray data, jint format, jint width, jint height, jint stride)
+{
+ cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
+ char* data_g = (char*)(*env)->GetByteArrayElements(env, data, NULL);
+ cairo_set_target_image(cr, data_g, (cairo_format_t)format, width, height, stride);
+ (*env)->ReleaseByteArrayElements(env, data, (jbyte*)data_g, 0);
+}
+
+/*
+ * Class: org_freedesktop_cairo_Cairo
+ * Method: cairo_set_target_image_no_data
+ * Signature: (Lorg/gnu/javagnome/Handle;III)V
+ */
+JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Cairo_cairo_1set_1target_1image_1no_1data
+ (JNIEnv *env, jclass cls, jobject obj, jint format, jint width, jint height)
+{
+ cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
+ cairo_set_target_image_no_data(cr, (cairo_format_t)format, width, height);
+}
+
+
#ifdef __cplusplus
}
#endif
More information about the cairo-commit
mailing list