/***************************************************************************
                            KRootPixmap.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, 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 <kdec/kde_KRootPixmap.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KRootPixmap.h>
#include <kdeobjc/KSharedPixmap.h>
#include <qtobjc/QWidget.h>


@implementation  KRootPixmap


- initWithWidget: (QWidget *)target name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KRootPixmap((qt_QWidget *) [target qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)target 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KRootPixmap((qt_QWidget *) [target qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)target parent: (QObject *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KRootPixmap1((qt_QWidget *) [target qt], (qt_QObject *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)target parent: (QObject *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KRootPixmap1((qt_QWidget *) [target qt], (qt_QObject *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parent] == nil) {
			kde_del_KRootPixmap((kde_KRootPixmap *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (BOOL) isAvailable
{
	return (BOOL) kde_KRootPixmap_isAvailable((kde_KRootPixmap *)[self qt]);
}

- (BOOL) isActive
{
	return (BOOL) kde_KRootPixmap_isActive((kde_KRootPixmap *)[self qt]);
}

- (int) currentDesktop
{
	return (int) kde_KRootPixmap_currentDesktop((kde_KRootPixmap *)[self qt]);
}

- (BOOL) customPainting
{
	return (BOOL) kde_KRootPixmap_customPainting((kde_KRootPixmap *)[self qt]);
}

- (BOOL) checkAvailable: (BOOL)arg1
{
	return (BOOL) kde_KRootPixmap_checkAvailable((kde_KRootPixmap *)[self qt], (int)arg1);
}

- start
{
	kde_KRootPixmap_start((kde_KRootPixmap *)[self qt]);
	return self;
}

- stop
{
	kde_KRootPixmap_stop((kde_KRootPixmap *)[self qt]);
	return self;
}

- setFadeEffect: (double)strength color: (QColor *)color
{
	kde_KRootPixmap_setFadeEffect((kde_KRootPixmap *)[self qt], (double)strength, (qt_QColor *) [color qt]);
	return self;
}

- repaint: (BOOL)force
{
	kde_KRootPixmap_repaint((kde_KRootPixmap *)[self qt], (int)force);
	return self;
}

- repaint
{
	kde_KRootPixmap_repaint1((kde_KRootPixmap *)[self qt]);
	return self;
}

- setCustomPainting: (BOOL)enable
{
	kde_KRootPixmap_setCustomPainting((kde_KRootPixmap *)[self qt], (int)enable);
	return self;
}

- enableExports
{
	kde_KRootPixmap_enableExports((kde_KRootPixmap *)[self qt]);
	return self;
}

- (BOOL) eventFilter: (QObject *)arg1 event: (QEvent *)arg2
{
	return (BOOL) kde_KRootPixmap_eventFilter((kde_KRootPixmap *)[self qt], (qt_QObject *) [arg1 qt], (qt_QEvent *) [arg2 qt]);
}

- updateBackground: (KSharedPixmap*)arg1
{
	kde_KRootPixmap_updateBackground((kde_KRootPixmap *)[self qt], (kde_KSharedPixmap*) [arg1 qt]);
	return self;
}

@end
