//Auto-generated by kalyptus. DO NOT EDIT.
#include <tqstrlist.h>
#include <tqasyncimageio.h>
#include <tqimage.h>

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

class TQImageDecoderJBridge : public TQImageDecoder
{
public:
	TQImageDecoderJBridge(TQImageConsumer* arg1) : TQImageDecoder(arg1) {};
	~TQImageDecoderJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jint JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_decode(JNIEnv* env, jobject obj, jcharArray buffer, jint length)
{
static TQByteArray* _qbytearray_buffer = 0;
	jint xret = (jint) ((TQImageDecoder*) QtSupport::getQt(env, obj))->decode((const uchar*) QtSupport::toUcharArray(env, buffer, &_qbytearray_buffer), (int) length);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_dispose(JNIEnv* env, jobject obj)
{
	Java_org_trinitydesktop_qt_QImageDecoder_finalize(env, obj);
	return;
}

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

JNIEXPORT jstring JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_formatName(JNIEnv* env, jclass cls, jcharArray buffer, jint length)
{
	const char* _qstring;
	(void) cls;
static TQByteArray* _qbytearray_buffer = 0;
	_qstring = TQImageDecoderJBridge::formatName((const uchar*) QtSupport::toUcharArray(env, buffer, &_qbytearray_buffer), (int) length);
	return QtSupport::fromCharString(env, (char *) _qstring);
}

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_format(JNIEnv* env, jclass cls, jstring name)
{
	(void) cls;
static TQCString* _qstring_name = 0;
	jobject xret = QtSupport::objectForQtKey(env, (void*)TQImageDecoderJBridge::format((const char*) QtSupport::toCharString(env, name, &_qstring_name)), "org.trinitydesktop.qt.TQImageFormatType");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_image(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)(TQImage *) &((TQImageDecoder*) QtSupport::getQt(env, obj))->image(), "org.trinitydesktop.qt.TQImage");
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_inputFormats(JNIEnv* env, jclass cls)
{
	TQStrList  _qlist;
	(void) cls;
	_qlist = TQImageDecoderJBridge::inputFormats();
	return (jobject) QtSupport::arrayWithTQStrList(env, (TQStrList*) &_qlist);
}

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

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_registerDecoderFactory(JNIEnv* env, jclass cls, jobject arg1)
{
	(void) cls;
	TQImageDecoderJBridge::registerDecoderFactory((TQImageFormatType*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QImageDecoder_unregisterDecoderFactory(JNIEnv* env, jclass cls, jobject arg1)
{
	(void) cls;
	TQImageDecoderJBridge::unregisterDecoderFactory((TQImageFormatType*) QtSupport::getQt(env, arg1));
	return;
}

