/***************************************************************************
                            QCanvasItem.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 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 12:08:37 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <qtc/qt_QCanvasItem.h>
#include <qtobjc/QCanvasItem.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QCanvas.h>

@implementation  QCanvasItem


- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			qt_del_QCanvasItem((qt_QCanvasItem *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (double) x
{
	return (double) qt_QCanvasItem_x((qt_QCanvasItem *)[self qt]);
}

- (double) y
{
	return (double) qt_QCanvasItem_y((qt_QCanvasItem *)[self qt]);
}

- (double) z
{
	return (double) qt_QCanvasItem_z((qt_QCanvasItem *)[self qt]);
}

- moveBy: (double)dx dy: (double)dy
{
	qt_QCanvasItem_moveBy((qt_QCanvasItem *)[self qt], (double)dx, (double)dy);
	return self;
}

- move: (double)x y: (double)y
{
	qt_QCanvasItem_move((qt_QCanvasItem *)[self qt], (double)x, (double)y);
	return self;
}

- setX: (double)a
{
	qt_QCanvasItem_setX((qt_QCanvasItem *)[self qt], (double)a);
	return self;
}

- setY: (double)a
{
	qt_QCanvasItem_setY((qt_QCanvasItem *)[self qt], (double)a);
	return self;
}

- setZ: (double)a
{
	qt_QCanvasItem_setZ((qt_QCanvasItem *)[self qt], (double)a);
	return self;
}

- (BOOL) animated
{
	return (BOOL) qt_QCanvasItem_animated((qt_QCanvasItem *)[self qt]);
}

- setAnimated: (BOOL)y
{
	qt_QCanvasItem_setAnimated((qt_QCanvasItem *)[self qt], (int)y);
	return self;
}

- setVelocity: (double)vx vy: (double)vy
{
	qt_QCanvasItem_setVelocity((qt_QCanvasItem *)[self qt], (double)vx, (double)vy);
	return self;
}

- setXVelocity: (double)vx
{
	qt_QCanvasItem_setXVelocity((qt_QCanvasItem *)[self qt], (double)vx);
	return self;
}

- setYVelocity: (double)vy
{
	qt_QCanvasItem_setYVelocity((qt_QCanvasItem *)[self qt], (double)vy);
	return self;
}

- (double) xVelocity
{
	return (double) qt_QCanvasItem_xVelocity((qt_QCanvasItem *)[self qt]);
}

- (double) yVelocity
{
	return (double) qt_QCanvasItem_yVelocity((qt_QCanvasItem *)[self qt]);
}

- advance: (int)stage
{
	qt_QCanvasItem_advance((qt_QCanvasItem *)[self qt], (int)stage);
	return self;
}

- (BOOL) collidesWith: (QCanvasItem*)arg1
{
	return (BOOL) qt_QCanvasItem_collidesWith((qt_QCanvasItem *)[self qt], (qt_QCanvasItem*) [arg1 qt]);
}

//- (QCanvasItemList*) collisions: (BOOL)exact
//{
//	return (QCanvasItemList*) [QtSupport objectForQtKey: qt_QCanvasItem_collisions((qt_QCanvasItem *)[self qt], (int)exact) withClass: [QCanvasItemList class] allocatedInObjcWorld: YES];
//}

- setCanvas: (QCanvas*)arg1
{
	qt_QCanvasItem_setCanvas((qt_QCanvasItem *)[self qt], (qt_QCanvas*) [arg1 qt]);
	return self;
}

- draw: (QPainter*)arg1
{
	qt_QCanvasItem_draw((qt_QCanvasItem *)[self qt], (qt_QPainter*) [arg1 qt]);
	return self;
}

- show
{
	qt_QCanvasItem_show((qt_QCanvasItem *)[self qt]);
	return self;
}

- hide
{
	qt_QCanvasItem_hide((qt_QCanvasItem *)[self qt]);
	return self;
}

- setVisible: (BOOL)yes
{
	qt_QCanvasItem_setVisible((qt_QCanvasItem *)[self qt], (int)yes);
	return self;
}

- (BOOL) isVisible
{
	return (BOOL) qt_QCanvasItem_isVisible((qt_QCanvasItem *)[self qt]);
}

- setSelected: (BOOL)yes
{
	qt_QCanvasItem_setSelected((qt_QCanvasItem *)[self qt], (int)yes);
	return self;
}

- (BOOL) isSelected
{
	return (BOOL) qt_QCanvasItem_isSelected((qt_QCanvasItem *)[self qt]);
}

- setEnabled: (BOOL)yes
{
	qt_QCanvasItem_setEnabled((qt_QCanvasItem *)[self qt], (int)yes);
	return self;
}

- (BOOL) isEnabled
{
	return (BOOL) qt_QCanvasItem_isEnabled((qt_QCanvasItem *)[self qt]);
}

- setActive: (BOOL)yes
{
	qt_QCanvasItem_setActive((qt_QCanvasItem *)[self qt], (int)yes);
	return self;
}

- (BOOL) isActive
{
	return (BOOL) qt_QCanvasItem_isActive((qt_QCanvasItem *)[self qt]);
}

- (BOOL) visible
{
	return (BOOL) qt_QCanvasItem_visible((qt_QCanvasItem *)[self qt]);
}

- (BOOL) selected
{
	return (BOOL) qt_QCanvasItem_selected((qt_QCanvasItem *)[self qt]);
}

- (BOOL) enabled
{
	return (BOOL) qt_QCanvasItem_enabled((qt_QCanvasItem *)[self qt]);
}

- (BOOL) active
{
	return (BOOL) qt_QCanvasItem_active((qt_QCanvasItem *)[self qt]);
}

- (int) rtti
{
	return (int) qt_QCanvasItem_rtti((qt_QCanvasItem *)[self qt]);
}

- (QRect*) boundingRect
{
	return (QRect*) [QtSupport objectForQtKey: qt_QCanvasItem_boundingRect((qt_QCanvasItem *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QRect*) boundingRectAdvanced
{
	return (QRect*) [QtSupport objectForQtKey: qt_QCanvasItem_boundingRectAdvanced((qt_QCanvasItem *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QCanvas*) canvas
{
	return (QCanvas*) [QtSupport objectForQtKey: qt_QCanvasItem_canvas((qt_QCanvasItem *)[self qt]) withClass: [QCanvas class] allocatedInObjcWorld: YES];
}

+ (int) Rtti_Item
{
	return (int) QCANVASITEM_Rtti_Item;
}

+ (int) Rtti_Sprite
{
	return (int) QCANVASITEM_Rtti_Sprite;
}

+ (int) Rtti_PolygonalItem
{
	return (int) QCANVASITEM_Rtti_PolygonalItem;
}

+ (int) Rtti_Text
{
	return (int) QCANVASITEM_Rtti_Text;
}

+ (int) Rtti_Polygon
{
	return (int) QCANVASITEM_Rtti_Polygon;
}

+ (int) Rtti_Rectangle
{
	return (int) QCANVASITEM_Rtti_Rectangle;
}

+ (int) Rtti_Ellipse
{
	return (int) QCANVASITEM_Rtti_Ellipse;
}

+ (int) Rtti_Line
{
	return (int) QCANVASITEM_Rtti_Line;
}

+ (int) Rtti_Spline
{
	return (int) QCANVASITEM_Rtti_Spline;
}

@end
