/***************************************************************************
                            QCanvasPixmapArray.cpp -  description
                             -------------------
    begin                : Sun Nov  3 10:27:27 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Nov  3 10:27:27 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 <qcanvas.h>
#include <qstring.h>
#include <qcstring.h>

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

class QCanvasPixmapArrayJBridge : public QCanvasPixmapArray
{
public:
	QCanvasPixmapArrayJBridge() : QCanvasPixmapArray() {}
	QCanvasPixmapArrayJBridge(const QString& datafilenamepattern, int framecount) : QCanvasPixmapArray(datafilenamepattern, framecount) {}
	QCanvasPixmapArrayJBridge(QPtrList<QPixmap> arg1, QPtrList<QPoint> hotspots) : QCanvasPixmapArray(arg1, hotspots) {}
	QCanvasPixmapArrayJBridge(QValueList<QPixmap> arg1, QPointArray hotspots) : QCanvasPixmapArray(arg1, hotspots) {}
	~QCanvasPixmapArrayJBridge() {QtSupport::qtKeyDeleted(this);}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_newQCanvasPixmapArray__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring datafilenamepattern, jint framecount)
{
static QString * _qstring_datafilenamepattern = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QCanvasPixmapArrayJBridge((QString&) * (QString *) QtSupport::toQString(env, datafilenamepattern, &_qstring_datafilenamepattern), (int) framecount));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_newQCanvasPixmapArray__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring datafilenamepattern)
{
static QString * _qstring_datafilenamepattern = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QCanvasPixmapArrayJBridge((QString&) * (QString *) QtSupport::toQString(env, datafilenamepattern, &_qstring_datafilenamepattern), 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_newQCanvasPixmapArray__Lorg_kde_qt_QPixmapPtrList_2Lorg_kde_qt_QPointPtrList_2(JNIEnv *env, jobject obj, jobject arg1, jobject hotspots)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QCanvasPixmapArrayJBridge((QPtrList<QPixmap>) *(QPtrList<QPixmap> *) QtSupport::getQt(env, arg1), (QPtrList<QPoint>) *(QPtrList<QPoint> *) QtSupport::getQt(env, hotspots)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_newQCanvasPixmapArray__Lorg_kde_qt_QPixmapValueList_2Lorg_kde_qt_QPointArray_2(JNIEnv *env, jobject obj, jobject arg1, jobject hotspots)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QCanvasPixmapArrayJBridge((QValueList<QPixmap>) *(QValueList<QPixmap> *) QtSupport::getQt(env, arg1), (QPointArray) *(QPointArray *) QtSupport::getQt(env, hotspots)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_newQCanvasPixmapArray__Lorg_kde_qt_QPixmapValueList_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QCanvasPixmapArrayJBridge((QValueList<QPixmap>) *(QValueList<QPixmap> *) QtSupport::getQt(env, arg1), QPointArray()));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_qt_QCanvasPixmapArray_finalize(env, obj);
	return;
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasPixmapArray_readPixmaps__Ljava_lang_String_2I(JNIEnv *env, jobject obj, jstring datafilenamepattern, jint framecount)
{
static QString * _qstring_datafilenamepattern = 0;
	return (jboolean) ((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->readPixmaps((QString&) * (QString *) QtSupport::toQString(env, datafilenamepattern, &_qstring_datafilenamepattern), (int) framecount);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasPixmapArray_readPixmaps__Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring datafilenamepattern)
{
static QString * _qstring_datafilenamepattern = 0;
	return (jboolean) ((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->readPixmaps((QString&) * (QString *) QtSupport::toQString(env, datafilenamepattern, &_qstring_datafilenamepattern), 0);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasPixmapArray_readCollisionMasks(JNIEnv *env, jobject obj, jstring filenamepattern)
{
static QString * _qstring_filenamepattern = 0;
	return (jboolean) ((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->readCollisionMasks((QString&) * (QString *) QtSupport::toQString(env, filenamepattern, &_qstring_filenamepattern));
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasPixmapArray_isValid(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->isValid();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasPixmapArray_image(JNIEnv *env, jobject obj, jint i)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->image((int) i), "org.kde.qt.QCanvasPixmap");
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPixmapArray_setImage(JNIEnv *env, jobject obj, jint i, jobject p)
{
	((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->setImage((int) i, (QCanvasPixmap*) QtSupport::getQt(env, p));
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QCanvasPixmapArray_count(JNIEnv *env, jobject obj)
{
	return (jint) ((QCanvasPixmapArray*) QtSupport::getQt(env, obj))->count();
}

