/***************************************************************************
                            KRootPixmap.cpp -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, 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 <krootpixmap.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <kdejava/KDESupport.h>
#include <kdejava/KRootPixmap.h>

class KRootPixmapJBridge : public KRootPixmap
{
public:
	KRootPixmapJBridge(QWidget* target, const char* name) : KRootPixmap(target, name) {}
	KRootPixmapJBridge(QWidget* target, QObject* parent, const char* name) : KRootPixmap(target, parent, name) {}
	~KRootPixmapJBridge() {QtSupport::qtKeyDeleted(this);}
	 bool  protected_eventFilter(QObject* arg1, QEvent* arg2) {
		return ( bool ) KRootPixmap::eventFilter(arg1, arg2);
	}
	void protected_updateBackground(KSharedPixmap* arg1) {
		KRootPixmap::updateBackground(arg1);
		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_koala_KRootPixmap_newKRootPixmap__Lorg_kde_qt_QWidget_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject target, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KRootPixmapJBridge((QWidget*) QtSupport::getQt(env, target), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_newKRootPixmap__Lorg_kde_qt_QWidget_2Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject target, jobject parent, jstring name)
{
static QCString * _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KRootPixmapJBridge((QWidget*) QtSupport::getQt(env, target), (QObject*) QtSupport::getQt(env, parent), (char*) QtSupport::toCharString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_newKRootPixmap__Lorg_kde_qt_QWidget_2Lorg_kde_qt_QObject_2(JNIEnv *env, jobject obj, jobject target, jobject parent)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new KRootPixmapJBridge((QWidget*) QtSupport::getQt(env, target), (QObject*) QtSupport::getQt(env, parent), 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_koala_KRootPixmap_finalize(env, obj);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KRootPixmap_isDisposed(JNIEnv *env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KRootPixmap_isAvailable(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KRootPixmap*) QtSupport::getQt(env, obj))->isAvailable();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KRootPixmap_isActive(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KRootPixmap*) QtSupport::getQt(env, obj))->isActive();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KRootPixmap_currentDesktop(JNIEnv *env, jobject obj)
{
	return (jint) ((KRootPixmap*) QtSupport::getQt(env, obj))->currentDesktop();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KRootPixmap_customPainting(JNIEnv *env, jobject obj)
{
	return (jboolean) ((KRootPixmap*) QtSupport::getQt(env, obj))->customPainting();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_koala_KRootPixmap_checkAvailable(JNIEnv *env, jobject obj, jboolean arg1)
{
	return (jboolean) ((KRootPixmap*) QtSupport::getQt(env, obj))->checkAvailable((bool) arg1);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_start(JNIEnv *env, jobject obj)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->start();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_stop(JNIEnv *env, jobject obj)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->stop();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_setFadeEffect(JNIEnv *env, jobject obj, jdouble strength, jobject color)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->setFadeEffect((double) strength, (QColor&) *(QColor *) QtSupport::getQt(env, color));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_repaint__Z(JNIEnv *env, jobject obj, jboolean force)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->repaint((bool) force);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_repaint__(JNIEnv *env, jobject obj)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->repaint();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_setCustomPainting(JNIEnv *env, jobject obj, jboolean enable)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->setCustomPainting((bool) enable);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_enableExports(JNIEnv *env, jobject obj)
{
	((KRootPixmap*) QtSupport::getQt(env, obj))->enableExports();
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_koala_KRootPixmap_updateBackground(JNIEnv *env, jobject obj, jobject arg1)
{
	((KRootPixmapJBridge*) QtSupport::getQt(env, obj))->protected_updateBackground((KSharedPixmap*) QtSupport::getQt(env, arg1));
	return;
}

