[cairo-commit] cairo-java/src/java/org/freedesktop/cairo Status.java, 1.7, 1.8 Surface.java, 1.12, 1.13 Content.java, NONE, 1.1

Jeffrey Morgan commit at pdx.freedesktop.org
Sun Jul 17 13:50:48 PDT 2005


Committed by: kuzman

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

Modified Files:
	Status.java Surface.java 
Added Files:
	Content.java 
Log Message:
updates to match upstream changes

Index: Status.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Status.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Status.java	2 Jun 2005 17:51:06 -0000	1.7
+++ Status.java	17 Jul 2005 20:50:46 -0000	1.8
@@ -24,8 +24,8 @@
     static final public Status NO_CURRENT_POINT = new Status (_NO_CURRENT_POINT);
     static final private int _INVALID_MATRIX = 5;
     static final public Status INVALID_MATRIX = new Status (_INVALID_MATRIX);
-    static final private int _NO_TARGET_SURFACE = 6;
-    static final public Status NO_TARGET_SURFACE = new Status (_NO_TARGET_SURFACE);
+    static final private int _INVALID_STATUS = 6;
+    static final public Status INVALID_STATUS = new Status (_INVALID_STATUS);
     static final private int _NULL_POINTER = 7;
     static final public Status NULL_POINTER = new Status (_NULL_POINTER);
     static final private int _INVALID_STRING = 8;
@@ -40,11 +40,13 @@
     static final public Status SURFACE_FINISHED = new Status (_SURFACE_FINISHED);
     static final private int _SURFACE_TYPE_MISMATCH = 13;
     static final public Status SURFACE_TYPE_MISMATCH = new Status (_SURFACE_TYPE_MISMATCH);
+    static final private int _PATTERN_TYPE_MISMATCH = 13;
+    static final public Status PATTERN_TYPE_MISMATCH = new Status (_PATTERN_TYPE_MISMATCH);
 
     static final private Status[] theInterned = new Status[] {
         SUCCESS, NO_MEMORY, INVALID_RESTORE, INVALID_POP_GROUP, NO_CURRENT_POINT,
-        INVALID_MATRIX, NO_TARGET_SURFACE, NULL_POINTER, INVALID_STRING, INVALID_PATH_DATA,
-        READ_ERROR, WRITE_ERROR, SURFACE_FINISHED, SURFACE_TYPE_MISMATCH
+        INVALID_MATRIX, INVALID_STATUS, NULL_POINTER, INVALID_STRING, INVALID_PATH_DATA,
+        READ_ERROR, WRITE_ERROR, SURFACE_FINISHED, SURFACE_TYPE_MISMATCH, PATTERN_TYPE_MISMATCH
     };
     static private java.util.Hashtable theInternedExtras;
     static final private Status theSacrificialOne = new Status (0);

Index: Surface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Surface.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Surface.java	10 May 2005 01:28:15 -0000	1.12
+++ Surface.java	17 Jul 2005 20:50:46 -0000	1.13
@@ -29,9 +29,9 @@
         super.finalize();
     }
     
-    public Surface createSimilar(Format format, int width, int height) {
+    public Surface createSimilar(Content content, int width, int height) {
         return new Surface(cairo_surface_create_similar(getHandle(), 
-                format.getValue(), width, height));
+                content.getValue(), width, height));
     }
     
     public void finish() {

--- NEW FILE: Content.java ---
/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2005 the Java-Gnome Team, all rights reserved.
 *
 * The Java-Gnome bindings library is free software distributed under
 * the terms of the GNU Library General Public License version 2.
 */

package org.freedesktop.cairo;

import org.gnu.javagnome.Enum;

public class Content extends Enum {

    static final private int _COLOR = 0x1000;
    static final public Content COLOR = new Content (_COLOR);
    static final private int _ALPHA = 0x2000;
    static final public Content ALPHA = new Content (_ALPHA);
    static final private int _COLOR_ALPHA = 0x3000;
    static final public Content COLOR_ALPHA = new Content (_COLOR_ALPHA);

    static final private Content[] theInterned = new Content[] {
        COLOR, ALPHA, COLOR_ALPHA 
    };
    static private java.util.Hashtable theInternedExtras;
    static final private Content theSacrificialOne = new Content (0);
    static public Content intern (int value) {
        if (value < theInterned.length) {
            return theInterned[value];
        }
        theSacrificialOne.value_ = value;
        if (theInternedExtras == null) {
            theInternedExtras = new java.util.Hashtable();
        }
        Content already = (Content) theInternedExtras.get(theSacrificialOne);
        if (already == null) {
            already = new Content(value);
            theInternedExtras.put(already, already);
        }
        return already;
    }

    private Content(int value) {
        value_ = value;
    }

    public boolean test (Content other) {
        return (value_ & other.value_) == other.value_;
    }

}




More information about the cairo-commit mailing list