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

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

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

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

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPolygonalItem_setPen(JNIEnv *env, jobject obj, jobject p)
{
	((QCanvasPolygonalItem*) QtSupport::getQt(env, obj))->setPen((QPen) *(QPen *) QtSupport::getQt(env, p));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QCanvasPolygonalItem_setBrush(JNIEnv *env, jobject obj, jobject b)
{
	((QCanvasPolygonalItem*) QtSupport::getQt(env, obj))->setBrush((QBrush) *(QBrush *) QtSupport::getQt(env, b));
	return;
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasPolygonalItem_pen(JNIEnv *env, jobject obj)
{
	QPen _b= ((QCanvasPolygonalItem*) QtSupport::getQt(env, obj))->pen();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QPen(_b.color(),_b.width(),_b.style()), "org.kde.qt.QPen", TRUE);
}

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasPolygonalItem_brush(JNIEnv *env, jobject obj)
{
	QBrush _b= ((QCanvasPolygonalItem*) QtSupport::getQt(env, obj))->brush();
	return (jobject) QtSupport::objectForQtKey(env, (void *)new QBrush(_b.color(),_b.style()), "org.kde.qt.QBrush", TRUE);
}

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

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

JNIEXPORT jobject JNICALL
Java_org_kde_qt_QCanvasPolygonalItem_boundingRect(JNIEnv *env, jobject obj)
{
	QRect _r= ((QCanvasPolygonalItem*) 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 jint JNICALL
Java_org_kde_qt_QCanvasPolygonalItem_rtti(JNIEnv *env, jobject obj)
{
	return (jint) ((QCanvasPolygonalItem*) QtSupport::getQt(env, obj))->rtti();
}

