/***************************************************************************
                            QCanvasItem.cpp -  description
                             -------------------
    begin                : Sun Feb 10 08:33:44 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Feb 10 08:33:44 2002, 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/QCanvasItem.h>

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_dispose(JNIEnv *env, jobject obj)
{
	Java_org_kde_qt_QCanvasItem_finalize(env, obj);
	return;
}

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

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QCanvasItem_x(JNIEnv *env, jobject obj)
{
	return (jdouble) ((QCanvasItem*) QtSupport::getQt(env, obj))->x();
}

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QCanvasItem_y(JNIEnv *env, jobject obj)
{
	return (jdouble) ((QCanvasItem*) QtSupport::getQt(env, obj))->y();
}

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QCanvasItem_z(JNIEnv *env, jobject obj)
{
	return (jdouble) ((QCanvasItem*) QtSupport::getQt(env, obj))->z();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_moveBy(JNIEnv *env, jobject obj, jdouble dx, jdouble dy)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->moveBy((double) dx, (double) dy);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_move(JNIEnv *env, jobject obj, jdouble x, jdouble y)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->move((double) x, (double) y);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setX(JNIEnv *env, jobject obj, jdouble a)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setX((double) a);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setY(JNIEnv *env, jobject obj, jdouble a)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setY((double) a);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setZ(JNIEnv *env, jobject obj, jdouble a)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setZ((double) a);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_animated(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->animated();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setAnimated(JNIEnv *env, jobject obj, jboolean y)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setAnimated((bool) y);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setVelocity(JNIEnv *env, jobject obj, jdouble vx, jdouble vy)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setVelocity((double) vx, (double) vy);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setXVelocity(JNIEnv *env, jobject obj, jdouble vx)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setXVelocity((double) vx);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setYVelocity(JNIEnv *env, jobject obj, jdouble vy)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setYVelocity((double) vy);
	return;
}

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QCanvasItem_xVelocity(JNIEnv *env, jobject obj)
{
	return (jdouble) ((QCanvasItem*) QtSupport::getQt(env, obj))->xVelocity();
}

JNIEXPORT jdouble JNICALL
Java_org_kde_qt_QCanvasItem_yVelocity(JNIEnv *env, jobject obj)
{
	return (jdouble) ((QCanvasItem*) QtSupport::getQt(env, obj))->yVelocity();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_advance(JNIEnv *env, jobject obj, jint stage)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->advance((int) stage);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_collidesWith(JNIEnv *env, jobject obj, jobject arg1)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->collidesWith((QCanvasItem*) QtSupport::getQt(env, arg1));
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasItem_collisions(JNIEnv *env, jobject obj, jboolean exact)
{
	QCanvasItemList  _qlist;
	_qlist = ((QCanvasItem*) QtSupport::getQt(env, obj))->collisions((bool) exact);
	return (jobject) QtSupport::arrayWithQCanvasItemList(env, (QCanvasItemList *) &_qlist);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setCanvas(JNIEnv *env, jobject obj, jobject arg1)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setCanvas((QCanvas*) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_draw(JNIEnv *env, jobject obj, jobject arg1)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->draw((QPainter&) *(QPainter *) QtSupport::getQt(env, arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_show(JNIEnv *env, jobject obj)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->show();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_hide(JNIEnv *env, jobject obj)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->hide();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setVisible(JNIEnv *env, jobject obj, jboolean yes)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setVisible((bool) yes);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_isVisible(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->isVisible();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setSelected(JNIEnv *env, jobject obj, jboolean yes)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setSelected((bool) yes);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_isSelected(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->isSelected();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setEnabled(JNIEnv *env, jobject obj, jboolean yes)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setEnabled((bool) yes);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_isEnabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->isEnabled();
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasItem_setActive(JNIEnv *env, jobject obj, jboolean yes)
{
	((QCanvasItem*) QtSupport::getQt(env, obj))->setActive((bool) yes);
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_isActive(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->isActive();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_visible(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->visible();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_selected(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->selected();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_enabled(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->enabled();
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QCanvasItem_active(JNIEnv *env, jobject obj)
{
	return (jboolean) ((QCanvasItem*) QtSupport::getQt(env, obj))->active();
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QCanvasItem_rtti(JNIEnv *env, jobject obj)
{
	return (jint) ((QCanvasItem*) QtSupport::getQt(env, obj))->rtti();
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasItem_boundingRect(JNIEnv *env, jobject obj)
{
	QRect _r= ((QCanvasItem*) QtSupport::getQt(env, obj))->boundingRect();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasItem_boundingRectAdvanced(JNIEnv *env, jobject obj)
{
	QRect _r= ((QCanvasItem*) QtSupport::getQt(env, obj))->boundingRectAdvanced();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QRect(_r.left(),_r.top(),_r.width(),_r.height()), "org.kde.qt.QRect", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasItem_canvas(JNIEnv *env, jobject obj)
{
	return (jobject) QtSupport::objectForQtKey(env, (void *)((QCanvasItem*) QtSupport::getQt(env, obj))->canvas(), "org.kde.qt.QCanvas");
}

