/*
 * Java-Gnome Bindings Library
 *
 * Copyright 1998-2002 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.
 *
 * 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.
 */

#include <jni.h>
#include <sys/types.h>
#include <gnome.h>

#ifndef _Included_org_gnu_gnome_PasswordDialog
#define _Included_org_gnu_gnome_PasswordDialog
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: evtMap */
/* Inaccessible static: class_000240 */
/* Inaccessible static: class_000241 */
/* Inaccessible static: class_000242 */
/* Inaccessible static: class_000243 */
/* Inaccessible static: class_000244 */
/* Inaccessible static: class_000245 */
/* Inaccessible static: evtMap */
/* Inaccessible static: class_000240 */
/* Inaccessible static: evtMap */
/* Inaccessible static: class_000240 */
/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_get_type
 * Signature: ()I
 */
JNIEXPORT jint JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1get_1type
  (JNIEnv *env, jclass cls)
{
	return (jint)gnome_password_dialog_get_type();
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_new
 * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I
 */
JNIEXPORT jint JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1new
  (JNIEnv *env, jclass cls, jstring title, jstring message, jstring username, jstring password, jboolean readonly)
{
	const char *t = title ? (*env)->GetStringUTFChars(env, title, NULL) : NULL;
	const char *m = message ? (*env)->GetStringUTFChars(env, message, NULL) : NULL;
	const char *u = username ? (*env)->GetStringUTFChars(env, username, NULL) : NULL;
	const char *p = password ? (*env)->GetStringUTFChars(env, password, NULL) : NULL;
	GtkWidget *ret = gnome_password_dialog_new(t, m, u, p, (gboolean)readonly);
	if (t)
		(*env)->ReleaseStringUTFChars(env, title, t);
	if (m)
		(*env)->ReleaseStringUTFChars(env, message, m);
	if (u)
		(*env)->ReleaseStringUTFChars(env, username, u);
	if (p)
		(*env)->ReleaseStringUTFChars(env, password, p);
	return (jint)ret;
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_run_and_block
 * Signature: (I)Z
 */
JNIEXPORT jboolean JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1run_1and_1block
  (JNIEnv *env, jclass cls, jint dialog)
{
	return (jboolean)gnome_password_dialog_run_and_block((GnomePasswordDialog*)dialog);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_set_username
 * Signature: (ILjava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1set_1username
  (JNIEnv *env, jclass cls, jint dialog, jstring username)
{
		const char *u = (*env)->GetStringUTFChars(env, username, NULL);
		gnome_password_dialog_set_username((GnomePasswordDialog*)dialog, u);
		(*env)->ReleaseStringUTFChars(env, username, u);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_set_password
 * Signature: (ILjava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1set_1password
  (JNIEnv *env, jclass cls, jint dialog, jstring password)
{
		const char *p = (*env)->GetStringUTFChars(env, password, NULL);
		gnome_password_dialog_set_password((GnomePasswordDialog*)dialog, p);
		(*env)->ReleaseStringUTFChars(env, password, p);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_set_readonly_username
 * Signature: (IZ)V
 */
JNIEXPORT void JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1set_1readonly_1username
  (JNIEnv *env, jclass cls, jint dialog, jboolean readonly)
{
	gnome_password_dialog_set_readonly_username((GnomePasswordDialog*)dialog, (gboolean)readonly);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_set_remember
 * Signature: (IZ)V
 */
JNIEXPORT void JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1set_1remember
  (JNIEnv *env, jclass cls, jint dialog, jboolean remember)
{
	gnome_password_dialog_set_remember((GnomePasswordDialog*)dialog, (gboolean)remember);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_get_username
 * Signature: (I)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1get_1username
  (JNIEnv *env, jclass cls, jint dialog)
{
	char *username = gnome_password_dialog_get_username((GnomePasswordDialog*)dialog);
	return (*env)->NewStringUTF(env, username);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_get_password
 * Signature: (I)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1get_1password
  (JNIEnv *env, jclass cls, jint dialog)
{
	char *password = gnome_password_dialog_get_password((GnomePasswordDialog*)dialog);
	return (*env)->NewStringUTF(env, password);
}

/*
 * Class:     org_gnu_gnome_PasswordDialog
 * Method:    gnome_password_dialog_get_remember
 * Signature: (I)Z
 */
JNIEXPORT jboolean JNICALL Java_org_gnu_gnome_PasswordDialog_gnome_1password_1dialog_1get_1remember
  (JNIEnv *env, jclass cls, jint dialog)
{
	return (jboolean)gnome_password_dialog_get_remember((GnomePasswordDialog*)dialog);
}

#ifdef __cplusplus
}
#endif
#endif
