/***************************************************************************
                            QPaintDevice.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_QPaintDevice.h>
#include <qtobjc/QPaintDevice.h>
#include <qtobjc/QFont.h>
#include <qtobjc/QPainter.h>


@implementation  QPaintDevice

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

- (int) devType
{
	return (int) qt_QPaintDevice_devType((qt_QPaintDevice *)[self qt]);
}

- (BOOL) isExtDev
{
	return (BOOL) qt_QPaintDevice_isExtDev((qt_QPaintDevice *)[self qt]);
}

- (BOOL) paintingActive
{
	return (BOOL) qt_QPaintDevice_paintingActive((qt_QPaintDevice *)[self qt]);
}

- setResolution: (int)arg1
{
	qt_QPaintDevice_setResolution((qt_QPaintDevice *)[self qt], (int)arg1);
	return self;
}

- (int) resolution
{
	return (int) qt_QPaintDevice_resolution((qt_QPaintDevice *)[self qt]);
}

//- (void*) handle
//{
//	return (void*) qt_QPaintDevice_handle((qt_QPaintDevice *)[self qt]);
//}

//- (int) handle
//{
//	return (int) qt_QPaintDevice_handle1((qt_QPaintDevice *)[self qt]);
//}

//- (int) x11RenderHandle
//{
//	return (int) qt_QPaintDevice_x11RenderHandle((qt_QPaintDevice *)[self qt]);
//}

//- (int) handle
//{
//	return (int) qt_QPaintDevice_handle2((qt_QPaintDevice *)[self qt]);
//}

//- (int) handle
//{
//	return (int) qt_QPaintDevice_handle3((qt_QPaintDevice *)[self qt]);
//}

//- (Display*) x11Display
//{
//	return (Display*) qt_QPaintDevice_x11Display((qt_QPaintDevice *)[self qt]);
//}

//- (int) x11Screen
//{
//	return (int) qt_QPaintDevice_x11Screen((qt_QPaintDevice *)[self qt]);
//}

//- (int) x11Depth
//{
//	return (int) qt_QPaintDevice_x11Depth((qt_QPaintDevice *)[self qt]);
//}

//- (int) x11Cells
//{
//	return (int) qt_QPaintDevice_x11Cells((qt_QPaintDevice *)[self qt]);
//}

//- (int) x11Colormap
//{
//	return (int) qt_QPaintDevice_x11Colormap((qt_QPaintDevice *)[self qt]);
//}

//- (BOOL) x11DefaultColormap
//{
//	return (BOOL) qt_QPaintDevice_x11DefaultColormap((qt_QPaintDevice *)[self qt]);
//}

//- (void*) x11Visual
//{
//	return (void*) qt_QPaintDevice_x11Visual((qt_QPaintDevice *)[self qt]);
//}

//- (BOOL) x11DefaultVisual
//{
//	return (BOOL) qt_QPaintDevice_x11DefaultVisual((qt_QPaintDevice *)[self qt]);
//}

//- (unsigned char*) scanLine: (int)arg1
//{
//	return (unsigned char*) qt_QPaintDevice_scanLine((qt_QPaintDevice *)[self qt], (int)arg1);
//}

//- (int) bytesPerLine
//{
//	return (int) qt_QPaintDevice_bytesPerLine((qt_QPaintDevice *)[self qt]);
//}

//- (QGfx*) graphicsContext: (BOOL)clip_children
//{
//	return (QGfx*) [QtSupport objectForQtKey: qt_QPaintDevice_graphicsContext((qt_QPaintDevice *)[self qt], (int)clip_children) withClass: [QGfx class] allocatedInObjcWorld: YES];
//}

//- (QGfx*) graphicsContext
//{
//	return (QGfx*) [QtSupport objectForQtKey: qt_QPaintDevice_graphicsContext((qt_QPaintDevice *)[self qt], 1) withClass: [QGfx class] allocatedInObjcWorld: YES];
//}

//+ (Display*) x11AppDisplay
//{
//	return (Display*) qt_QPaintDevice_x11AppDisplay();
//}

+ (int) x11AppScreen
{
	return (int) qt_QPaintDevice_x11AppScreen();
}

+ (int) x11AppDepth
{
	return (int) qt_QPaintDevice_x11AppDepth();
}

+ (int) x11AppCells
{
	return (int) qt_QPaintDevice_x11AppCells();
}

+ (int) x11AppDpiX
{
	return (int) qt_QPaintDevice_x11AppDpiX();
}

+ (int) x11AppDpiY
{
	return (int) qt_QPaintDevice_x11AppDpiY();
}

//+ (int) x11AppColormap
//{
//	return (int) qt_QPaintDevice_x11AppColormap();
//}

//+ (BOOL) x11AppDefaultColormap
//{
//	return (BOOL) qt_QPaintDevice_x11AppDefaultColormap();
//}

+ (void*) x11AppVisual
{
	return (void*) qt_QPaintDevice_x11AppVisual();
}

+ (BOOL) x11AppDefaultVisual
{
	return (BOOL) qt_QPaintDevice_x11AppDefaultVisual();
}

+ x11SetAppDpiX: (int)arg1
{
	qt_QPaintDevice_x11SetAppDpiX((int)arg1);
	return self;
}

+ x11SetAppDpiY: (int)arg1
{
	qt_QPaintDevice_x11SetAppDpiY((int)arg1);
	return self;
}

//+ (QWSDisplay*) qwsDisplay
//{
//	return (QWSDisplay*) [QtSupport objectForQtKey: qt_QPaintDevice_qwsDisplay() withClass: [QWSDisplay class] allocatedInObjcWorld: YES];
//}

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

- copyX11Data: (QPaintDevice *)arg1
{
	qt_QPaintDevice_copyX11Data((qt_QPaintDevice *)[self qt], (qt_QPaintDevice *) [arg1 qt]);
	return self;
}

- cloneX11Data: (QPaintDevice *)arg1
{
	qt_QPaintDevice_cloneX11Data((qt_QPaintDevice *)[self qt], (qt_QPaintDevice *) [arg1 qt]);
	return self;
}

//- setX11Data: (QPaintDeviceX11Data*)arg1
//{
//	qt_QPaintDevice_setX11Data((qt_QPaintDevice *)[self qt], (qt_QPaintDeviceX11Data*) [arg1 qt]);
//	return self;
//}

//- (QPaintDeviceX11Data*) getX11Data: (BOOL)def
//{
//	return (QPaintDeviceX11Data*) [QtSupport objectForQtKey: qt_QPaintDevice_getX11Data((qt_QPaintDevice *)[self qt], (int)def) withClass: [QPaintDeviceX11Data class] allocatedInObjcWorld: YES];
//}

//- (QPaintDeviceX11Data*) getX11Data
//{
//	return (QPaintDeviceX11Data*) [QtSupport objectForQtKey: qt_QPaintDevice_getX11Data((qt_QPaintDevice *)[self qt], 0) withClass: [QPaintDeviceX11Data class] allocatedInObjcWorld: YES];
//}

//- (BOOL) cmd: (int)arg1 painter: (QPainter *)arg2 pdevcmdparam: (QPDevCmdParam*)arg3
//{
//	return (BOOL) qt_QPaintDevice_cmd((qt_QPaintDevice *)[self qt], (int)arg1, (qt_QPainter *) [arg2 qt], (qt_QPDevCmdParam*) [arg3 qt]);
//}

- (int) metric: (int)arg1
{
	return (int) qt_QPaintDevice_metric((qt_QPaintDevice *)[self qt], (int)arg1);
}

- (int) fontMet: (QFont *)arg1 int: (int)arg2 string: (NSString *)arg3 int: (int)arg4
{
	return (int) qt_QPaintDevice_fontMet((qt_QPaintDevice *)[self qt], (qt_QFont *) [arg1 qt], (int)arg2, (char*) [arg3 cString], (int)arg4);
}

- (int) fontMet: (QFont *)arg1 int: (int)arg2 
{
	return (int) qt_QPaintDevice_fontMet((qt_QPaintDevice *)[self qt], (qt_QFont *) [arg1 qt], (int)arg2, 0, 0);
}

- (int) fontInf: (QFont *)arg1 int: (int)arg2
{
	return (int) qt_QPaintDevice_fontInf((qt_QPaintDevice *)[self qt], (qt_QFont *) [arg1 qt], (int)arg2);
}

//- (CGContextRef) macCGContext
//{
//	return (CGContextRef) qt_QPaintDevice_macCGContext((qt_QPaintDevice *)[self qt]);
//}

//- unclippedScaledBitBlt: (QPaintDevice *)arg1 int: (int)arg2 int: (int)arg3 int: (int)arg4 int: (int)arg5 paintdevice: (QPaintDevice *)arg6 int: (int)arg7 int: (int)arg8 int: (int)arg9 int: (int)arg10 int: (int)arg11 bool: (BOOL)arg12
//{
//	qt_QPaintDevice_unclippedScaledBitBlt((qt_QPaintDevice *)[self qt], (qt_QPaintDevice *) [arg1 qt], (int)arg2, (int)arg3, (int)arg4, (int)arg5, (qt_QPaintDevice *) [arg6 qt], (int)arg7, (int)arg8, (int)arg9, (int)arg10, (int)arg11, (int)arg12);
//	return self;
//}

+ bitBlt: (QPaintDevice *) arg1 dx: (int)arg2 dy: (int)arg3 source: (QPaintDevice *)arg4 int: (int)arg5 int: (int)arg6 int: (int)arg7 int: (int)arg8 int: (int)arg9 bool: (BOOL)arg10
{
	qt_QPaintDevice_bitBlt((qt_QPaintDevice *)[arg1 paintDevice], (int)arg2, (int)arg3, (qt_QPaintDevice *) [arg4 qt], (int)arg5, (int)arg6, (int)arg7, (int)arg8, (int)arg9, (int)arg10);
	return self;
}

+ bitBlt: (QPaintDevice *) arg1 dx: (int)arg2 dy: (int)arg3 source: (QPaintDevice *)arg4
{
	qt_QPaintDevice_bitBlt((qt_QPaintDevice *)[arg1 paintDevice], (int)arg2, (int)arg3, (qt_QPaintDevice *) [arg4 qt], 0, 0, -1, -1, 0, 0);
 	return self;
}

- (void *) paintDevice
{
	return [self qt];
}

//- qt_init_internal: (int*)arg1 string: (NSString *)arg2 display: (Display*)arg3 int: (int)arg4 int: (int)arg5
//{
//	qt_QPaintDevice_qt_init_internal((qt_QPaintDevice *)[self qt], (int*)arg1, (char**) [arg2 cString], (Display*)arg3, (Qt::HANDLE) arg4, (Qt::HANDLE) arg5);
//	return self;
//}

- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


+ (int) PdcNOP
{
	return (int) QPAINTDEVICE_PdcNOP;
}

+ (int) PdcDrawPoint
{
	return (int) QPAINTDEVICE_PdcDrawPoint;
}

+ (int) PdcDrawFirst
{
	return (int) QPAINTDEVICE_PdcDrawFirst;
}

+ (int) PdcMoveTo
{
	return (int) QPAINTDEVICE_PdcMoveTo;
}

+ (int) PdcLineTo
{
	return (int) QPAINTDEVICE_PdcLineTo;
}

+ (int) PdcDrawLine
{
	return (int) QPAINTDEVICE_PdcDrawLine;
}

+ (int) PdcDrawRect
{
	return (int) QPAINTDEVICE_PdcDrawRect;
}

+ (int) PdcDrawRoundRect
{
	return (int) QPAINTDEVICE_PdcDrawRoundRect;
}

+ (int) PdcDrawEllipse
{
	return (int) QPAINTDEVICE_PdcDrawEllipse;
}

+ (int) PdcDrawArc
{
	return (int) QPAINTDEVICE_PdcDrawArc;
}

+ (int) PdcDrawPie
{
	return (int) QPAINTDEVICE_PdcDrawPie;
}

+ (int) PdcDrawChord
{
	return (int) QPAINTDEVICE_PdcDrawChord;
}

+ (int) PdcDrawLineSegments
{
	return (int) QPAINTDEVICE_PdcDrawLineSegments;
}

+ (int) PdcDrawPolyline
{
	return (int) QPAINTDEVICE_PdcDrawPolyline;
}

+ (int) PdcDrawPolygon
{
	return (int) QPAINTDEVICE_PdcDrawPolygon;
}

+ (int) PdcDrawCubicBezier
{
	return (int) QPAINTDEVICE_PdcDrawCubicBezier;
}

+ (int) PdcDrawText
{
	return (int) QPAINTDEVICE_PdcDrawText;
}

+ (int) PdcDrawTextFormatted
{
	return (int) QPAINTDEVICE_PdcDrawTextFormatted;
}

+ (int) PdcDrawPixmap
{
	return (int) QPAINTDEVICE_PdcDrawPixmap;
}

+ (int) PdcDrawImage
{
	return (int) QPAINTDEVICE_PdcDrawImage;
}

+ (int) PdcDrawText2
{
	return (int) QPAINTDEVICE_PdcDrawText2;
}

+ (int) PdcDrawText2Formatted
{
	return (int) QPAINTDEVICE_PdcDrawText2Formatted;
}

+ (int) PdcDrawLast
{
	return (int) QPAINTDEVICE_PdcDrawLast;
}

+ (int) PdcBegin
{
	return (int) QPAINTDEVICE_PdcBegin;
}

+ (int) PdcEnd
{
	return (int) QPAINTDEVICE_PdcEnd;
}

+ (int) PdcSave
{
	return (int) QPAINTDEVICE_PdcSave;
}

+ (int) PdcRestore
{
	return (int) QPAINTDEVICE_PdcRestore;
}

+ (int) PdcSetdev
{
	return (int) QPAINTDEVICE_PdcSetdev;
}

+ (int) PdcSetBkColor
{
	return (int) QPAINTDEVICE_PdcSetBkColor;
}

+ (int) PdcSetBkMode
{
	return (int) QPAINTDEVICE_PdcSetBkMode;
}

+ (int) PdcSetROP
{
	return (int) QPAINTDEVICE_PdcSetROP;
}

+ (int) PdcSetBrushOrigin
{
	return (int) QPAINTDEVICE_PdcSetBrushOrigin;
}

+ (int) PdcSetFont
{
	return (int) QPAINTDEVICE_PdcSetFont;
}

+ (int) PdcSetPen
{
	return (int) QPAINTDEVICE_PdcSetPen;
}

+ (int) PdcSetBrush
{
	return (int) QPAINTDEVICE_PdcSetBrush;
}

+ (int) PdcSetTabStops
{
	return (int) QPAINTDEVICE_PdcSetTabStops;
}

+ (int) PdcSetTabArray
{
	return (int) QPAINTDEVICE_PdcSetTabArray;
}

+ (int) PdcSetUnit
{
	return (int) QPAINTDEVICE_PdcSetUnit;
}

+ (int) PdcSetVXform
{
	return (int) QPAINTDEVICE_PdcSetVXform;
}

+ (int) PdcSetWindow
{
	return (int) QPAINTDEVICE_PdcSetWindow;
}

+ (int) PdcSetViewport
{
	return (int) QPAINTDEVICE_PdcSetViewport;
}

+ (int) PdcSetWXform
{
	return (int) QPAINTDEVICE_PdcSetWXform;
}

+ (int) PdcSetWMatrix
{
	return (int) QPAINTDEVICE_PdcSetWMatrix;
}

+ (int) PdcSaveWMatrix
{
	return (int) QPAINTDEVICE_PdcSaveWMatrix;
}

+ (int) PdcRestoreWMatrix
{
	return (int) QPAINTDEVICE_PdcRestoreWMatrix;
}

+ (int) PdcSetClip
{
	return (int) QPAINTDEVICE_PdcSetClip;
}

+ (int) PdcSetClipRegion
{
	return (int) QPAINTDEVICE_PdcSetClipRegion;
}

+ (int) PdcReservedStart
{
	return (int) QPAINTDEVICE_PdcReservedStart;
}

+ (int) PdcReservedStop
{
	return (int) QPAINTDEVICE_PdcReservedStop;
}

@end
