// C++ interface wrapper code.
//
// Generated by SIP 3.7 (build 102) on Fri Jul 25 00:26:03 2003
//
// Copyright (c) 2003
// 	Riverbank Computing Limited <info@riverbankcomputing.co.uk>
// 
// This file is part of PyQt.
// 
// This copy of PyQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
// 
// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
// details.
// 
// You should have received a copy of the GNU General Public License along with
// PyQt; see the file LICENSE.  If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include "sipqtcanvasDeclqtcanvas.h"
#include "sipqtcanvasQCanvasPixmapArray.h"


PyObject *sipClass_QCanvasPixmapArray;

static void sipDealloc_QCanvasPixmapArray(sipThisType *);

static PyTypeObject sipType_QCanvasPixmapArray = {
	PyObject_HEAD_INIT(&PyType_Type)
	0,
	sipWrapperTypeName,
	sizeof (sipThisType),
	0,
	(destructor)sipDealloc_QCanvasPixmapArray,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	Py_TPFLAGS_DEFAULT,
};

static PyObject *sipDo_QCanvasPixmapArray_readPixmaps(PyObject *sipThisObj,PyObject *sipArgs)
{
	int sipArgsParsed = 0;

	{
		QString * a0;
		int a0IsTemp = 0;
		int a1 = 0;
		QCanvasPixmapArray *sipCpp;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"mM1|i",sipThisObj,sipClass_QCanvasPixmapArray,&sipCpp,sipConvertTo_QString,&a0,&a0IsTemp,&a1))
		{
			bool res;

			Py_BEGIN_ALLOW_THREADS
			res = sipCpp -> QCanvasPixmapArray::readPixmaps(*a0,a1);
			Py_END_ALLOW_THREADS

			if (a0IsTemp)
				delete a0;

			return sipConvertFromBool((int)res);
		}
	}

	// Report an error if the arguments couldn't be parsed.

	sipNoMethod(sipArgsParsed,sipName_QCanvasPixmapArray,sipName_readPixmaps);

	return NULL;
}

static PyObject *sipDo_QCanvasPixmapArray_readCollisionMasks(PyObject *sipThisObj,PyObject *sipArgs)
{
	int sipArgsParsed = 0;

	{
		QString * a0;
		int a0IsTemp = 0;
		QCanvasPixmapArray *sipCpp;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"mM1",sipThisObj,sipClass_QCanvasPixmapArray,&sipCpp,sipConvertTo_QString,&a0,&a0IsTemp))
		{
			bool res;

			Py_BEGIN_ALLOW_THREADS
			res = sipCpp -> QCanvasPixmapArray::readCollisionMasks(*a0);
			Py_END_ALLOW_THREADS

			if (a0IsTemp)
				delete a0;

			return sipConvertFromBool((int)res);
		}
	}

	// Report an error if the arguments couldn't be parsed.

	sipNoMethod(sipArgsParsed,sipName_QCanvasPixmapArray,sipName_readCollisionMasks);

	return NULL;
}

static PyObject *sipDo_QCanvasPixmapArray_isValid(PyObject *sipThisObj,PyObject *sipArgs)
{
	int sipArgsParsed = 0;

	{
		QCanvasPixmapArray *sipCpp;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"m",sipThisObj,sipClass_QCanvasPixmapArray,&sipCpp))
		{
			bool res;

			Py_BEGIN_ALLOW_THREADS
			res = sipCpp -> QCanvasPixmapArray::isValid();
			Py_END_ALLOW_THREADS

			return sipConvertFromBool((int)res);
		}
	}

	// Report an error if the arguments couldn't be parsed.

	sipNoMethod(sipArgsParsed,sipName_QCanvasPixmapArray,sipName_isValid);

	return NULL;
}

static PyObject *sipDo_QCanvasPixmapArray_image(PyObject *sipThisObj,PyObject *sipArgs)
{
	int sipArgsParsed = 0;

	{
		int a0;
		QCanvasPixmapArray *sipCpp;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"mi",sipThisObj,sipClass_QCanvasPixmapArray,&sipCpp,&a0))
		{
			QCanvasPixmap *res;

			Py_BEGIN_ALLOW_THREADS
			res = sipCpp -> QCanvasPixmapArray::image(a0);
			Py_END_ALLOW_THREADS

			return sipMapCppToSelf(res,sipClass_QCanvasPixmap);
		}
	}

	// Report an error if the arguments couldn't be parsed.

	sipNoMethod(sipArgsParsed,sipName_QCanvasPixmapArray,sipName_image);

	return NULL;
}

static PyObject *sipDo_QCanvasPixmapArray_setImage(PyObject *sipThisObj,PyObject *sipArgs)
{
	int sipArgsParsed = 0;

	{
		int a0;
		QCanvasPixmap * a1;
		QCanvasPixmapArray *sipCpp;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"miJ2",sipThisObj,sipClass_QCanvasPixmapArray,&sipCpp,&a0,sipClass_QCanvasPixmap,&a1))
		{
			Py_BEGIN_ALLOW_THREADS
			sipCpp -> QCanvasPixmapArray::setImage(a0,a1);
			Py_END_ALLOW_THREADS

			Py_INCREF(Py_None);
			return Py_None;
		}
	}

	// Report an error if the arguments couldn't be parsed.

	sipNoMethod(sipArgsParsed,sipName_QCanvasPixmapArray,sipName_setImage);

	return NULL;
}

static PyObject *sipDo_QCanvasPixmapArray_count(PyObject *sipThisObj,PyObject *sipArgs)
{
	int sipArgsParsed = 0;

	{
		QCanvasPixmapArray *sipCpp;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"m",sipThisObj,sipClass_QCanvasPixmapArray,&sipCpp))
		{
			unsigned res;

			Py_BEGIN_ALLOW_THREADS
			res = sipCpp -> QCanvasPixmapArray::count();
			Py_END_ALLOW_THREADS

			return PyInt_FromLong((long)res);
		}
	}

	// Report an error if the arguments couldn't be parsed.

	sipNoMethod(sipArgsParsed,sipName_QCanvasPixmapArray,sipName_count);

	return NULL;
}

// Cast a pointer to a type somewhere in its superclass hierarchy.

const void *sipCast_QCanvasPixmapArray(const void *ptr,PyObject *targetClass)
{
	if (targetClass == sipClass_QCanvasPixmapArray)
		return ptr;

	return NULL;
}

static void sipDealloc_QCanvasPixmapArray(sipThisType *sipThis)
{
	if (sipThis -> u.cppPtr != NULL)
	{

		if (sipIsPyOwned(sipThis))
		{
			Py_BEGIN_ALLOW_THREADS

			delete (QCanvasPixmapArray *)sipThis -> u.cppPtr;

			Py_END_ALLOW_THREADS
		}
	}

	sipDeleteThis(sipThis);
}

PyObject *sipNew_QCanvasPixmapArray(PyObject *sipSelf,PyObject *sipArgs)
{
	static sipExtraType et = {
		sipCast_QCanvasPixmapArray,
		(void *)sipNewProxy_qtcanvas,
		NULL
	};

	sipThisType *sipThis = NULL;
	const void *sipNew = NULL;
	int sipFlags = SIP_PY_OWNED;
	int sipArgsParsed = 0;

	// See if there is something pending.

	sipNew = sipGetPending(&sipFlags);

	if (sipNew == NULL)
	{
		if (sipParseArgs(&sipArgsParsed,sipArgs,""))
		{
			Py_BEGIN_ALLOW_THREADS
			sipNew = new QCanvasPixmapArray();
			Py_END_ALLOW_THREADS
		}
	}

	if (sipNew == NULL)
	{
		QString * a0;
		int a0IsTemp = 0;
		int a1 = 0;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"M1|i",sipConvertTo_QString,&a0,&a0IsTemp,&a1))
		{
			Py_BEGIN_ALLOW_THREADS
			sipNew = new QCanvasPixmapArray(*a0,a1);
			Py_END_ALLOW_THREADS

			if (a0IsTemp)
				delete a0;
		}
	}

	if (sipNew == NULL)
	{
		QValueList<QPixmap> * a0;
		int a0IsTemp = 0;
		QPointArray a1def = QPointArray();
		QPointArray * a1 = &a1def;

		if (sipParseArgs(&sipArgsParsed,sipArgs,"M1|J1",sipConvertTo_QValueList_0200QPixmap,&a0,&a0IsTemp,sipClass_QPointArray,&a1))
		{
			Py_BEGIN_ALLOW_THREADS
			sipNew = new QCanvasPixmapArray(*a0,*a1);
			Py_END_ALLOW_THREADS

			if (a0IsTemp)
				delete a0;
		}
	}

	if (sipNew == NULL)
	{
		sipNoCtor(sipArgsParsed,sipName_QCanvasPixmapArray);
		return NULL;
	}

	// Wrap the object.

	if ((sipThis = sipCreateThis(sipSelf,sipNew,&sipType_QCanvasPixmapArray,sipFlags,&et)) == NULL)
	{
		if (sipFlags & SIP_PY_OWNED)
		{
			Py_BEGIN_ALLOW_THREADS

			delete (QCanvasPixmapArray *)sipNew;

			Py_END_ALLOW_THREADS
		}

		return NULL;
	}

	Py_INCREF(Py_None);
	return Py_None;
}

static PyMethodDef lazyMethods_QCanvasPixmapArray[] = {
	{sipName_count, sipDo_QCanvasPixmapArray_count, METH_VARARGS, NULL},
	{sipName_image, sipDo_QCanvasPixmapArray_image, METH_VARARGS, NULL},
	{sipName_isValid, sipDo_QCanvasPixmapArray_isValid, METH_VARARGS, NULL},
	{sipName_readCollisionMasks, sipDo_QCanvasPixmapArray_readCollisionMasks, METH_VARARGS, NULL},
	{sipName_readPixmaps, sipDo_QCanvasPixmapArray_readPixmaps, METH_VARARGS, NULL},
	{sipName_setImage, sipDo_QCanvasPixmapArray_setImage, METH_VARARGS, NULL}
};

sipLazyAttrDef sipClassAttrTab_QCanvasPixmapArray = {
	0, NULL,
	sizeof (lazyMethods_QCanvasPixmapArray) / sizeof (PyMethodDef), lazyMethods_QCanvasPixmapArray,
	0, NULL
};

QCanvasPixmapArray *sipForceConvertTo_QCanvasPixmapArray(PyObject *valobj,int *iserrp)
{
	if (*iserrp || valobj == NULL)
		return NULL;

	if (valobj == Py_None || sipIsSubClassInstance(valobj,sipClass_QCanvasPixmapArray))
		return (QCanvasPixmapArray *)sipConvertToCpp(valobj,sipClass_QCanvasPixmapArray,iserrp);

	sipBadClass(sipName_QCanvasPixmapArray);

	*iserrp = 1;

	return NULL;
}
