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

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

class QPlatinumStyleJBridge : public QPlatinumStyle
{
public:
	QPlatinumStyleJBridge() : QPlatinumStyle() {}
	~QPlatinumStyleJBridge() {QtSupport::qtKeyDeleted(this);}
	QColor  protected_mixedColor(const QColor& arg1, const QColor& arg2) {
		return (QColor ) QPlatinumStyle::mixedColor(arg1, arg2);
	}
	void protected_drawRiffles(QPainter* p, int x, int y, int w, int h, const QColorGroup& g, bool horizontal) {
		QPlatinumStyle::drawRiffles(p, x, y, w, h, g, horizontal);
		return;
	}
	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_QPlatinumStyle_newQPlatinumStyle(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPlatinumStyleJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawPrimitive__ILorg_kde_qt_QPainter_2Lorg_kde_qt_QRect_2Lorg_kde_qt_QColorGroup_2II(JNIEnv *env, jobject obj, jint pe, jobject p, jobject r, jobject cg, jint flags, jint arg1)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->drawPrimitive((QStyle::PrimitiveElement) pe, (QPainter*) QtSupport::getQt(env, p), (QRect&) *(QRect *) QtSupport::getQt(env, r), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), (QStyle::SFlags) flags, (QStyleOption&) * (QStyleOption *) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawPrimitive__ILorg_kde_qt_QPainter_2Lorg_kde_qt_QRect_2Lorg_kde_qt_QColorGroup_2(JNIEnv *env, jobject obj, jint pe, jobject p, jobject r, jobject cg)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->drawPrimitive((QStyle::PrimitiveElement) pe, (QPainter*) QtSupport::getQt(env, p), (QRect&) *(QRect *) QtSupport::getQt(env, r), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), QPlatinumStyle::Style_Default, QStyleOption::Default);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawControl__ILorg_kde_qt_QPainter_2Lorg_kde_qt_QWidget_2Lorg_kde_qt_QRect_2Lorg_kde_qt_QColorGroup_2II(JNIEnv *env, jobject obj, jint element, jobject p, jobject widget, jobject r, jobject cg, jint how, jint arg1)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->drawControl((QStyle::ControlElement) element, (QPainter*) QtSupport::getQt(env, p), (QWidget*) QtSupport::getQt(env, widget), (QRect&) *(QRect *) QtSupport::getQt(env, r), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), (QStyle::SFlags) how, (QStyleOption&) * (QStyleOption *) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawControl__ILorg_kde_qt_QPainter_2Lorg_kde_qt_QWidget_2Lorg_kde_qt_QRect_2Lorg_kde_qt_QColorGroup_2(JNIEnv *env, jobject obj, jint element, jobject p, jobject widget, jobject r, jobject cg)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->drawControl((QStyle::ControlElement) element, (QPainter*) QtSupport::getQt(env, p), (QWidget*) QtSupport::getQt(env, widget), (QRect&) *(QRect *) QtSupport::getQt(env, r), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), QPlatinumStyle::Style_Default, QStyleOption::Default);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawComplexControl__ILorg_kde_qt_QPainter_2Lorg_kde_qt_QWidget_2Lorg_kde_qt_QRect_2Lorg_kde_qt_QColorGroup_2IIII(JNIEnv *env, jobject obj, jint control, jobject p, jobject widget, jobject r, jobject cg, jint how, jint sub, jint subActive, jint arg1)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->drawComplexControl((QStyle::ComplexControl) control, (QPainter*) QtSupport::getQt(env, p), (QWidget*) QtSupport::getQt(env, widget), (QRect&) *(QRect *) QtSupport::getQt(env, r), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), (QStyle::SFlags) how, (QStyle::SCFlags) sub, (QStyle::SCFlags) subActive, (QStyleOption&) * (QStyleOption *) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawComplexControl__ILorg_kde_qt_QPainter_2Lorg_kde_qt_QWidget_2Lorg_kde_qt_QRect_2Lorg_kde_qt_QColorGroup_2(JNIEnv *env, jobject obj, jint control, jobject p, jobject widget, jobject r, jobject cg)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->drawComplexControl((QStyle::ComplexControl) control, (QPainter*) QtSupport::getQt(env, p), (QWidget*) QtSupport::getQt(env, widget), (QRect&) *(QRect *) QtSupport::getQt(env, r), (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, cg), QPlatinumStyle::Style_Default, QPlatinumStyle::SC_All, QPlatinumStyle::SC_None, QStyleOption::Default);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPlatinumStyle_querySubControlMetrics(JNIEnv *env, jobject obj, jint control, jobject widget, jint sc, jint arg1)
{
	QRect _r= ((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->querySubControlMetrics((QStyle::ComplexControl) control, (QWidget*) QtSupport::getQt(env, widget), (QStyle::SubControl) sc, (QStyleOption&) * (QStyleOption *) arg1);
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QPlatinumStyle_pixelMetric__ILorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jint metric, jobject widget)
{
	return (jint) ((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->pixelMetric((QStyle::PixelMetric) metric, (QWidget*) QtSupport::getQt(env, widget));
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QPlatinumStyle_pixelMetric__I(JNIEnv *env, jobject obj, jint metric)
{
	return (jint) ((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->pixelMetric((QStyle::PixelMetric) metric, 0);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPlatinumStyle_subRect(JNIEnv *env, jobject obj, jint r, jobject widget)
{
	QRect _r= ((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->subRect((QStyle::SubRect) r, (QWidget*) QtSupport::getQt(env, widget));
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPlatinumStyle_mixedColor(JNIEnv *env, jobject obj, jobject arg1, jobject arg2)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QColor (((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->protected_mixedColor((QColor&) *(QColor *) QtSupport::getQt(env, arg1), (QColor&) *(QColor *) QtSupport::getQt(env, arg2))), "org.kde.qt.QColor", TRUE);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPlatinumStyle_drawRiffles(JNIEnv *env, jobject obj, jobject p, jint x, jint y, jint w, jint h, jobject g, jboolean horizontal)
{
	((QPlatinumStyleJBridge*) QtSupport::getQt(env, obj))->protected_drawRiffles((QPainter*) QtSupport::getQt(env, p), (int) x, (int) y, (int) w, (int) h, (QColorGroup&) *(QColorGroup *) QtSupport::getQt(env, g), (bool) horizontal);
	return;
}
