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

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

class QMovieJBridge : public QMovie
{
public:
	QMovieJBridge() : QMovie() {}
	QMovieJBridge(int bufsize) : QMovie(bufsize) {}
	QMovieJBridge(QDataSource* arg1, int bufsize) : QMovie(arg1, bufsize) {}
	QMovieJBridge(const QString& fileName, int bufsize) : QMovie(fileName, bufsize) {}
	QMovieJBridge(QByteArray data, int bufsize) : QMovie(data, bufsize) {}
	QMovieJBridge(const QMovie& arg1) : QMovie(arg1) {}
	~QMovieJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie__I(JNIEnv *env, jobject obj, jint bufsize)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((int) bufsize));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie__Lorg_kde_qt_QDataSource_2I(JNIEnv *env, jobject obj, jobject arg1, jint bufsize)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((QDataSource*) QtSupport::getQt(env, arg1), (int) bufsize));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie__Lorg_kde_qt_QDataSource_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((QDataSource*) QtSupport::getQt(env, arg1), 1024));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring fileName, jint bufsize)
{
static QString * _qstring_fileName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), (int) bufsize));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName)
{
static QString * _qstring_fileName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), 1024));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie___3BI(JNIEnv *env, jobject obj, jbyteArray data, jint bufsize)
{
static QByteArray * _qbyteArray_data = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((QByteArray) * (QByteArray *) QtSupport::toQByteArray(env, data, &_qbyteArray_data), (int) bufsize));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_newQMovie___3B(JNIEnv *env, jobject obj, jbyteArray data)
{
static QByteArray * _qbyteArray_data = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QMovieJBridge((QByteArray) * (QByteArray *) QtSupport::toQByteArray(env, data, &_qbyteArray_data), 1024));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

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

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMovie_pushSpace(JNIEnv *env, jobject obj)
{
	return (jint) ((QMovieJBridge*) QtSupport::getQt(env, obj))->pushSpace();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_pushData(JNIEnv *env, jobject obj, jstring data, jint length)
{
static QCString * _qstring_data = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->pushData((uchar*) QtSupport::toCharString(env, data, &_qstring_data), (int) length);
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMovie_backgroundColor(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QColor *) &((QMovieJBridge*) QtSupport::getQt(env, obj))->backgroundColor(), "org.kde.qt.QColor");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_setBackgroundColor(JNIEnv *env, jobject obj, jobject arg1)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->setBackgroundColor((QColor&) *(QColor *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMovie_getValidRect(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QRect *) &((QMovieJBridge*) QtSupport::getQt(env, obj))->getValidRect(), "org.kde.qt.QRect");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMovie_framePixmap(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QPixmap *) &((QMovieJBridge*) QtSupport::getQt(env, obj))->framePixmap(), "org.kde.qt.QPixmap");
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QMovie_frameImage(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)(QImage *) &((QMovieJBridge*) QtSupport::getQt(env, obj))->frameImage(), "org.kde.qt.QImage");
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMovie_isNull(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMovieJBridge*) QtSupport::getQt(env, obj))->isNull();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMovie_frameNumber(JNIEnv *env, jobject obj)
{
	return (jint) ((QMovieJBridge*) QtSupport::getQt(env, obj))->frameNumber();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMovie_steps(JNIEnv *env, jobject obj)
{
	return (jint) ((QMovieJBridge*) QtSupport::getQt(env, obj))->steps();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMovie_paused(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMovieJBridge*) QtSupport::getQt(env, obj))->paused();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMovie_finished(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMovieJBridge*) QtSupport::getQt(env, obj))->finished();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QMovie_running(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QMovieJBridge*) QtSupport::getQt(env, obj))->running();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_unpause(JNIEnv *env, jobject obj)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->unpause();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_pause(JNIEnv *env, jobject obj)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->pause();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_step__(JNIEnv *env, jobject obj)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->step();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_step__I(JNIEnv *env, jobject obj, jint arg1)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->step((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_restart(JNIEnv *env, jobject obj)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->restart();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QMovie_speed(JNIEnv *env, jobject obj)
{
	return (jint) ((QMovieJBridge*) QtSupport::getQt(env, obj))->speed();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_setSpeed(JNIEnv *env, jobject obj, jint arg1)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->setSpeed((int) arg1);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_connectResize(JNIEnv *env, jobject obj, jobject receiver, jstring member)
{
static QCString * _qstring_member = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->connectResize((QObject*) QtSupport::slotForReceiver(env, receiver, member), "1invoke(const QSize&)");
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_disconnectResize__Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject receiver, jstring member)
{
static QCString * _qstring_member = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->disconnectResize((QObject*) QtSupport::slotForReceiver(env, receiver, member), "1invoke(const QSize&)");
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_disconnectResize__Lorg_kde_qt_QObject_2(JNIEnv *env, jobject obj, jobject receiver)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->disconnectResize((QObject*) QtSupport::getQt(env, receiver), 0);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_connectUpdate(JNIEnv *env, jobject obj, jobject receiver, jstring member)
{
static QCString * _qstring_member = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->connectUpdate((QObject*) QtSupport::slotForReceiver(env, receiver, member), "1invoke(const QRect&)");
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_disconnectUpdate__Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject receiver, jstring member)
{
static QCString * _qstring_member = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->disconnectUpdate((QObject*) QtSupport::slotForReceiver(env, receiver, member), "1invoke(const QRect&)");
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_disconnectUpdate__Lorg_kde_qt_QObject_2(JNIEnv *env, jobject obj, jobject receiver)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->disconnectUpdate((QObject*) QtSupport::getQt(env, receiver), 0);
	return;
}

//JNIEXPORT void JNICALL
//Java_org_kde_qt_QMovie_setDisplayWidget(JNIEnv *env, jobject obj, jobject w)
//{
//	((QMovieJBridge*) QtSupport::getQt(env, obj))->setDisplayWidget((QWidget*) QtSupport::getQt(env, w));
//	return;
//}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_connectStatus(JNIEnv *env, jobject obj, jobject receiver, jstring member)
{
static QCString * _qstring_member = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->connectStatus((QObject*) QtSupport::slotForReceiver(env, receiver, member), "1invoke(int)");
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_disconnectStatus__Lorg_kde_qt_QObject_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jobject receiver, jstring member)
{
static QCString * _qstring_member = 0;
	((QMovieJBridge*) QtSupport::getQt(env, obj))->disconnectStatus((QObject*) QtSupport::slotForReceiver(env, receiver, member), "1invoke(int)");
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QMovie_disconnectStatus__Lorg_kde_qt_QObject_2(JNIEnv *env, jobject obj, jobject receiver)
{
	((QMovieJBridge*) QtSupport::getQt(env, obj))->disconnectStatus((QObject*) QtSupport::getQt(env, receiver), 0);
	return;
}

