/***************************************************************************
                            QWorkspace.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_QWorkspace.h>
#include <qtobjc/QWorkspace.h>
#include <qtobjc/QPixmap.h>
#include <qtobjc/QStyle.h>


@implementation  QWorkspace


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

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

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parentWidget: YES] == nil) {
			qt_del_QWorkspace((qt_QWorkspace *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (QWidget*) activeWindow
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QWorkspace_activeWindow((qt_QWorkspace *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (NSArray *) windowList
{
static qt_QWidgetList * _qlist = 0L;
	_qlist = qt_QWorkspace_windowList((qt_QWorkspace *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQWidgetList: _qlist];
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QWorkspace_sizeHint((qt_QWorkspace *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (BOOL) scrollBarsEnabled
{
	return (BOOL) qt_QWorkspace_scrollBarsEnabled((qt_QWorkspace *)[self qt]);
}

- setScrollBarsEnabled: (BOOL)enable
{
	qt_QWorkspace_setScrollBarsEnabled((qt_QWorkspace *)[self qt], (int)enable);
	return self;
}

- setPaletteBackgroundColor: (QColor *)arg1
{
	qt_QWorkspace_setPaletteBackgroundColor((qt_QWorkspace *)[self qt], (qt_QColor *) [arg1 qt]);
	return self;
}

- setPaletteBackgroundPixmap: (QPixmap *)arg1
{
	qt_QWorkspace_setPaletteBackgroundPixmap((qt_QWorkspace *)[self qt], (qt_QPixmap *) [arg1 qt]);
	return self;
}

- cascade
{
	qt_QWorkspace_cascade((qt_QWorkspace *)[self qt]);
	return self;
}

- tile
{
	qt_QWorkspace_tile((qt_QWorkspace *)[self qt]);
	return self;
}

- styleChange: (QStyle*)arg1
{
	qt_QWorkspace_styleChange((qt_QWorkspace *)[self qt], (qt_QStyle*) [arg1 qt]);
	return self;
}

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

@end
