/***************************************************************************
                            qt_QCanvas.cpp -  description
                             -------------------
    begin                : Tue Nov 20 20:51:20 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Tue Nov 20 20:51:20 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.                       *
 *                                                                         *
 ***************************************************************************/

extern "C" {
#include "qt_QCanvas.h"
}

#include <qcanvas.h>

class QCanvasBridge : public QCanvas
{
public:
	QCanvasBridge(QObject* parent, const char* name) : QCanvas(parent, name) {}
	QCanvasBridge(int w, int h) : QCanvas(w, h) {}
	QCanvasBridge(QPixmap p, int h, int v, int tilewidth, int tileheight) : QCanvas(p, h, v, tilewidth, tileheight) {}
	~QCanvasBridge() {}
	void protected_drawBackground(QPainter& arg1, const QRect& area) {
		QCanvas::drawBackground(arg1, area);
		return;
	}
	void protected_drawForeground(QPainter& arg1, const QRect& area) {
		QCanvas::drawForeground(arg1, area);
		return;
	}
	void childEvent(QChildEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "childEvent", arg1, "QChildEvent")) {
			QObject::childEvent(arg1);
		}
		return;
	}
	void customEvent(QCustomEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "customEvent", arg1, "QCustomEvent")) {
			QObject::customEvent(arg1);
		}
		return;
	}
	void timerEvent(QTimerEvent* arg1) {
		if (Qt_EventDelegate == 0L || !(*Qt_EventDelegate)(this, "timerEvent", arg1, "QTimerEvent")) {
			QObject::timerEvent(arg1);
		}
		return;
	}
};

qt_QCanvas * qt_new_QCanvas(qt_QObject * parent, char* name){
	return (qt_QCanvas *) new QCanvasBridge((QObject*)parent, (char*)name);
}
qt_QCanvas * qt_new_QCanvas1(int w, int h){
	return (qt_QCanvas *) new QCanvasBridge((int)w, (int)h);
}
qt_QCanvas * qt_new_QCanvas2(qt_QPixmap * p, int h, int v, int tilewidth, int tileheight){
	return (qt_QCanvas *) new QCanvasBridge((QPixmap)* (QPixmap*)p, (int)h, (int)v, (int)tilewidth, (int)tileheight);
}
void qt_del_QCanvas( qt_QCanvas* p ){
	delete (QCanvasBridge*) p;
}
void qt_QCanvas_setTiles( qt_QCanvas* instPointer,qt_QPixmap * tiles, int h, int v, int tilewidth, int tileheight){
	((QCanvasBridge*)instPointer)->setTiles((QPixmap)* (QPixmap*)tiles, (int)h, (int)v, (int)tilewidth, (int)tileheight);
	return;
}
void qt_QCanvas_setBackgroundPixmap( qt_QCanvas* instPointer,qt_QPixmap * p){
	((QCanvasBridge*)instPointer)->setBackgroundPixmap((QPixmap&)* (QPixmap*)p);
	return;
}
qt_QPixmap * qt_QCanvas_backgroundPixmap( qt_QCanvas* instPointer){
	return (qt_QPixmap *)new QPixmap(((QCanvasBridge*)instPointer)->backgroundPixmap());
}
void qt_QCanvas_setBackgroundColor( qt_QCanvas* instPointer,qt_QColor * c){
	((QCanvasBridge*)instPointer)->setBackgroundColor((QColor&)* (QColor*)c);
	return;
}
qt_QColor * qt_QCanvas_backgroundColor( qt_QCanvas* instPointer){
	return (qt_QColor *)new QColor(((QCanvasBridge*)instPointer)->backgroundColor());
}
void qt_QCanvas_setTile( qt_QCanvas* instPointer,int x, int y, int tilenum){
	((QCanvasBridge*)instPointer)->setTile((int)x, (int)y, (int)tilenum);
	return;
}
int qt_QCanvas_tile( qt_QCanvas* instPointer,int x, int y){
	return (int) ((QCanvasBridge*)instPointer)->tile((int)x, (int)y);
}
int qt_QCanvas_tilesHorizontally( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->tilesHorizontally();
}
int qt_QCanvas_tilesVertically( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->tilesVertically();
}
int qt_QCanvas_tileWidth( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->tileWidth();
}
int qt_QCanvas_tileHeight( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->tileHeight();
}
void qt_QCanvas_resize( qt_QCanvas* instPointer,int width, int height){
	((QCanvasBridge*)instPointer)->resize((int)width, (int)height);
	return;
}
int qt_QCanvas_width( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->width();
}
int qt_QCanvas_height( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->height();
}
qt_QSize * qt_QCanvas_size( qt_QCanvas* instPointer){
	QSize _s= ((QCanvasBridge*)instPointer)->size();
	return (qt_QSize *)new QSize(_s.width(),_s.height());
}
qt_QRect* qt_QCanvas_rect( qt_QCanvas* instPointer){
	QRect _r= ((QCanvasBridge*)instPointer)->rect();
	return (qt_QRect*)new QRect(_r.left(),_r.top(),_r.width(),_r.height());
}
int qt_QCanvas_onCanvas( qt_QCanvas* instPointer,int x, int y){
	return (int) ((QCanvasBridge*)instPointer)->onCanvas((int)x, (int)y);
}
int qt_QCanvas_onCanvas1( qt_QCanvas* instPointer,qt_QPoint* p){
	return (int) ((QCanvasBridge*)instPointer)->onCanvas((QPoint&)* (QPoint*)p);
}
int qt_QCanvas_validChunk( qt_QCanvas* instPointer,int x, int y){
	return (int) ((QCanvasBridge*)instPointer)->validChunk((int)x, (int)y);
}
int qt_QCanvas_validChunk1( qt_QCanvas* instPointer,qt_QPoint* p){
	return (int) ((QCanvasBridge*)instPointer)->validChunk((QPoint&)* (QPoint*)p);
}
int qt_QCanvas_chunkSize( qt_QCanvas* instPointer){
	return (int) ((QCanvasBridge*)instPointer)->chunkSize();
}
void qt_QCanvas_retune( qt_QCanvas* instPointer,int chunksize, int maxclusters){
	((QCanvasBridge*)instPointer)->retune((int)chunksize, (int)maxclusters);
	return;
}
int qt_QCanvas_sameChunk( qt_QCanvas* instPointer,int x1, int y1, int x2, int y2){
	return (int) ((QCanvasBridge*)instPointer)->sameChunk((int)x1, (int)y1, (int)x2, (int)y2);
}
void qt_QCanvas_setChangedChunk( qt_QCanvas* instPointer,int i, int j){
	((QCanvasBridge*)instPointer)->setChangedChunk((int)i, (int)j);
	return;
}
void qt_QCanvas_setChangedChunkContaining( qt_QCanvas* instPointer,int x, int y){
	((QCanvasBridge*)instPointer)->setChangedChunkContaining((int)x, (int)y);
	return;
}
void qt_QCanvas_setAllChanged( qt_QCanvas* instPointer){
	((QCanvasBridge*)instPointer)->setAllChanged();
	return;
}
void qt_QCanvas_setChanged( qt_QCanvas* instPointer,qt_QRect* area){
	((QCanvasBridge*)instPointer)->setChanged((QRect&)* (QRect*)area);
	return;
}
void qt_QCanvas_setUnchanged( qt_QCanvas* instPointer,qt_QRect* area){
	((QCanvasBridge*)instPointer)->setUnchanged((QRect&)* (QRect*)area);
	return;
}
void qt_QCanvas_addItemToChunk( qt_QCanvas* instPointer,qt_QCanvasItem* arg1, int i, int j){
	((QCanvasBridge*)instPointer)->addItemToChunk((QCanvasItem*)arg1, (int)i, (int)j);
	return;
}
void qt_QCanvas_removeItemFromChunk( qt_QCanvas* instPointer,qt_QCanvasItem* arg1, int i, int j){
	((QCanvasBridge*)instPointer)->removeItemFromChunk((QCanvasItem*)arg1, (int)i, (int)j);
	return;
}
void qt_QCanvas_addItemToChunkContaining( qt_QCanvas* instPointer,qt_QCanvasItem* arg1, int x, int y){
	((QCanvasBridge*)instPointer)->addItemToChunkContaining((QCanvasItem*)arg1, (int)x, (int)y);
	return;
}
void qt_QCanvas_removeItemFromChunkContaining( qt_QCanvas* instPointer,qt_QCanvasItem* arg1, int x, int y){
	((QCanvasBridge*)instPointer)->removeItemFromChunkContaining((QCanvasItem*)arg1, (int)x, (int)y);
	return;
}
qt_QCanvasItemList* qt_QCanvas_allItems( qt_QCanvas* instPointer){
	return (qt_QCanvasItemList*)new QCanvasItemList(((QCanvasBridge*)instPointer)->allItems());
}
qt_QCanvasItemList* qt_QCanvas_collisions( qt_QCanvas* instPointer,qt_QPoint* arg1){
	return (qt_QCanvasItemList*)new QCanvasItemList(((QCanvasBridge*)instPointer)->collisions((QPoint&)* (QPoint*)arg1));
}
qt_QCanvasItemList* qt_QCanvas_collisions1( qt_QCanvas* instPointer,qt_QRect* arg1){
	return (qt_QCanvasItemList*)new QCanvasItemList(((QCanvasBridge*)instPointer)->collisions((QRect&)* (QRect*)arg1));
}
qt_QCanvasItemList* qt_QCanvas_collisions2( qt_QCanvas* instPointer,qt_QPointArray* pa, qt_QCanvasItem* item, int exact){
	return (qt_QCanvasItemList*)new QCanvasItemList(((QCanvasBridge*)instPointer)->collisions((QPointArray&)* (QPointArray*)pa, (QCanvasItem*)item, (bool)exact));
}
void qt_QCanvas_drawArea( qt_QCanvas* instPointer,qt_QRect* arg1, qt_QPainter * p, int double_buffer){
	((QCanvasBridge*)instPointer)->drawArea((QRect&)* (QRect*)arg1, (QPainter*)p, (bool)double_buffer);
	return;
}
void qt_QCanvas_addView( qt_QCanvas* instPointer,qt_QCanvasView* arg1){
	((QCanvasBridge*)instPointer)->addView((QCanvasView*)arg1);
	return;
}
void qt_QCanvas_removeView( qt_QCanvas* instPointer,qt_QCanvasView* arg1){
	((QCanvasBridge*)instPointer)->removeView((QCanvasView*)arg1);
	return;
}
void qt_QCanvas_drawCanvasArea( qt_QCanvas* instPointer,qt_QRect* arg1, qt_QPainter * p, int double_buffer){
	((QCanvasBridge*)instPointer)->drawCanvasArea((QRect&)* (QRect*)arg1, (QPainter*)p, (bool)double_buffer);
	return;
}
void qt_QCanvas_drawViewArea( qt_QCanvas* instPointer,qt_QCanvasView* view, qt_QPainter * p, qt_QRect* r, int dbuf){
	((QCanvasBridge*)instPointer)->drawViewArea((QCanvasView*)view, (QPainter*)p, (QRect&)* (QRect*)r, (bool)dbuf);
	return;
}
void qt_QCanvas_addItem( qt_QCanvas* instPointer,qt_QCanvasItem* arg1){
	((QCanvasBridge*)instPointer)->addItem((QCanvasItem*)arg1);
	return;
}
void qt_QCanvas_addAnimation( qt_QCanvas* instPointer,qt_QCanvasItem* arg1){
	((QCanvasBridge*)instPointer)->addAnimation((QCanvasItem*)arg1);
	return;
}
void qt_QCanvas_removeItem( qt_QCanvas* instPointer,qt_QCanvasItem* arg1){
	((QCanvasBridge*)instPointer)->removeItem((QCanvasItem*)arg1);
	return;
}
void qt_QCanvas_removeAnimation( qt_QCanvas* instPointer,qt_QCanvasItem* arg1){
	((QCanvasBridge*)instPointer)->removeAnimation((QCanvasItem*)arg1);
	return;
}
void qt_QCanvas_setAdvancePeriod( qt_QCanvas* instPointer,int ms){
	((QCanvasBridge*)instPointer)->setAdvancePeriod((int)ms);
	return;
}
void qt_QCanvas_setUpdatePeriod( qt_QCanvas* instPointer,int ms){
	((QCanvasBridge*)instPointer)->setUpdatePeriod((int)ms);
	return;
}
void qt_QCanvas_setDoubleBuffering( qt_QCanvas* instPointer,int y){
	((QCanvasBridge*)instPointer)->setDoubleBuffering((bool)y);
	return;
}
void qt_QCanvas_advance( qt_QCanvas* instPointer){
	((QCanvasBridge*)instPointer)->advance();
	return;
}
void qt_QCanvas_update( qt_QCanvas* instPointer){
	((QCanvasBridge*)instPointer)->update();
	return;
}
void qt_QCanvas_drawBackground( qt_QCanvas* instPointer,qt_QPainter* arg1, qt_QRect* area){
	((QCanvasBridge*)instPointer)->protected_drawBackground((QPainter&)* (QPainter*)arg1, (QRect&)* (QRect*)area);
	return;
}
void qt_QCanvas_drawForeground( qt_QCanvas* instPointer,qt_QPainter* arg1, qt_QRect* area){
	((QCanvasBridge*)instPointer)->protected_drawForeground((QPainter&)* (QPainter*)arg1, (QRect&)* (QRect*)area);
	return;
}
