/***************************************************************************
                            QCanvasPixmapArray.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 <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() {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_finalize(JNIEnv *env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QCanvasPixmapArray*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

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) ((QCanvasPixmapArrayJBridge*) 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) ((QCanvasPixmapArrayJBridge*) 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) ((QCanvasPixmapArrayJBridge*) 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) ((QCanvasPixmapArrayJBridge*) 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 *)((QCanvasPixmapArrayJBridge*) 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)
{
	((QCanvasPixmapArrayJBridge*) 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) ((QCanvasPixmapArrayJBridge*) QtSupport::getQt(env, obj))->count();
}

