/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2004 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.gnu.pango;
import org.gnu.glib.Enum;

/**
 * The PangoDirection type represents the direction of writing for text.
 */
public class Direction extends Enum 
{
    /****************************************
     * BEGINNING OF GENERATED CODE
     ****************************************/
    static final private int _LTR = 0;
	/** The text is written left-to-right */
    static final public org.gnu.pango.Direction LTR = new org.gnu.pango.Direction (_LTR);
    static final private int _RTL = 1;
	/** The text is written right-to-left */
    static final public org.gnu.pango.Direction RTL = new org.gnu.pango.Direction (_RTL);
    static final private int _TTB_LTR = 2;
	/** The text is written vertically top-to-bottom, with the rows ordered from
	 * left to right. */
    static final public org.gnu.pango.Direction TTB_LTR = new org.gnu.pango.Direction (_TTB_LTR);
    static final private int _TTB_RTL = 3;
	/** The text is written vertically top-to-bottom, with the rows ordered from
	 * right to left. */
    static final public org.gnu.pango.Direction TTB_RTL = new org.gnu.pango.Direction (_TTB_RTL);
    static final private org.gnu.pango.Direction[] theInterned = new org.gnu.pango.Direction[] 
    {
        LTR, RTL, TTB_LTR, TTB_RTL 
    }

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

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

    public org.gnu.pango.Direction or (org.gnu.pango.Direction other) 
    {
        return intern(value_ | other.value_);
    }

    public org.gnu.pango.Direction and (org.gnu.pango.Direction other) 
    {
        return intern(value_ & other.value_);
    }

    public org.gnu.pango.Direction xor (org.gnu.pango.Direction other) 
    {
        return intern(value_ ^ other.value_);
    }

    public boolean test (org.gnu.pango.Direction other) 
    {
        return (value_ & other.value_) == other.value_;
    }

    /****************************************
     * END OF GENERATED CODE
     ****************************************/
}

