[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_Context.c,
1.11, 1.12
Ismael Juma
commit at pdx.freedesktop.org
Fri Dec 2 02:37:00 PST 2005
Committed by: ijuma
Update of /cvs/cairo/cairo-java/src/jni
In directory gabe:/tmp/cvs-serv14816/src/jni
Modified Files:
org_freedesktop_cairo_Context.c
Log Message:
Fix bug #5208 (Context.getMatrix() fails) and also fix object being passed to getPointerFromHandle.
Index: org_freedesktop_cairo_Context.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_Context.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- org_freedesktop_cairo_Context.c 13 Sep 2005 03:14:10 -0000 1.11
+++ org_freedesktop_cairo_Context.c 2 Dec 2005 10:36:58 -0000 1.12
@@ -8,6 +8,7 @@
*/
#include <jni.h>
+#include <stdlib.h>
#include <cairo.h>
#include <jg_jnu.h>
@@ -132,7 +133,7 @@
cairo_surface_t *surface;
cr = (cairo_t*)getPointerFromHandle(env, obj);
- surface = (cairo_surface_t*)getPointerFromHandle(env, surface);
+ surface = (cairo_surface_t*)getPointerFromHandle(env, sur);
cairo_set_source_surface(cr, surface, sx, sy);
}
@@ -1032,15 +1033,17 @@
/*
* Class: org_freedesktop_cairo_Context
* Method: cairo_get_matrix
- * Signature: (Lorg/gnu/glib/Handle;Lorg/gnu/glib/Handle;)V
+ * Signature: (Lorg/gnu/glib/Handle;)Lorg/gnu/glib/Handle;
*/
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Context_cairo_1get_1matrix
- (JNIEnv *env, jclass cls, jobject obj, jobject matrix)
+JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Context_cairo_1get_1matrix
+ (JNIEnv *env, jclass cls, jobject obj)
{
- cairo_t *cr = (cairo_t*)getPointerFromHandle(env, obj);
- cairo_matrix_t *matrix_g = (cairo_matrix_t*)getPointerFromHandle(env, matrix);
- cairo_get_matrix(cr, matrix_g);
- updateHandle(env, matrix, matrix_g);
+ cairo_t *cr;
+ cairo_matrix_t *matrix;
+ matrix = malloc (sizeof (cairo_matrix_t));
+ cr = (cairo_t*) getPointerFromHandle(env, obj);
+ cairo_get_matrix(cr, matrix);
+ return getHandleFromPointer(env, matrix);
}
/*
More information about the cairo-commit
mailing list