/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2002 the Java-Gnome Team, all rights reserved.
 *
 * The Java-Gnome Team Members:
 *   Jean Van Wyk <jeanvanwyk@iname.com>
 *   Jeffrey S. Morgan <jeffrey.morgan@bristolwest.com>
 *   Dan Bornstein <danfuzz@milk.com>
 *
 * The Java-Gnome bindings library is free software distributed under
 * the terms of the GNU Library General Public License version 2.
 *
 * This file was orriginally generated by the Java-GNOME Code Generator
 * Please do not modify the code that is identified as generated.  Also,
 * please insert your code above the generated code.
 *
 * Generation date: 2002-07-31 13:44:42 EDT
 */

#include <jni.h>
#include <sys/types.h>
#include <pango/pango.h>
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" 
{
#endif
    /****************************************
     * BEGINNING OF GENERATED CODE
     ****************************************/
    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_new
     * Signature: ()I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1new (JNIEnv *env, jclass 
        cls) 
    {
        {
            return (jint)pango_coverage_new ();
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_ref
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1ref (JNIEnv *env, jclass 
        cls, jint coverage) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        {
            return (jint)pango_coverage_ref (coverage_g);
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_unref
     * Signature: (I)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1unref (JNIEnv *env, jclass 
        cls, jint coverage) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        {
            pango_coverage_unref (coverage_g);
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_copy
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1copy (JNIEnv *env, jclass 
        cls, jint coverage) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        {
            return (jint)pango_coverage_copy (coverage_g);
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_get
     * Signature: (II)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1get (JNIEnv *env, jclass 
        cls, jint coverage, jint index) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        gint32 index_g = (gint32) index;
        {
            jint result_j = (jint) (pango_coverage_get (coverage_g, index_g));
            return result_j;
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_set
     * Signature: (III)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1set (JNIEnv *env, jclass 
        cls, jint coverage, jint index, jint level) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        gint32 index_g = (gint32) index;
        PangoCoverageLevel level_g = (PangoCoverageLevel) level;
        {
            pango_coverage_set (coverage_g, index_g, level_g);
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_max
     * Signature: (II)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1max (JNIEnv *env, jclass 
        cls, jint coverage, jint other) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        PangoCoverage *other_g = (PangoCoverage *)other;
        {
            pango_coverage_max (coverage_g, other_g);
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_to_bytes
     * Signature: (I[B[Lint ;)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1to_1bytes (JNIEnv *env, 
        jclass cls, jint coverage, jbyteArray bytes, jintArray numBytes) 
    {
        PangoCoverage *coverage_g = (PangoCoverage *)coverage;
        jint bytes_len = (*env)->GetArrayLength(env, bytes);
        guchar** bytes_g = (guchar**)g_malloc(bytes_len + 1);
        gint *numBytes_g = (gint *) (*env)->GetIntArrayElements (env, numBytes, NULL);
        (*env)->GetByteArrayRegion(env, bytes, 0, bytes_len, (jbyte*)bytes_g);
        bytes_g[bytes_len] = 0;
        {
            pango_coverage_to_bytes (coverage_g, bytes_g, numBytes_g);
            (*env)->ReleaseIntArrayElements (env, numBytes, (jint *) numBytes_g, 0);
        }
    }

    /*
     * Class:     org.gnu.pango.Coverage
     * Method:    pango_coverage_from_bytes
     * Signature: ([BI)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_pango_Coverage_pango_1coverage_1from_1bytes (JNIEnv *env, 
        jclass cls, jbyteArray bytes, jint numBytes) 
    {
        jint bytes_len = (*env)->GetArrayLength(env, bytes);
        gchar* bytes_g = (gchar*)g_malloc(bytes_len + 1);
        gint32 numBytes_g = (gint32) numBytes;
        (*env)->GetByteArrayRegion(env, bytes, 0, bytes_len, (jbyte*)bytes_g);
        bytes_g[bytes_len] = 0;
        {
            return (jint)pango_coverage_from_bytes (bytes_g, numBytes_g);
        }
    }

    /****************************************
     * END OF GENERATED CODE
     ****************************************/
#ifdef __cplusplus
}

#endif
