/*
 * 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-08 10:21:59 EDT
 */

#include <jni.h>
#include <sys/types.h>
#include <gnome.h>
#ifdef __cplusplus
extern "C" 
{
#endif

	GnomeUIInfo *pm_getUIInfoArray(JNIEnv *env, jintArray uiinfo) 
	{
        gint *uiinfo_g_g = (gint *) (*env)->GetIntArrayElements (env, uiinfo, NULL);
        jint uiinfo_len = (*env)->GetArrayLength(env, uiinfo);
        GnomeUIInfo *uiinfo_g = g_new(GnomeUIInfo, uiinfo_len);
        int i = 0;
        for (i = 0; i < uiinfo_len; i++)
        	uiinfo_g[i] = *(GnomeUIInfo *)uiinfo_g_g[i];
        (*env)->ReleaseIntArrayElements (env, uiinfo, (jint*)uiinfo_g_g, 0);
        return uiinfo_g;
	}

    /****************************************
     * BEGINNING OF GENERATED CODE
     ****************************************/
    /*
     * Class:     org.gnu.gnome.PopupMenu
     * Method:    gnome_popup_menu_new
     * Signature: ([Lint ;)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gnome_PopupMenu_gnome_1popup_1menu_1new (JNIEnv *env, 
        jclass cls, jintArray uiinfo) 
    {
        GnomeUIInfo *uiinfo_g = pm_getUIInfoArray(env, uiinfo);
        return (jint)gnome_popup_menu_new (uiinfo_g);
    }

    /*
     * Class:     org.gnu.gnome.PopupMenu
     * Method:    gnome_popup_menu_new_with_accelgroup
     * Signature: ([Lint ;I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gnome_PopupMenu_gnome_1popup_1menu_1new_1with_1accelgroup (
        JNIEnv *env, jclass cls, jintArray uiinfo, jint accelgroup) 
    {
        GnomeUIInfo *uiinfo_g = pm_getUIInfoArray(env, uiinfo);
        GtkAccelGroup *accelgroup_g = (GtkAccelGroup *)accelgroup;
        return (jint)gnome_popup_menu_new_with_accelgroup (uiinfo_g, accelgroup_g);
    }

    /*
     * Class:     org.gnu.gnome.PopupMenu
     * Method:    gnome_popup_menu_get_accel_group
     * Signature: (I)I
     */
    JNIEXPORT jint JNICALL Java_org_gnu_gnome_PopupMenu_gnome_1popup_1menu_1get_1accel_1group (
        JNIEnv *env, jclass cls, jint menu) 
    {
        GtkMenu *menu_g = (GtkMenu *)menu;
        {
            return (jint)gnome_popup_menu_get_accel_group (menu_g);
        }
    }

    /*
     * Class:     org.gnu.gnome.PopupMenu
     * Method:    gnome_popup_menu_attach
     * Signature: (III)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gnome_PopupMenu_gnome_1popup_1menu_1attach (JNIEnv *env, 
        jclass cls, jint menu, jint widget, jint userData) 
    {
        GtkMenu *menu_g = (GtkMenu *)menu;
        GtkWidget *widget_g = (GtkWidget *)widget;
        gpointer *userData_g = (gpointer *)userData;
        {
            gnome_popup_menu_attach ((GtkWidget*)menu_g, widget_g, userData_g);
        }
    }

    /*
     * Class:     org.gnu.gnome.PopupMenu
     * Method:    gnome_popup_menu_append
     * Signature: (I[Lint ;)V
     */
    JNIEXPORT void JNICALL Java_org_gnu_gnome_PopupMenu_gnome_1popup_1menu_1append (JNIEnv *env, 
        jclass cls, jint menu, jintArray uiinfo) 
    {
        GtkMenu *menu_g = (GtkMenu *)menu;
        GnomeUIInfo *uiinfo_g = pm_getUIInfoArray(env, uiinfo);
        gnome_popup_menu_append ((GtkWidget*)menu_g, uiinfo_g);
    }

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

#endif
