/***************************************************************************
                            QPalette.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 <qpalette.h>
#include <qstring.h>
#include <qcstring.h>

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

class QPaletteJBridge : public QPalette
{
public:
	QPaletteJBridge() : QPalette() {}
	QPaletteJBridge(const QColor& button) : QPalette(button) {}
	QPaletteJBridge(const QColor& button, const QColor& background) : QPalette(button, background) {}
	QPaletteJBridge(const QColorGroup& active, const QColorGroup& disabled, const QColorGroup& inactive) : QPalette(active, disabled, inactive) {}
	QPaletteJBridge(const QPalette& arg1) : QPalette(arg1) {}
	~QPaletteJBridge() {QtSupport::qtKeyDeleted(this);}
};


JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_newQPalette__(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPaletteJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_newQPalette__Lorg_kde_qt_QColor_2(JNIEnv *env, jobject obj, jobject button)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPaletteJBridge((QColor&) *(QColor *) QtSupport::getQt(env, button)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_newQPalette__Lorg_kde_qt_QColor_2Lorg_kde_qt_QColor_2(JNIEnv *env, jobject obj, jobject button, jobject background)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPaletteJBridge((QColor&) *(QColor *) QtSupport::getQt(env, button), (QColor&) *(QColor *) QtSupport::getQt(env, background)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_newQPalette__Lorg_kde_qt_QColorGroup_2Lorg_kde_qt_QColorGroup_2Lorg_kde_qt_QColorGroup_2(JNIEnv *env, jobject obj, jobject active, jobject disabled, jobject inactive)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPaletteJBridge((QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, active), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, disabled), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, inactive)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_newQPalette__Lorg_kde_qt_QPalette_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPaletteJBridge((QPalette&) *(QPalette *) QtSupport::getQt(env, arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QPalette*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_color(JNIEnv *env, jobject obj, jint arg1, jint arg2)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColor *) &((QPaletteJBridge*) QtSupport::getQt(env, obj))->color((QPalette::ColorGroup) arg1, (QColorGroup::ColorRole) arg2), "org.kde.qt.QColor");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_brush(JNIEnv *env, jobject obj, jint arg1, jint arg2)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QBrush *) &((QPaletteJBridge*) QtSupport::getQt(env, obj))->brush((QPalette::ColorGroup) arg1, (QColorGroup::ColorRole) arg2), "org.kde.qt.QBrush");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setColor__IILorg_kde_qt_QColor_2(JNIEnv *env, jobject obj, jint arg1, jint arg2, jobject arg3)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setColor((QPalette::ColorGroup) arg1, (QColorGroup::ColorRole) arg2, (QColor&) *(QColor *) QtSupport::getQt(env, arg3));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setBrush__IILorg_kde_qt_QBrush_2(JNIEnv *env, jobject obj, jint arg1, jint arg2, jobject arg3)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setBrush((QPalette::ColorGroup) arg1, (QColorGroup::ColorRole) arg2, (QBrush&) *(QBrush *) QtSupport::getQt(env, arg3));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setColor__ILorg_kde_qt_QColor_2(JNIEnv *env, jobject obj, jint arg1, jobject arg2)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setColor((QColorGroup::ColorRole) arg1, (QColor&) *(QColor *) QtSupport::getQt(env, arg2));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setBrush__ILorg_kde_qt_QBrush_2(JNIEnv *env, jobject obj, jint arg1, jobject arg2)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setBrush((QColorGroup::ColorRole) arg1, (QBrush&) *(QBrush *) QtSupport::getQt(env, arg2));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_copy(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPalette (((QPaletteJBridge*) QtSupport::getQt(env, obj))->copy()), "org.kde.qt.QPalette", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_active(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColorGroup *) &((QPaletteJBridge*) QtSupport::getQt(env, obj))->active(), "org.kde.qt.QColorGroup");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_disabled(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColorGroup *) &((QPaletteJBridge*) QtSupport::getQt(env, obj))->disabled(), "org.kde.qt.QColorGroup");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_inactive(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColorGroup *) &((QPaletteJBridge*) QtSupport::getQt(env, obj))->inactive(), "org.kde.qt.QColorGroup");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPalette_normal(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColorGroup *) &((QPaletteJBridge*) QtSupport::getQt(env, obj))->normal(), "org.kde.qt.QColorGroup");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setActive(JNIEnv *env, jobject obj, jobject arg1)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setActive((QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setDisabled(JNIEnv *env, jobject obj, jobject arg1)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setDisabled((QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setInactive(JNIEnv *env, jobject obj, jobject arg1)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setInactive((QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPalette_setNormal(JNIEnv *env, jobject obj, jobject cg)
{
	((QPaletteJBridge*) QtSupport::getQt(env, obj))->setNormal((QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg));
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPalette_isCopyOf(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((QPaletteJBridge*) QtSupport::getQt(env, obj))->isCopyOf((QPalette&) *(QPalette *) QtSupport::getQt(env, arg1));
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QPalette_serialNumber(JNIEnv *env, jobject obj)
{
	return (jint) ((QPaletteJBridge*) QtSupport::getQt(env, obj))->serialNumber();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QPalette_foregroundRoleFromMode(JNIEnv *env, jclass obj, jint mode)
{
	return (jint) QPaletteJBridge::foregroundRoleFromMode((Qt::BackgroundMode) mode);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QPalette_backgroundRoleFromMode(JNIEnv *env, jclass obj, jint mode)
{
	return (jint) QPaletteJBridge::backgroundRoleFromMode((Qt::BackgroundMode) mode);
}

