[cairo-commit] cairo-java/src/jni org_freedesktop_cairo_Pattern.c, 1.3, 1.4

Jeffrey Morgan commit at pdx.freedesktop.org
Mon May 9 08:38:26 PDT 2005


Committed by: kuzman

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

Modified Files:
	org_freedesktop_cairo_Pattern.c 
Log Message:
added pattern hierarchy

Index: org_freedesktop_cairo_Pattern.c
===================================================================
RCS file: /cvs/cairo/cairo-java/src/jni/org_freedesktop_cairo_Pattern.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- org_freedesktop_cairo_Pattern.c	7 May 2005 00:46:23 -0000	1.3
+++ org_freedesktop_cairo_Pattern.c	9 May 2005 15:38:24 -0000	1.4
@@ -25,8 +25,16 @@
 JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Pattern_cairo_1pattern_1create_1for_1surface
   (JNIEnv *env, jclass cls, jobject surface)
 {
-	cairo_surface_t *surface_g = (cairo_surface_t*)getPointerFromHandle(env, surface);
-	return getHandleFromPointer(env, cairo_pattern_create_for_surface(surface_g));
+	cairo_surface_t *surface_g;
+	cairo_pattern_t *pat;
+	
+	surface_g = (cairo_surface_t*)getPointerFromHandle(env, surface);
+	
+	pat = cairo_pattern_create_for_surface(surface_g);
+	if (pat)
+		cairo_pattern_reference(pat);
+	
+	return getHandleFromPointer(env, pat);
 }
 
 /*
@@ -37,7 +45,13 @@
 JNIEXPORT jobject JNICALL Java_org_freedesktop_cairo_Pattern_cairo_1pattern_1create_1linear
   (JNIEnv *env, jclass cls, jdouble x1, jdouble y1, jdouble x2, jdouble y2)
 {
-	return getHandleFromPointer(env, cairo_pattern_create_linear(x1, y1, x2, y2));
+	cairo_pattern_t *pat;
+	
+	pat = cairo_pattern_create_linear(x1, y1, x2, y2);
+	if (pat)
+		cairo_pattern_reference(pat);
+	
+	return getHandleFromPointer(env, pat);
 }
 
 /*
@@ -49,21 +63,15 @@
   (JNIEnv *env, jclass cls, jdouble x1, jdouble y1, jdouble radius1, 
   	jdouble x2, jdouble y2, jdouble radius2)
  {
- 	return getHandleFromPointer(env, cairo_pattern_create_radial(x1, y1, radius1, x2, y2, radius2));
- }
+	cairo_pattern_t *pat;
+	
+	pat = cairo_pattern_create_radial(x1, y1, radius1, x2, y2, radius2);
+	if (pat)
+		cairo_pattern_reference(pat);
 
+ 	return getHandleFromPointer(env, pat);
+ }
 
-/*
- * Class:     org_freedesktop_cairo_Pattern
- * Method:    cairo_pattern_reference
- * Signature: (Lorg/gnu/glib/Handle;)V
- */
-JNIEXPORT void JNICALL Java_org_freedesktop_cairo_Pattern_cairo_1pattern_1reference
-  (JNIEnv *env, jclass cls, jobject obj)
-{
-	cairo_pattern_t *pat = (cairo_pattern_t*)getPointerFromHandle(env, obj);
-	cairo_pattern_reference(pat);
-}
 
 /*
  * Class:     org_freedesktop_cairo_Pattern




More information about the cairo-commit mailing list