/***************************************************************************
                            QApplication.cpp -  description
                             -------------------
    begin                : Wed Nov 21 17:05:56 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 17:05:56 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
***************************************************************************/

#define _BOOL_H_
#include <qpainter.h>
#include <qapplication.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QApplication.h>

static jobjectArray _args = 0;

class QApplicationJBridge : public QApplication
{
public:
	QApplicationJBridge(int& argc, char* * argv) : QApplication(argc, argv) {}
	QApplicationJBridge(int& argc, char* * argv, bool GUIenabled) : QApplication(argc, argv, GUIenabled) {}
	QApplicationJBridge(int& argc, char* * argv, Type arg1) : QApplication(argc, argv, arg1) {}
//	QApplicationJBridge(Display* dpy, HANDLE visual, HANDLE cmap) : QApplication(dpy, visual, cmap) {}
//	QApplicationJBridge(Display* dpy, int argc, char* * argv, HANDLE visual, HANDLE cmap) : QApplication(dpy, argc, argv, visual, cmap) {}
	~QApplicationJBridge() {QtSupport::qtKeyDeleted(this);}
	void childEvent(QChildEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "childEvent", arg1, "org.kde.qt.QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "customEvent", arg1, "org.kde.qt.QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (! QtSupport::eventDelegate(this, "timerEvent", arg1, "org.kde.qt.QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_newQApplication___3Ljava_lang_String_2(JNIEnv *env, jobject obj, jobjectArray args)
{
	int argc = (int) env->GetArrayLength(args) + 1;
	_args = (jobjectArray) env->NewGlobalRef(args);
 	if (QtSupport::getQt(env, obj) == 0) {
 		QtSupport::setQt(env, obj, new QApplicationJBridge(argc, QtSupport::toArgv(env, args)));
 		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
 	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_newQApplication___3Ljava_lang_String_2Z(JNIEnv *env, jobject obj, jobjectArray args, jboolean GUIenabled)
{
	int argc = (int) env->GetArrayLength(args) + 1;
	_args = (jobjectArray) env->NewGlobalRef(args);
 	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QApplicationJBridge(argc, QtSupport::toArgv(env, args), (bool) GUIenabled));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
 	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_newQApplication___3Ljava_lang_String_2I(JNIEnv *env, jobject obj, jobjectArray args, jint arg1)
{
	int argc = (int) env->GetArrayLength(args) + 1;
	_args = (jobjectArray) env->NewGlobalRef(args);
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QApplicationJBridge(argc, QtSupport::toArgv(env, args), (QApplication::Type) arg1));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
 	}
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_newQApplication__II(JNIEnv *env, jobject obj, jDisplay* dpy, jint visual, jint cmap)
//{
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new QApplicationJBridge((Display*) dpy, (HANDLE) visual, (HANDLE) cmap));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_newQApplication__(JNIEnv *env, jobject obj, jDisplay* dpy)
//{
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new QApplicationJBridge((Display*) dpy, 0, 0));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_newQApplication__ILjava_lang_String_2II(JNIEnv *env, jobject obj, jDisplay* dpy, jint argc + 1, jstring argv, jint visual, jint cmap)
//{
//static QCString * _qstring_argv = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new QApplicationJBridge((Display*) dpy, (int) argc, (char**) QtSupport::toCharString(env, argv, &_qstring_argv), (HANDLE) visual, (HANDLE) cmap));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_newQApplication__ILjava_lang_String_2(JNIEnv *env, jobject obj, jDisplay* dpy, jint argc, jstring argv)
//{
//static QCString * _qstring_argv = 0;
//	if (QtSupport::getQt(env, obj) == 0) {
//		QtSupport::setQt(env, obj, new QApplicationJBridge((Display*) dpy, (int) argc, (char**) QtSupport::toCharString(env, argv, &_qstring_argv), 0, 0));
//		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
//	}
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj) && ((QApplication*)QtSupport::getQt(env, obj))->parent() == (QObject *) 0) {
		delete (QApplication*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QApplication_argc(JNIEnv *env, jobject obj)
//{
//	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->argc();
//}

JNIEXPORT jobjectArray JNICALL
Java_org_kde_qt_QApplication_args(JNIEnv *env, jobject obj)
{
	return _args;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_type(JNIEnv *env, jobject obj)
{
	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->type();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_mainWidget(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QApplicationJBridge*) QtSupport::getQt(env, obj))->mainWidget(), "org.kde.qt.QWidget");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setMainWidget(JNIEnv *env, jobject obj, jobject arg1)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->setMainWidget((QWidget*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_polish(JNIEnv *env, jobject obj, jobject arg1)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->polish((QWidget*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_focusWidget(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QApplicationJBridge*) QtSupport::getQt(env, obj))->focusWidget(), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_activeWindow(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QApplicationJBridge*) QtSupport::getQt(env, obj))->activeWindow(), "org.kde.qt.QWidget");
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_exec(JNIEnv *env, jobject obj)
{
	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->exec();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_processEvents__(JNIEnv *env, jobject obj)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->processEvents();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_processEvents__I(JNIEnv *env, jobject obj, jint maxtime)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->processEvents((int) maxtime);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_processOneEvent(JNIEnv *env, jobject obj)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->processOneEvent();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_hasPendingEvents(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->hasPendingEvents();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_enter_1loop(JNIEnv *env, jobject obj)
{
	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->enter_loop();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_exit_1loop(JNIEnv *env, jobject obj)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->exit_loop();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_loopLevel(JNIEnv *env, jobject obj)
{
	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->loopLevel();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_notify(JNIEnv *env, jobject obj, jobject arg1, jobject arg2)
{
	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->notify((QObject*) QtSupport::getQt(env, arg1), (QEvent*) QtSupport::getQt(env, arg2));
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setDefaultCodec(JNIEnv *env, jobject obj, jobject arg1)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->setDefaultCodec((QTextCodec*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_defaultCodec(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QApplicationJBridge*) QtSupport::getQt(env, obj))->defaultCodec(), "org.kde.qt.QTextCodec");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_installTranslator(JNIEnv *env, jobject obj, jobject arg1)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->installTranslator((QTranslator*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_removeTranslator(JNIEnv *env, jobject obj, jobject arg1)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->removeTranslator((QTranslator*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QApplication_translate(JNIEnv *env, jobject obj, jstring context, jstring key, jstring comment, jint encoding)
{
	QString  _qstring;
static QCString * _qstring_comment = 0;
static QCString * _qstring_key = 0;
static QCString * _qstring_context = 0;
	_qstring = ((QApplicationJBridge*) QtSupport::getQt(env, obj))->translate((char*) QtSupport::toCharString(env, context, &_qstring_context), (char*) QtSupport::toCharString(env, key, &_qstring_key), (char*) QtSupport::toCharString(env, comment, &_qstring_comment), (QApplication::Encoding) encoding);
	return QtSupport::fromQString(env, &_qstring);
}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_macEventFilter(JNIEnv *env, jobject obj, j arg1)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->macEventFilter((EventRef) arg1);
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_winEventFilter(JNIEnv *env, jobject obj, jMSG* arg1)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->winEventFilter((MSG*) arg1);
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_x11EventFilter(JNIEnv *env, jobject obj, jXEvent* arg1)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->x11EventFilter((XEvent*) arg1);
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QApplication_x11ClientMessage(JNIEnv *env, jobject obj, jobject arg1, jXEvent* arg2, jboolean passive_only)
//{
//	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->x11ClientMessage((QWidget*) QtSupport::getQt(env, arg1), (XEvent*) arg2, (bool) passive_only);
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QApplication_x11ProcessEvent(JNIEnv *env, jobject obj, jXEvent* arg1)
//{
//	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->x11ProcessEvent((XEvent*) arg1);
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_qwsEventFilter(JNIEnv *env, jobject obj, jobject arg1)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->qwsEventFilter((QWSEvent*) QtSupport::getQt(env, arg1));
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QApplication_qwsProcessEvent(JNIEnv *env, jobject obj, jobject arg1)
//{
//	return (jint) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->qwsProcessEvent((QWSEvent*) QtSupport::getQt(env, arg1));
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_qwsSetCustomColors(JNIEnv *env, jobject obj, jintArray colortable, jint start, jint numColors)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->qwsSetCustomColors( (QRgb*) QtSupport::toIntPtr(env, colortable), (int) start, (int) numColors);
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_winFocus(JNIEnv *env, jobject obj, jobject arg1, jboolean arg2)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->winFocus((QWidget*) QtSupport::getQt(env, arg1), (bool) arg2);
//	return;
//}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_isSessionRestored(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->isSessionRestored();
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QApplication_sessionId(JNIEnv *env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QApplicationJBridge*) QtSupport::getQt(env, obj))->sessionId();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_commitData(JNIEnv *env, jobject obj, jobject sm)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->commitData((QSessionManager&) *(QSessionManager *) QtSupport::getQt(env, sm));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_saveState(JNIEnv *env, jobject obj, jobject sm)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->saveState((QSessionManager&) *(QSessionManager *) QtSupport::getQt(env, sm));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_wakeUpGuiThread(JNIEnv *env, jobject obj)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->wakeUpGuiThread();
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_lock(JNIEnv *env, jobject obj)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->lock();
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_unlock__Z(JNIEnv *env, jobject obj, jboolean wakeUpGui)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->unlock((bool) wakeUpGui);
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_unlock__(JNIEnv *env, jobject obj)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->unlock(TRUE);
//	return;
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_locked(JNIEnv *env, jobject obj)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->locked();
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_tryLock(JNIEnv *env, jobject obj)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->tryLock();
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_setEnableRemoteControl__Z(JNIEnv *env, jobject obj, jboolean enable, j appId)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->setEnableRemoteControl((bool) enable, (QUuid) appId);
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_setEnableRemoteControl__Z(JNIEnv *env, jobject obj, jboolean enable)
//{
//	((QApplicationJBridge*) QtSupport::getQt(env, obj))->setEnableRemoteControl((bool) enable, QUuid());
//	return;
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_remoteControlEnabled(JNIEnv *env, jobject obj)
//{
//	return (jboolean) ((QApplicationJBridge*) QtSupport::getQt(env, obj))->remoteControlEnabled();
//}

//JNIEXPORT  JNICALL
//Java_org_kde_qt_QApplication_applicationId(JNIEnv *env, jobject obj)
//{
//	return () ((QApplicationJBridge*) QtSupport::getQt(env, obj))->applicationId();
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_quit(JNIEnv *env, jobject obj)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->quit();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_closeAllWindows(JNIEnv *env, jobject obj)
{
	((QApplicationJBridge*) QtSupport::getQt(env, obj))->closeAllWindows();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_style(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QStyle *) &QApplicationJBridge::style(), "org.kde.qt.QStyle");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setStyle__Lorg_kde_qt_QStyle_2(JNIEnv *env, jclass obj, jobject arg1)
{
	QApplicationJBridge::setStyle((QStyle*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_setStyle__Ljava_lang_String_2(JNIEnv *env, jclass obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::setStyle((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1)), "org.kde.qt.QStyle");
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_colorMode(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::colorMode();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setColorMode(JNIEnv *env, jclass obj, jint arg1)
{
	QApplicationJBridge::setColorMode((QApplication::ColorMode) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_colorSpec(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::colorSpec();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setColorSpec(JNIEnv *env, jclass obj, jint arg1)
{
	QApplicationJBridge::setColorSpec((int) arg1);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_overrideCursor(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::overrideCursor(), "org.kde.qt.QCursor");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setOverrideCursor__Lorg_kde_qt_QCursor_2Z(JNIEnv *env, jclass obj, jobject arg1, jboolean replace)
{
	QApplicationJBridge::setOverrideCursor((QCursor&) *(QCursor *) QtSupport::getQt(env, arg1), (bool) replace);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setOverrideCursor__Lorg_kde_qt_QCursor_2(JNIEnv *env, jclass obj, jobject arg1)
{
	QApplicationJBridge::setOverrideCursor((QCursor&) *(QCursor *) QtSupport::getQt(env, arg1), FALSE);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_restoreOverrideCursor(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::restoreOverrideCursor();
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_hasGlobalMouseTracking(JNIEnv *env, jclass obj)
{
	return (jboolean) QApplicationJBridge::hasGlobalMouseTracking();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setGlobalMouseTracking(JNIEnv *env, jclass obj, jboolean enable)
{
	QApplicationJBridge::setGlobalMouseTracking((bool) enable);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_palette__Lorg_kde_qt_QWidget_2(JNIEnv *env, jclass obj, jobject arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QPalette (QApplicationJBridge::palette((QWidget*) QtSupport::getQt(env, arg1))), "org.kde.qt.QPalette", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_palette__(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPalette(QApplicationJBridge::palette(0)), "org.kde.qt.QPalette", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setPalette__Lorg_kde_qt_QPalette_2ZLjava_lang_String_2(JNIEnv *env, jclass obj, jobject arg1, jboolean informWidgets, jstring className)
{
static QCString * _qstring_className = 0;
	QApplicationJBridge::setPalette((QPalette&) *(QPalette *) QtSupport::getQt(env, arg1), (bool) informWidgets, (char*) QtSupport::toCharString(env, className, &_qstring_className));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setPalette__Lorg_kde_qt_QPalette_2(JNIEnv *env, jclass obj, jobject arg1)
{
	QApplicationJBridge::setPalette((QPalette&) *(QPalette *) QtSupport::getQt(env, arg1), FALSE, 0);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_font__Lorg_kde_qt_QWidget_2(JNIEnv *env, jclass obj, jobject arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QFont (QApplicationJBridge::font((QWidget*) QtSupport::getQt(env, arg1))), "org.kde.qt.QFont", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_font__(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QFont(QApplicationJBridge::font(0)), "org.kde.qt.QFont", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setFont__Lorg_kde_qt_QFont_2ZLjava_lang_String_2(JNIEnv *env, jclass obj, jobject arg1, jboolean informWidgets, jstring className)
{
static QCString * _qstring_className = 0;
	QApplicationJBridge::setFont((QFont&) *(QFont *) QtSupport::getQt(env, arg1), (bool) informWidgets, (char*) QtSupport::toCharString(env, className, &_qstring_className));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setFont__Lorg_kde_qt_QFont_2(JNIEnv *env, jclass obj, jobject arg1)
{
	QApplicationJBridge::setFont((QFont&) *(QFont *) QtSupport::getQt(env, arg1), FALSE, 0);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_fontMetrics(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new  QFontMetrics (QApplicationJBridge::fontMetrics()), "org.kde.qt.QFontMetrics", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_allWidgets(JNIEnv *env, jclass obj)
{
	QWidgetList  * _qlist;
	_qlist = QApplicationJBridge::allWidgets();
	return (jobject) QtSupport::arrayWithQWidgetList(env, (QWidgetList *) _qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_topLevelWidgets(JNIEnv *env, jclass obj)
{
	QWidgetList  * _qlist;
	_qlist = QApplicationJBridge::topLevelWidgets();
	return (jobject) QtSupport::arrayWithQWidgetList(env, (QWidgetList *) _qlist);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_desktop(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::desktop(), "org.kde.qt.QDesktopWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_activePopupWidget(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::activePopupWidget(), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_activeModalWidget(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::activeModalWidget(), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_clipboard(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::clipboard(), "org.kde.qt.QClipboard");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_widgetAt__IIZ(JNIEnv *env, jclass obj, jint x, jint y, jboolean child)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::widgetAt((int) x, (int) y, (bool) child), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_widgetAt__II(JNIEnv *env, jclass obj, jint x, jint y)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::widgetAt((int) x, (int) y, FALSE), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_widgetAt__Lorg_kde_qt_QPoint_2Z(JNIEnv *env, jclass obj, jobject arg1, jboolean child)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::widgetAt((QPoint&) *(QPoint *) QtSupport::getQt(env, arg1), (bool) child), "org.kde.qt.QWidget");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_widgetAt__Lorg_kde_qt_QPoint_2(JNIEnv *env, jclass obj, jobject arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)QApplicationJBridge::widgetAt((QPoint&) *(QPoint *) QtSupport::getQt(env, arg1), FALSE), "org.kde.qt.QWidget");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_exit__I(JNIEnv *env, jclass obj, jint retcode)
{
	QApplicationJBridge::exit((int) retcode);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_exit__(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::exit(0);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_sendEvent(JNIEnv *env, jclass obj, jobject receiver, jobject event)
{
	return (jboolean) QApplicationJBridge::sendEvent((QObject*) QtSupport::getQt(env, receiver), (QEvent*) QtSupport::getQt(env, event));
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_postEvent(JNIEnv *env, jclass obj, jobject receiver, jobject event)
{
	QApplicationJBridge::postEvent((QObject*) QtSupport::getQt(env, receiver), (QEvent*) QtSupport::getQt(env, event));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_sendPostedEvents__Lorg_kde_qt_QObject_2I(JNIEnv *env, jclass obj, jobject receiver, jint event_type)
{
	QApplicationJBridge::sendPostedEvents((QObject*) QtSupport::getQt(env, receiver), (int) event_type);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_sendPostedEvents__(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::sendPostedEvents();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_removePostedEvents(JNIEnv *env, jclass obj, jobject receiver)
{
	QApplicationJBridge::removePostedEvents((QObject*) QtSupport::getQt(env, receiver));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_startingUp(JNIEnv *env, jclass obj)
{
	return (jboolean) QApplicationJBridge::startingUp();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_closingDown(JNIEnv *env, jclass obj)
{
	return (jboolean) QApplicationJBridge::closingDown();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_flushX(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::flushX();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_flush(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::flush();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_syncX(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::syncX();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_beep(JNIEnv *env, jclass obj)
{
	QApplicationJBridge::beep();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setWinStyleHighlightColor(JNIEnv *env, jclass obj, jobject c)
{
	QApplicationJBridge::setWinStyleHighlightColor((QColor&) *(QColor *) QtSupport::getQt(env, c));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_winStyleHighlightColor(JNIEnv *env, jclass obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColor *) &QApplicationJBridge::winStyleHighlightColor(), "org.kde.qt.QColor");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setDesktopSettingsAware(JNIEnv *env, jclass obj, jboolean arg1)
{
	QApplicationJBridge::setDesktopSettingsAware((bool) arg1);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_desktopSettingsAware(JNIEnv *env, jclass obj)
{
	return (jboolean) QApplicationJBridge::desktopSettingsAware();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setCursorFlashTime(JNIEnv *env, jclass obj, jint arg1)
{
	QApplicationJBridge::setCursorFlashTime((int) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_cursorFlashTime(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::cursorFlashTime();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setDoubleClickInterval(JNIEnv *env, jclass obj, jint arg1)
{
	QApplicationJBridge::setDoubleClickInterval((int) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_doubleClickInterval(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::doubleClickInterval();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setWheelScrollLines(JNIEnv *env, jclass obj, jint arg1)
{
	QApplicationJBridge::setWheelScrollLines((int) arg1);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_wheelScrollLines(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::wheelScrollLines();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setGlobalStrut(JNIEnv *env, jclass obj, jobject arg1)
{
	QApplicationJBridge::setGlobalStrut((QSize&) *(QSize *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_globalStrut(JNIEnv *env, jclass obj)
{
	QSize _s= QApplicationJBridge::globalStrut();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setLibraryPaths(JNIEnv *env, jclass obj, jobjectArray arg1)
{
static QStringList * _qlist_arg1 = 0;
	QApplicationJBridge::setLibraryPaths((QStringList&) * (QStringList *) QtSupport::toQStringList(env, arg1, &_qlist_arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QApplication_libraryPaths(JNIEnv *env, jclass obj)
{
	QStringList  _qlist;
	_qlist = QApplicationJBridge::libraryPaths();
	return (jobject) QtSupport::arrayWithQStringList(env, (QStringList *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_addLibraryPath(JNIEnv *env, jclass obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	QApplicationJBridge::addLibraryPath((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_removeLibraryPath(JNIEnv *env, jclass obj, jstring arg1)
{
static QString * _qstring_arg1 = 0;
	QApplicationJBridge::removeLibraryPath((QString&) * (QString *) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setStartDragTime(JNIEnv *env, jclass obj, jint ms)
{
	QApplicationJBridge::setStartDragTime((int) ms);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_startDragTime(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::startDragTime();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setStartDragDistance(JNIEnv *env, jclass obj, jint l)
{
	QApplicationJBridge::setStartDragDistance((int) l);
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_startDragDistance(JNIEnv *env, jclass obj)
{
	return (jint) QApplicationJBridge::startDragDistance();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setReverseLayout(JNIEnv *env, jclass obj, jboolean b)
{
	QApplicationJBridge::setReverseLayout((bool) b);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_reverseLayout(JNIEnv *env, jclass obj)
{
	return (jboolean) QApplicationJBridge::reverseLayout();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QApplication_horizontalAlignment(JNIEnv *env, jclass obj, jint align)
{
	return (jint) QApplicationJBridge::horizontalAlignment((int) align);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QApplication_isEffectEnabled(JNIEnv *env, jclass obj, jint arg1)
{
	return (jboolean) QApplicationJBridge::isEffectEnabled((Qt::UIEffect) arg1);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setEffectEnabled__IZ(JNIEnv *env, jclass obj, jint arg1, jboolean enable)
{
	QApplicationJBridge::setEffectEnabled((Qt::UIEffect) arg1, (bool) enable);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QApplication_setEffectEnabled__I(JNIEnv *env, jclass obj, jint arg1)
{
	QApplicationJBridge::setEffectEnabled((Qt::UIEffect) arg1, TRUE);
	return;
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QApplication_qwsDecoration(JNIEnv *env, jclass obj)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)(QWSDecoration *) &QApplicationJBridge::qwsDecoration(), "org.kde.qt.QWSDecoration");
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_qwsSetDecoration(JNIEnv *env, jclass obj, jobject arg1)
//{
//	QApplicationJBridge::qwsSetDecoration((QWSDecoration*) QtSupport::getQt(env, arg1));
//	return;
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QApplication_winVersion(JNIEnv *env, jclass obj)
//{
//	return (jint) QApplicationJBridge::winVersion();
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_winMouseButtonUp(JNIEnv *env, jclass obj)
//{
//	QApplicationJBridge::winMouseButtonUp();
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_create_xim(JNIEnv *env, jclass obj)
//{
//	QApplicationJBridge::create_xim();
//	return;
//}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QApplication_close_xim(JNIEnv *env, jclass obj)
//{
//	QApplicationJBridge::close_xim();
//	return;
//}

//JNIEXPORT jboolean JNICALL
//Java_org_kde_qt_QApplication_x11_apply_settings(JNIEnv *env, jclass obj)
//{
//	return (jboolean) QApplicationJBridge::x11_apply_settings();
//}

