//Auto-generated by kalyptus. DO NOT EDIT.
#include <tqrect.h>
#include <tqwmatrix.h>
#include <tqpoint.h>
#include <tqpointarray.h>

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

class TQPointArrayJBridge : public TQPointArray
{
public:
	TQPointArrayJBridge() : TQPointArray() {};
	TQPointArrayJBridge(int arg1) : TQPointArray(arg1) {};
	TQPointArrayJBridge(const TQPointArray& arg1) : TQPointArray(arg1) {};
	TQPointArrayJBridge(const TQRect& arg1,bool arg2) : TQPointArray(arg1,arg2) {};
	TQPointArrayJBridge(const TQRect& arg1) : TQPointArray(arg1) {};
	TQPointArrayJBridge(int arg1,const TQCOORD* arg2) : TQPointArray(arg1,arg2) {};
	~TQPointArrayJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QPointArray_boundingRect(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new TQRect(((TQPointArray*) QtSupport::getQt(env, obj))->boundingRect()), "org.trinitydesktop.qt.TQRect", true);
	return xret;
}

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

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QPointArray_copy(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new TQPointArray(((TQPointArray*) QtSupport::getQt(env, obj))->copy()), "org.trinitydesktop.qt.TQPointArray", true);
	return xret;
}

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QPointArray_cubicBezier(JNIEnv* env, jobject obj)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new TQPointArray(((TQPointArray*) QtSupport::getQt(env, obj))->cubicBezier()), "org.trinitydesktop.qt.TQPointArray", true);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QPointArray_dispose(JNIEnv* env, jobject obj)
{
	Java_org_trinitydesktop_qt_QPointArray_finalize(env, obj);
	return;
}

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

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

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

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

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

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

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QPointArray_newTQPointArray__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 TQPointArrayJBridge((int) nPoints,  (const TQCOORD*) _short_points));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	env->SetShortArrayRegion(points, 0, 1, (jshort*) _short_points);
	}
	return;
}

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

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

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

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QPointArray_point__I(JNIEnv* env, jobject obj, jint i)
{
	jobject xret = QtSupport::objectForQtKey(env, (void*)new TQPoint(((TQPointArray*) QtSupport::getQt(env, obj))->point((uint) i)), "org.trinitydesktop.qt.TQPoint", true);
	return xret;
}

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

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

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

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

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

JNIEXPORT void JNICALL
Java_org_trinitydesktop_qt_QPointArray_point__I_3I_3I(JNIEnv *env, jobject obj, jint i, jintArray x, jintArray y)
{
	int argx;
	int argy;
	((TQPointArrayJBridge*) 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_trinitydesktop_qt_QPointArray_setPoints(JNIEnv *env, jobject obj, jint nPoints, jshortArray points)
{
	if (!((TQPointArrayJBridge*) QtSupport::getQt(env, obj))->resize((uint)nPoints)) {
		return JNI_FALSE;
	}

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

JNIEXPORT jboolean JNICALL
Java_org_trinitydesktop_qt_QPointArray_putPoints__II_3S(JNIEnv *env, jobject obj, jint index, jint nPoints, jshortArray points)
{
	if (	((TQPointArrayJBridge*) QtSupport::getQt(env, obj))->size() < (uint) nPoints
			&& !((TQPointArrayJBridge*) 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--) {
		((TQPointArrayJBridge*) QtSupport::getQt(env, obj))->setPoint(i, shortArray[i * 2], shortArray[(i * 2) + 1]);
	}
	return JNI_TRUE;
}

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

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

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

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

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

JNIEXPORT jobject JNICALL
Java_org_trinitydesktop_qt_QPointArray_at(JNIEnv * env, jobject obj, jint index)
{
	TQPoint _p= ((TQPointArrayJBridge*) QtSupport::getQt(env, obj))->at((uint) index);
	return (jobject) QtSupport::objectForQtKey(env, (void *)new TQPoint(_p.x(),_p.y()), "org.trinitydesktop.qt.TQPoint", true);
}
	
