/*
 * 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-08-01 07:00:32 EDT
 */

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

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_new
     * Signature: (II)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1new (JNIEnv *env, jclass cls, 
        jint visual, jint allocate) 
    {
        GdkVisual *visual_g = (GdkVisual *)visual;
        gint32 allocate_g = (gint32) allocate;
        {
            return (jint)gdk_colormap_new (visual_g, allocate_g);
        }
    }

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_get_system
     * Signature: ()I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1get_1system (JNIEnv *env, 
        jclass cls) 
    {
        {
            return (jint)gdk_colormap_get_system ();
        }
    }

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_alloc_colors
     * Signature: (I[Lint ;IZZ[Z)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1alloc_1colors (JNIEnv *env, 
        jclass cls, jint colormap, jintArray colors, jint numColors, jboolean writable, jboolean 
        bestMatch, jbooleanArray success) 
    {
        GdkColormap *colormap_g = (GdkColormap *)colormap;
        gint *colors_g_g = (gint *) (*env)->GetIntArrayElements (env, colors, NULL);
        GdkColor *colors_g = (GdkColor *)colors_g_g;
        gint32 numColors_g = (gint32) numColors;
        gboolean writable_g = (gboolean) writable;
        gboolean bestMatch_g = (gboolean) bestMatch;
        gboolean *success_g = (gboolean *) (*env)->GetBooleanArrayElements(env, success, NULL);
        {
            jint result_j = (jint) (gdk_colormap_alloc_colors (colormap_g, colors_g, numColors_g, 
                    writable_g, bestMatch_g, success_g));
            (*env)->ReleaseIntArrayElements (env, colors, (jint *)colors_g_g, 0);
            (*env)->ReleaseBooleanArrayElements(env, success, (jboolean *)success_g, 0);
            return result_j;
        }
    }

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_alloc_color
     * Signature: (IIZZ)Z
     */
    JNIEXPORT jboolean JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1alloc_1color (JNIEnv *env, 
        jclass cls, jint colormap, jint color, jboolean writable, jboolean best_match) 
    {
        GdkColormap *colormap_g = (GdkColormap *)colormap;
        GdkColor *color_g = (GdkColor *)color;
        gboolean writable_g = (gboolean) writable;
        gboolean best_match_g = (gboolean) best_match;
        {
            jboolean result_j = (jboolean) (gdk_colormap_alloc_color (colormap_g, color_g, 
                    writable_g, best_match_g));
            return result_j;
        }
    }

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_free_colors
     * Signature: (I[Lint ;I)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1free_1colors (JNIEnv *env, 
        jclass cls, jint colormap, jintArray colors, jint numColors) 
    {
        GdkColormap *colormap_g = (GdkColormap *)colormap;
        gint *colors_g_g = (gint *) (*env)->GetIntArrayElements (env, colors, NULL);
        GdkColor *colors_g = (GdkColor *)colors_g_g;
        gint32 numColors_g = (gint32) numColors;
        {
            gdk_colormap_free_colors (colormap_g, colors_g, numColors_g);
            (*env)->ReleaseIntArrayElements (env, colors, (jint *)colors_g_g, 0);
        }
    }

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_query_color
     * Signature: (IJI)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1query_1color (JNIEnv *env, 
        jclass cls, jint colormap, jlong pixel, jint result) 
    {
        GdkColormap *colormap_g = (GdkColormap *)colormap;
        glong pixel_g = (glong) pixel;
        GdkColor *result_g = (GdkColor *)result;
        {
            gdk_colormap_query_color (colormap_g, pixel_g, result_g);
        }
    }

    /*
     * Class:     org.gnu.gdk.Colormap
     * Method:    gdk_colormap_get_visual
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gdk_Colormap_gdk_1colormap_1get_1visual (JNIEnv *env, 
        jclass cls, jint colormap) 
    {
        GdkColormap *colormap_g = (GdkColormap *)colormap;
        {
            return (jint)gdk_colormap_get_visual (colormap_g);
        }
    }

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

#endif
