/***************************************************************************
                            QWindowsStyle.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 <qwindowsstyle.h>
#include <qstring.h>
#include <qcstring.h>
#include <qpixmap.h>

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

class QWindowsStyleJBridge : public QWindowsStyle
{
public:
	QWindowsStyleJBridge() : QWindowsStyle() {}
	~QWindowsStyleJBridge() {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_QWindowsStyle_newQWindowsStyle(JNIEnv *env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QWindowsStyleJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QWindowsStyle_polishPopupMenu(JNIEnv *env, jobject obj, jobject arg1)
{
	((QWindowsStyleJBridge*) QtSupport::getQt(env, obj))->polishPopupMenu((QPopupMenu*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWindowsStyle_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)
{
	((QWindowsStyleJBridge*) 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_QWindowsStyle_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)
{
	((QWindowsStyleJBridge*) 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), QWindowsStyle::Style_Default, QStyleOption::Default);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWindowsStyle_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 flags, jint arg1)
{
	((QWindowsStyleJBridge*) 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) flags, (QStyleOption&) * (QStyleOption *) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWindowsStyle_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)
{
	((QWindowsStyleJBridge*) 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), QWindowsStyle::Style_Default, QStyleOption::Default);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QWindowsStyle_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 flags, jint sub, jint subActive, jint arg1)
{
	((QWindowsStyleJBridge*) 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) flags, (QStyle::SCFlags) sub, (QStyle::SCFlags) subActive, (QStyleOption&) * (QStyleOption *) arg1);
	return;
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QWindowsStyle_sizeFromContents(JNIEnv *env, jobject obj, jint contents, jobject widget, jobject contentsSize, jint arg1)
{
	QSize _s= ((QWindowsStyleJBridge*) QtSupport::getQt(env, obj))->sizeFromContents((QStyle::ContentsType) contents, (QWidget*) QtSupport::getQt(env, widget), (QSize&) *(QSize *) QtSupport::getQt(env, contentsSize), (QStyleOption&) * (QStyleOption *) arg1);
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QSize(_s.width(),_s.height()), "org.kde.qt.QSize", TRUE);
}

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QWindowsStyle_stylePixmap__ILorg_kde_qt_QWidget_2I(JNIEnv *env, jobject obj, jint stylepixmap, jobject widget, jint arg1)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap (((QWindowsStyleJBridge*) QtSupport::getQt(env, obj))->stylePixmap((QStyle::StylePixmap) stylepixmap, (QWidget*) QtSupport::getQt(env, widget), (QStyleOption&) * (QStyleOption *) arg1)), "org.kde.qt.QPixmap", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QWindowsStyle_stylePixmap__I(JNIEnv *env, jobject obj, jint stylepixmap)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPixmap(((QWindowsStyleJBridge*) QtSupport::getQt(env, obj))->stylePixmap((QStyle::StylePixmap) stylepixmap, 0, QStyleOption::Default)), "org.kde.qt.QPixmap", TRUE);
}

