//Auto-generated by kalyptus. DO NOT EDIT.
#include <qrect.h>
#include <qwmatrix.h>
#include <qpoint.h>
#include <qpointarray.h>

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

class QPointArrayJBridge : public QPointArray
{
public:
	QPointArrayJBridge() : QPointArray() {};
	QPointArrayJBridge(int arg1) : QPointArray(arg1) {};
	QPointArrayJBridge(const QPointArray& arg1) : QPointArray(arg1) {};
	QPointArrayJBridge(const QRect& arg1,bool arg2) : QPointArray(arg1,arg2) {};
	QPointArrayJBridge(const QRect& arg1) : QPointArray(arg1) {};
	QPointArrayJBridge(int arg1,const QCOORD* arg2) : QPointArray(arg1,arg2) {};
	~QPointArrayJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPointArray_boundingRect(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new QRect(((QPointArray*) QtSupport::getQt(env, obj))->boundingRect()), "org.kde.qt.QRect", TRUE);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_cleanBuffers(JNIEnv* env, jclass cls)
{
	(void) cls;
	(void) env;
	QPointArrayJBridge::cleanBuffers();
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPointArray_copy(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new QPointArray(((QPointArray*) QtSupport::getQt(env, obj))->copy()), "org.kde.qt.QPointArray", TRUE);
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPointArray_cubicBezier(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new QPointArray(((QPointArray*) QtSupport::getQt(env, obj))->cubicBezier()), "org.kde.qt.QPointArray", TRUE);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_qt_QPointArray_finalize(env, obj);
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_makeArc__IIIIII(JNIEnv* env, jobject obj, jint x, jint y, jint w, jint h, jint a1, jint a2)
{
	((QPointArray*) QtSupport::getQt(env, obj))->makeArc((int) x, (int) y, (int) w, (int) h, (int) a1, (int) a2);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_makeArc__IIIIIILorg_kde_qt_QWMatrix_2(JNIEnv* env, jobject obj, jint x, jint y, jint w, jint h, jint a1, jint a2, jobject arg7)
{
	((QPointArray*) QtSupport::getQt(env, obj))->makeArc((int) x, (int) y, (int) w, (int) h, (int) a1, (int) a2, (const QWMatrix&)*(const QWMatrix*) QtSupport::getQt(env, arg7));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_makeEllipse(JNIEnv* env, jobject obj, jint x, jint y, jint w, jint h)
{
	((QPointArray*) QtSupport::getQt(env, obj))->makeEllipse((int) x, (int) y, (int) w, (int) h);
	return;
}

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_newQPointArray__I_3S(JNIEnv* env, jobject obj, jint nPoints, jshortArray points)
{
	short* _short_points = QtSupport::toShortPtr(env, points);
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPointArrayJBridge((int) nPoints,  (const QCOORD*) _short_points));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	env->SetShortArrayRegion(points, 0, 1, (jshort*) _short_points);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_newQPointArray__Lorg_kde_qt_QPointArray_2(JNIEnv* env, jobject obj, jobject a)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPointArrayJBridge((const QPointArray&)*(const QPointArray*) QtSupport::getQt(env, a)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_newQPointArray__Lorg_kde_qt_QRect_2(JNIEnv* env, jobject obj, jobject r)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPointArrayJBridge((const QRect&)*(const QRect*) QtSupport::getQt(env, r)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_newQPointArray__Lorg_kde_qt_QRect_2Z(JNIEnv* env, jobject obj, jobject r, jboolean closed)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QPointArrayJBridge((const QRect&)*(const QRect*) QtSupport::getQt(env, r), (bool) closed));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPointArray_point__I(JNIEnv* env, jobject obj, jint i)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new QPoint(((QPointArray*) QtSupport::getQt(env, obj))->point((uint) i)), "org.kde.qt.QPoint", TRUE);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_putPoints__IILorg_kde_qt_QPointArray_2(JNIEnv* env, jobject obj, jint index, jint nPoints, jobject from)
{
	jboolean xret = (jboolean) ((QPointArray*) QtSupport::getQt(env, obj))->putPoints((int) index, (int) nPoints, (const QPointArray&)*(const QPointArray*) QtSupport::getQt(env, from));
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_putPoints__IILorg_kde_qt_QPointArray_2I(JNIEnv* env, jobject obj, jint index, jint nPoints, jobject from, jint fromIndex)
{
	jboolean xret = (jboolean) ((QPointArray*) QtSupport::getQt(env, obj))->putPoints((int) index, (int) nPoints, (const QPointArray&)*(const QPointArray*) QtSupport::getQt(env, from), (int) fromIndex);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_setPoint__III(JNIEnv* env, jobject obj, jint i, jint x, jint y)
{
	((QPointArray*) QtSupport::getQt(env, obj))->setPoint((uint) i, (int) x, (int) y);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_setPoint__ILorg_kde_qt_QPoint_2(JNIEnv* env, jobject obj, jint i, jobject p)
{
	((QPointArray*) QtSupport::getQt(env, obj))->setPoint((uint) i, (const QPoint&)*(const QPoint*) QtSupport::getQt(env, p));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_translate(JNIEnv* env, jobject obj, jint dx, jint dy)
{
	((QPointArray*) QtSupport::getQt(env, obj))->translate((int) dx, (int) dy);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QPointArray_point__I_3I_3I(JNIEnv *env, jobject obj, jint i, jintArray x, jintArray y)
{
	int argx;
	int argy;
	((QPointArrayJBridge*) QtSupport::getQt(env, obj))->point((uint) i,  &argx,  &argy);
	env->SetIntArrayRegion(x, 0, 1, (jint *) &argx);
	env->SetIntArrayRegion(y, 0, 1, (jint *) &argy);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_setPoints(JNIEnv *env, jobject obj, jint nPoints, jshortArray points)
{
	if (!((QPointArrayJBridge*) QtSupport::getQt(env, obj))->resize((uint)nPoints)) {
		return JNI_FALSE;
	}

	short *	shortArray = QtSupport::toShortPtr(env, points);
	for (int index = 0; index < nPoints; index++) {
		((QPointArrayJBridge*) QtSupport::getQt(env, obj))->setPoint(index, shortArray[index * 2], shortArray[(index * 2) + 1]);
	}
	return JNI_TRUE;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_putPoints__II_3S(JNIEnv *env, jobject obj, jint index, jint nPoints, jshortArray points)
{
	if (	((QPointArrayJBridge*) QtSupport::getQt(env, obj))->size() < (uint) nPoints
			&& !((QPointArrayJBridge*) QtSupport::getQt(env, obj))->resize((uint) nPoints) )
	{
		return JNI_FALSE;
	}

	short *	shortArray = QtSupport::toShortPtr(env, points);
	for (int i = (int) index; nPoints > 0; i++, nPoints--) {
		((QPointArrayJBridge*) QtSupport::getQt(env, obj))->setPoint(i, shortArray[i * 2], shortArray[(i * 2) + 1]);
	}
	return JNI_TRUE;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QPointArray_size(JNIEnv* env, jobject obj)
{
	return (jint) ((QPointArrayJBridge*) QtSupport::getQt(env, obj))->size();
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_isEmpty(JNIEnv* env, jobject obj)
{
	return (jboolean) ((QPointArrayJBridge*) QtSupport::getQt(env, obj))->isEmpty();
}

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

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_resize(JNIEnv* env, jobject obj, jint size)
{
	return (jboolean) ((QPointArrayJBridge*) QtSupport::getQt(env, obj))->resize((uint) size);
}
JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QPointArray_truncate(JNIEnv *env, jobject obj, jint pos)
{
	return (jboolean) ((QPointArrayJBridge*) QtSupport::getQt(env, obj))->truncate((uint) pos);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QPointArray_at(JNIEnv * env, jobject obj, jint index)
{
	QPoint _p= ((QPointArrayJBridge*) QtSupport::getQt(env, obj))->at((uint) index);
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPoint(_p.x(),_p.y()), "org.kde.qt.QPoint", TRUE);
}
	
