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

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

class QBitmapJBridge : public QBitmap
{
public:
	QBitmapJBridge() : QBitmap() {}
	QBitmapJBridge(int w, int h, bool clear, QPixmap::Optimization arg1) : QBitmap(w, h, clear, arg1) {}
	QBitmapJBridge(const QSize& arg1, bool clear, QPixmap::Optimization arg2) : QBitmap(arg1, clear, arg2) {}
	QBitmapJBridge(int w, int h, const uchar* bits, bool isXbitmap) : QBitmap(w, h, bits, isXbitmap) {}
	QBitmapJBridge(const QSize& arg1, const uchar* bits, bool isXbitmap) : QBitmap(arg1, bits, isXbitmap) {}
	QBitmapJBridge(const QBitmap& arg1) : QBitmap(arg1) {}
	QBitmapJBridge(const QString& fileName, const char* format) : QBitmap(fileName, format) {}
};


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

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__IIZI(JNIEnv *env, jobject obj, jint w, jint h, jboolean clear, jint arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((int) w, (int) h, (bool) clear, (QPixmap::Optimization) arg1));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__II(JNIEnv *env, jobject obj, jint w, jint h)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((int) w, (int) h, FALSE, QPixmap::DefaultOptim));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Lorg_kde_qt_QSize_2ZI(JNIEnv *env, jobject obj, jobject arg1, jboolean clear, jint arg2)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (bool) clear, (QPixmap::Optimization) arg2));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Lorg_kde_qt_QSize_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((QSize&) *(QSize *) QtSupport::getQt(env, arg1), FALSE, QPixmap::DefaultOptim));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__II_3CZ(JNIEnv *env, jobject obj, jint w, jint h, jcharArray bits, jboolean isXbitmap)
{
static QByteArray * _qbytearray_bits = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((int) w, (int) h, (uchar*) QtSupport::toUcharArray(env, bits, &_qbytearray_bits), (bool) isXbitmap));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__II_3C(JNIEnv *env, jobject obj, jint w, jint h, jcharArray bits)
{
static QByteArray * _qbytearray_bits = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((int) w, (int) h, (uchar*) QtSupport::toUcharArray(env, bits, &_qbytearray_bits), FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Lorg_kde_qt_QSize_2_3CZ(JNIEnv *env, jobject obj, jobject arg1, jcharArray bits, jboolean isXbitmap)
{
static QByteArray * _qbytearray_bits = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (uchar*) QtSupport::toUcharArray(env, bits, &_qbytearray_bits), (bool) isXbitmap));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Lorg_kde_qt_QSize_2_3C(JNIEnv *env, jobject obj, jobject arg1, jcharArray bits)
{
static QByteArray * _qbytearray_bits = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((QSize&) *(QSize *) QtSupport::getQt(env, arg1), (uchar*) QtSupport::toUcharArray(env, bits, &_qbytearray_bits), FALSE));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Lorg_kde_qt_QPixmap_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QBitmap temp;
		temp = (QPixmap&) *(QPixmap *) QtSupport::getQt(env, arg1);
		QtSupport::setQt(env, obj, new QBitmapJBridge(temp));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Lorg_kde_qt_QImage_2(JNIEnv *env, jobject obj, jobject arg1)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QBitmap temp;
		temp = (QImage&) *(QImage *) QtSupport::getQt(env, arg1);
		QtSupport::setQt(env, obj, new QBitmapJBridge(temp));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, jobject obj, jstring fileName, jstring format)
{
static QCString * _qstring_format = 0;
static QString * _qstring_fileName = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBitmapJBridge((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), (char*) QtSupport::toCharString(env, format, &_qstring_format)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBitmap_newQBitmap__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 QBitmapJBridge((QString&) * (QString *) QtSupport::toQString(env, fileName, &_qstring_fileName), 0));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

//JNIEXPORT jobject JNICALL
//Java_org_kde_qt_QBitmap_xForm(JNIEnv *env, jobject obj, jobject arg1)
//{
//	return (jobject) QtSupport::objectForQtKey(env, (void *)new QBitmap (((QBitmapJBridge*) QtSupport::getQt(env, obj))->xForm((QWMatrix&) *(QWMatrix *) QtSupport::getQt(env, arg1))), "org.kde.qt.QBitmap", TRUE);
//}

