/***************************************************************************
                            QMotifPlusStyle.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 <qmotifplusstyle.h>
#include <qmenudata.h>
#include <qtabbar.h>
#include <qscrollbar.h>
#include <qstring.h>
#include <qcstring.h>

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

#ifndef QT_NO_STYLE_MOTIFPLUS

class QMotifPlusStyleJBridge : public QMotifPlusStyle
{
public:
	QMotifPlusStyleJBridge(bool hoveringHighlight) : QMotifPlusStyle(hoveringHighlight) {}
	~QMotifPlusStyleJBridge() {QtSupport::qtKeyDeleted(this);}
	bool  protected_eventFilter(QObject* arg1, QEvent* arg2) {
		return (bool ) QMotifPlusStyle::eventFilter(arg1, arg2);
	}
	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_QMotifPlusStyle_newQMotifPlusStyle__Z(JNIEnv *env, jobject obj, jboolean hoveringHighlight)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMotifPlusStyleJBridge((bool) hoveringHighlight));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_polish__Lorg_kde_qt_QPalette_2(JNIEnv *env, jobject obj, jobject pal)
{
	((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->polish((QPalette&) *(QPalette *) QtSupport::getQt(env, pal));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_polish__Lorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jobject widget)
{
	((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->polish((QWidget*) QtSupport::getQt(env, widget));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_unPolish__Lorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jobject widget)
{
	((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->unPolish((QWidget*) QtSupport::getQt(env, widget));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_polish__Lorg_kde_qt_QApplication_2(JNIEnv *env, jobject obj, jobject app)
{
	((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->polish((QApplication*) QtSupport::getQt(env, app));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_unPolish__Lorg_kde_qt_QApplication_2(JNIEnv *env, jobject obj, jobject app)
{
	((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->unPolish((QApplication*) QtSupport::getQt(env, app));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_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)
{
	((QMotifPlusStyleJBridge*) 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_QMotifPlusStyle_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)
{
	((QMotifPlusStyleJBridge*) 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), QMotifPlusStyle::Style_Default, QStyleOption::Default);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_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)
{
	((QMotifPlusStyleJBridge*) 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_QMotifPlusStyle_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)
{
	((QMotifPlusStyleJBridge*) 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), QMotifPlusStyle::Style_Default, QStyleOption::Default);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMotifPlusStyle_subRect(JNIEnv *env, jobject obj, jint r, jobject widget)
{
	QRect _r= ((QMotifPlusStyleJBridge*) 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 void JNICALL
Java_org_kde_qt_QMotifPlusStyle_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 controls, jint active, jint arg1)
{
	((QMotifPlusStyleJBridge*) 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) controls, (QStyle::SCFlags) active, (QStyleOption&) * (QStyleOption *) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMotifPlusStyle_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)
{
	((QMotifPlusStyleJBridge*) 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), QMotifPlusStyle::Style_Default, QMotifPlusStyle::SC_All, QMotifPlusStyle::SC_None, QStyleOption::Default);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMotifPlusStyle_querySubControlMetrics(JNIEnv *env, jobject obj, jint control, jobject widget, jint subcontrol, jint arg1)
{
	QRect _r= ((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->querySubControlMetrics((QStyle::ComplexControl) control, (QWidget*) QtSupport::getQt(env, widget), (QStyle::SubControl) subcontrol, (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_QMotifPlusStyle_pixelMetric__ILorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jint metric, jobject widget)
{
	return (jint) ((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->pixelMetric((QStyle::PixelMetric) metric, (QWidget*) QtSupport::getQt(env, widget));
}

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

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QMotifPlusStyle_styleHint__ILorg_kde_qt_QWidget_2ILorg_kde_qt_QStyleHintReturn_2(JNIEnv *env, jobject obj, jint sh, jobject arg1, jint arg2, jobject arg3)
//{
//	return (jint) ((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->styleHint((StyleHint) sh, (QWidget*) QtSupport::getQt(env, arg1), (QStyleOption&) * (QStyleOption *) arg2, (QStyleHintReturn*) QtSupport::getQt(env, arg3));
//}

//JNIEXPORT jint JNICALL
//Java_org_kde_qt_QMotifPlusStyle_styleHint__ILorg_kde_qt_QWidget_2(JNIEnv *env, jobject obj, jint sh, jobject arg1)
//{
//	return (jint) ((QMotifPlusStyleJBridge*) QtSupport::getQt(env, obj))->styleHint((StyleHint) sh, (QWidget*) QtSupport::getQt(env, arg1), QStyleOption::Default, 0);
//}

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

#endif
