/*
 * 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-02 09:42:31 EDT
 */

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

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_new
     * Signature: ()I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gtk_Style_gtk_1style_1new (JNIEnv *env, jclass cls) 
    {
        {
            return (jint)gtk_style_new ();
        }
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_copy
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gtk_Style_gtk_1style_1copy (JNIEnv *env, jclass cls, jint 
        style) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        {
            return (jint)gtk_style_copy (style_g);
        }
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_attach
     * Signature: (II)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gtk_Style_gtk_1style_1attach (JNIEnv *env, jclass cls, jint 
        style, jint window) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        GdkWindow *window_g = (GdkWindow *)window;
        {
            return (jint)gtk_style_attach (style_g, window_g);
        }
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_detach
     * Signature: (I)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gtk_Style_gtk_1style_1detach (JNIEnv *env, jclass cls, jint 
        style) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        {
            gtk_style_detach (style_g);
        }
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_set_background
     * Signature: (III)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gtk_Style_gtk_1style_1set_1background (JNIEnv *env, jclass 
        cls, jint style, jint window, jint stateType) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        GdkWindow *window_g = (GdkWindow *)window;
        GtkStateType stateType_g = (GtkStateType) stateType;
        {
            gtk_style_set_background (style_g, window_g, stateType_g);
        }
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_apply_default_background
     * Signature: (IIZIIIIII)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gtk_Style_gtk_1style_1apply_1default_1background (JNIEnv 
        *env, jclass cls, jint style, jint window, jboolean setBG, jint stateType, jint area, jint 
        x, jint y, jint width, jint height) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        GdkWindow *window_g = (GdkWindow *)window;
        gboolean setBG_g = (gboolean) setBG;
        GtkStateType stateType_g = (GtkStateType) stateType;
        GdkRectangle *area_g = (GdkRectangle *)area;
        gint32 x_g = (gint32) x;
        gint32 y_g = (gint32) y;
        gint32 width_g = (gint32) width;
        gint32 height_g = (gint32) height;
        {
            gtk_style_apply_default_background (style_g, window_g, setBG_g, stateType_g, area_g, 
                x_g, y_g, width_g, height_g);
        }
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_lookup_icon_set
     * Signature: (Ijava.lang.String;)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gtk_Style_gtk_1style_1lookup_1icon_1set (JNIEnv *env, 
        jclass cls, jint style, jstring stockId) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        gchar* stockId_g = (gchar*)(*env)->GetStringUTFChars(env, stockId, 0);
        jint result = (jint)gtk_style_lookup_icon_set (style_g, stockId_g);
        (*env)->ReleaseStringUTFChars(env, stockId, stockId_g);
        return result;
    }

    /*
     * Class:     org.gnu.gtk.Style
     * Method:    gtk_style_render_icon
     * Signature: (IIIII[Lint ;[B)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gtk_Style_gtk_1style_1render_1icon (JNIEnv *env, jclass 
        cls, jint style, jint source, jint direction, jint state, jint size, jintArray widget, 
        jbyteArray detail) 
    {
        GtkStyle *style_g = (GtkStyle *)style;
        GtkIconSource *source_g = (GtkIconSource *)source;
        GtkTextDirection direction_g = (GtkTextDirection) direction;
        GtkStateType state_g = (GtkStateType) state;
        GtkIconSize size_g = (GtkIconSize) size;
        gint *widget_g_g = (gint *) (*env)->GetIntArrayElements (env, widget, NULL);
        GtkWidget *widget_g = (GtkWidget *)widget_g_g;
        jint detail_len = (*env)->GetArrayLength(env, detail);
        gchar* detail_g = (gchar*)g_malloc(detail_len + 1);
        (*env)->GetByteArrayRegion(env, detail, 0, detail_len, (jbyte*)detail_g);
        detail_g[detail_len] = 0;
        {
            return (jint)gtk_style_render_icon (style_g, source_g, direction_g, state_g, size_g, 
                widget_g, detail_g);
        }
    }

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

#endif
