/***************************************************************************
                            QBitmap.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_QBitmap.h>
#include <qtobjc/QBitmap.h>
#include <qtobjc/QWMatrix.h>

@implementation  QBitmap


- init
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap()];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)w h: (int)h clear: (BOOL)clear int: (int)arg1
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap1((int)w, (int)h, (int)clear, (int)arg1)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)w h: (int)h 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap1((int)w, (int)h, 0, [QPixmap DefaultOptim])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithSize: (QSize *)arg1 clear: (BOOL)clear int: (int)arg2
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap2((qt_QSize *) [arg1 qt], (int)clear, (int)arg2)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithSize: (QSize *)arg1 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap2((qt_QSize *) [arg1 qt], 0, [QPixmap DefaultOptim])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)w h: (int)h bits: (unsigned char*)bits isXbitmap: (BOOL)isXbitmap
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap3((int)w, (int)h, (unsigned char*)bits, (int)isXbitmap)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)w h: (int)h bits: (unsigned char*)bits 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap3((int)w, (int)h, (unsigned char*)bits, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithSize: (QSize *)arg1 bits: (unsigned char*)bits isXbitmap: (BOOL)isXbitmap
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap4((qt_QSize *) [arg1 qt], (unsigned char*)bits, (int)isXbitmap)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithSize: (QSize *)arg1 bits: (unsigned char*)bits 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap4((qt_QSize *) [arg1 qt], (unsigned char*)bits, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- copyWithZone: (NSZone *) zone
{
	QBitmap * aCopy;
	aCopy = [[(QBitmap *)[[self class] allocWithZone: zone] setQt: qt_new_QBitmap5([self qt])] init];
	[aCopy setAllocatedInObjcWorld: YES];
	[QtSupport setObject: aCopy forQtKey: [aCopy qt]];
	return aCopy;
}

- initWithText: (NSString *)fileName format: (NSString *)format
{
static qt_QString * _qstring_fileName = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap6((qt_QString *) [fileName toQString: &_qstring_fileName], (char*) [format cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)fileName 
{
static qt_QString * _qstring_fileName = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QBitmap6((qt_QString *) [fileName toQString: &_qstring_fileName], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (QBitmap*) xForm: (QWMatrix *)arg1
{
	return (QBitmap*) [QtSupport objectForQtKey: qt_QBitmap_xForm((qt_QBitmap *)[self qt], (qt_QWMatrix *) [arg1 qt]) withClass: [QBitmap class] allocatedInObjcWorld: YES];
}

@end
