[cairo-commit] cairo-java/src/java/org/freedesktop/cairo Glyph.java, 1.5, 1.6 Surface.java, 1.11, 1.12

Jeffrey Morgan commit at pdx.freedesktop.org
Mon May 9 18:28:17 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo
In directory gabe:/tmp/cvs-serv31745/src/java/org/freedesktop/cairo

Modified Files:
	Glyph.java Surface.java 
Log Message:
added missing native methods.

Index: Glyph.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Glyph.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Glyph.java	9 May 2005 14:47:03 -0000	1.5
+++ Glyph.java	10 May 2005 01:28:15 -0000	1.6
@@ -23,22 +23,47 @@
  *  font system.
  */
 public class Glyph extends CairoObject {
+
+	public Glyph() {
+		super(alloc());
+	}
 	
+	public Glyph(long index, double x, double y) {
+		super(alloc(index, x, y));
+	}
+
 	Glyph(Handle hndl) {
 		super(hndl);
 	}
-    
-    public long getIndex() {
+	
+    protected void finalize() throws Throwable {
+		free(getHandle());
+		super.finalize();
+	}
+
+	public long getIndex() {
         return get_index(getHandle());
     }
+	
+	public void setIndex(long index) {
+		set_index(getHandle(), index);
+	}
     
     public double getX() {
         return get_x(getHandle());
     }
+	
+	public void setX(double x) {
+		set_x(getHandle(), x);
+	}
     
     public double getY() {
         return get_y(getHandle());
     }
+	
+	public void setY(double y) {
+		set_y(getHandle(), y);
+	}
     
     public Point getPoint() {
         return new Point(get_x(getHandle()), get_y(getHandle()));
@@ -47,16 +72,12 @@
     /*
      * native calls
      */
-    // TODO: lifecycle methods
     native static final private Handle alloc();
     native static final private Handle alloc(long index, double x, double y);
     native static final private void free(Handle obj);
-    
     native static final private long get_index(Handle obj);
     native static final private double get_x(Handle obj);
     native static final private double get_y(Handle obj);
-
-    // TODO: setters
     native static final private void set_index(Handle obj, long index);
     native static final private void set_x(Handle obj, double x);
     native static final private void set_y(Handle obj, double y);

Index: Surface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Surface.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Surface.java	9 May 2005 16:02:07 -0000	1.11
+++ Surface.java	10 May 2005 01:28:15 -0000	1.12
@@ -50,12 +50,10 @@
      * Native calls
      */
     native static final private Handle cairo_surface_create_similar(Handle other, int format, int width, int height);
-    // TODO: JNI need alloc
     native static final private Handle alloc();
     native static final private void cairo_surface_destroy(Handle obj);
     native static final private int cairo_surface_finish(Handle obj);
 	
-	// TODO: API JNI
 	native static final private int cairo_surface_write_to_png(Handle obj, String filename);
 //	native static final private int cairo_surface_write_to_png_stream(Handle obj, String func);
 //	cairo_status_t




More information about the cairo-commit mailing list