/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtQuick.h"

#line 44 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qquickimageprovider.sip"
#include <qquickimageprovider.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQml/qqmlengine.sip"
#include <qqmlengine.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQml/qqmlengine.sip"
#include <qqmlengine.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qquickimageprovider.sip"
#include <qquickimageprovider.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qsize.sip"
#include <qsize.h>
#line 45 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qpixmap.sip"
#include <qpixmap.h>
#line 48 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qimage.sip"
#include <qimage.h>
#line 51 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQQuickImageProvider.cpp"


class sipQQuickImageProvider : public  ::QQuickImageProvider
{
public:
    sipQQuickImageProvider( ::QQmlImageProviderBase::ImageType, ::QQmlImageProviderBase::Flags);
    sipQQuickImageProvider(const  ::QQuickImageProvider&);
    virtual ~sipQQuickImageProvider();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::QQuickTextureFactory* requestTexture(const  ::QString&, ::QSize*,const  ::QSize&) SIP_OVERRIDE;
     ::QPixmap requestPixmap(const  ::QString&, ::QSize*,const  ::QSize&) SIP_OVERRIDE;
     ::QImage requestImage(const  ::QString&, ::QSize*,const  ::QSize&) SIP_OVERRIDE;
     ::QQmlImageProviderBase::ImageType imageType() const SIP_OVERRIDE;
     ::QQmlImageProviderBase::Flags flags() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipQQuickImageProvider(const sipQQuickImageProvider &);
    sipQQuickImageProvider &operator = (const sipQQuickImageProvider &);

    char sipPyMethods[5];
};

sipQQuickImageProvider::sipQQuickImageProvider( ::QQmlImageProviderBase::ImageType a0, ::QQmlImageProviderBase::Flags a1):  ::QQuickImageProvider(a0,a1), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQQuickImageProvider::sipQQuickImageProvider(const  ::QQuickImageProvider& a0):  ::QQuickImageProvider(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQQuickImageProvider::~sipQQuickImageProvider()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

 ::QQuickTextureFactory* sipQQuickImageProvider::requestTexture(const  ::QString& a0, ::QSize*a1,const  ::QSize& a2)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_requestTexture);

    if (!sipMeth)
        return  ::QQuickImageProvider::requestTexture(a0,a1,a2);

    extern  ::QQuickTextureFactory* sipVH_QtQuick_37(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QString&, ::QSize*,const  ::QSize&);

    return sipVH_QtQuick_37(sipGILState, sipImportedVirtErrorHandlers_QtQuick_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0, a1, a2);
}

 ::QPixmap sipQQuickImageProvider::requestPixmap(const  ::QString& a0, ::QSize*a1,const  ::QSize& a2)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_requestPixmap);

    if (!sipMeth)
        return  ::QQuickImageProvider::requestPixmap(a0,a1,a2);

    extern  ::QPixmap sipVH_QtQuick_36(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QString&, ::QSize*,const  ::QSize&);

    return sipVH_QtQuick_36(sipGILState, sipImportedVirtErrorHandlers_QtQuick_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0, a1, a2);
}

 ::QImage sipQQuickImageProvider::requestImage(const  ::QString& a0, ::QSize*a1,const  ::QSize& a2)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, SIP_NULLPTR, sipName_requestImage);

    if (!sipMeth)
        return  ::QQuickImageProvider::requestImage(a0,a1,a2);

    extern  ::QImage sipVH_QtQuick_35(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QString&, ::QSize*,const  ::QSize&);

    return sipVH_QtQuick_35(sipGILState, sipImportedVirtErrorHandlers_QtQuick_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0, a1, a2);
}

 ::QQmlImageProviderBase::ImageType sipQQuickImageProvider::imageType() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[3]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_imageType);

    if (!sipMeth)
        return  ::QQuickImageProvider::imageType();

    extern  ::QQmlImageProviderBase::ImageType sipVH_QtQuick_34(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH_QtQuick_34(sipGILState, sipImportedVirtErrorHandlers_QtQuick_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}

 ::QQmlImageProviderBase::Flags sipQQuickImageProvider::flags() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[4]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_flags);

    if (!sipMeth)
        return  ::QQuickImageProvider::flags();

    extern  ::QQmlImageProviderBase::Flags sipVH_QtQuick_33(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH_QtQuick_33(sipGILState, sipImportedVirtErrorHandlers_QtQuick_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}


PyDoc_STRVAR(doc_QQuickImageProvider_imageType, "imageType(self) -> QQmlImageProviderBase.ImageType");

extern "C" {static PyObject *meth_QQuickImageProvider_imageType(PyObject *, PyObject *);}
static PyObject *meth_QQuickImageProvider_imageType(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const  ::QQuickImageProvider *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QQuickImageProvider, &sipCpp))
        {
             ::QQmlImageProviderBase::ImageType sipRes;

            sipRes = (sipSelfWasArg ? sipCpp-> ::QQuickImageProvider::imageType() : sipCpp->imageType());

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QQmlImageProviderBase_ImageType);
        }
    }

    sipNoMethod(sipParseErr, sipName_QQuickImageProvider, sipName_imageType, doc_QQuickImageProvider_imageType);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QQuickImageProvider_flags, "flags(self) -> QQmlImageProviderBase.Flags");

extern "C" {static PyObject *meth_QQuickImageProvider_flags(PyObject *, PyObject *);}
static PyObject *meth_QQuickImageProvider_flags(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const  ::QQuickImageProvider *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QQuickImageProvider, &sipCpp))
        {
             ::QQmlImageProviderBase::Flags*sipRes;

            sipRes = new  ::QQmlImageProviderBase::Flags((sipSelfWasArg ? sipCpp-> ::QQuickImageProvider::flags() : sipCpp->flags()));

            return sipConvertFromNewType(sipRes,sipType_QQmlImageProviderBase_Flags,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QQuickImageProvider, sipName_flags, doc_QQuickImageProvider_flags);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QQuickImageProvider_requestImage, "requestImage(self, str, QSize) -> Tuple[QImage, QSize]");

extern "C" {static PyObject *meth_QQuickImageProvider_requestImage(PyObject *, PyObject *);}
static PyObject *meth_QQuickImageProvider_requestImage(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const  ::QString* a0;
        int a0State = 0;
         ::QSize* a1;
        const  ::QSize* a2;
         ::QQuickImageProvider *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J9", &sipSelf, sipType_QQuickImageProvider, &sipCpp, sipType_QString, &a0, &a0State, sipType_QSize, &a2))
        {
             ::QImage*sipRes;
            a1 = new  ::QSize();

            sipRes = new  ::QImage((sipSelfWasArg ? sipCpp-> ::QQuickImageProvider::requestImage(*a0,a1,*a2) : sipCpp->requestImage(*a0,a1,*a2)));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            PyObject *sipResObj = sipConvertFromNewType(sipRes,sipType_QImage,SIP_NULLPTR);
            return sipBuildResult(0,"(RN)",sipResObj,a1,sipType_QSize,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QQuickImageProvider, sipName_requestImage, doc_QQuickImageProvider_requestImage);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QQuickImageProvider_requestPixmap, "requestPixmap(self, str, QSize) -> Tuple[QPixmap, QSize]");

extern "C" {static PyObject *meth_QQuickImageProvider_requestPixmap(PyObject *, PyObject *);}
static PyObject *meth_QQuickImageProvider_requestPixmap(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const  ::QString* a0;
        int a0State = 0;
         ::QSize* a1;
        const  ::QSize* a2;
         ::QQuickImageProvider *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J9", &sipSelf, sipType_QQuickImageProvider, &sipCpp, sipType_QString, &a0, &a0State, sipType_QSize, &a2))
        {
             ::QPixmap*sipRes;
            a1 = new  ::QSize();

            sipRes = new  ::QPixmap((sipSelfWasArg ? sipCpp-> ::QQuickImageProvider::requestPixmap(*a0,a1,*a2) : sipCpp->requestPixmap(*a0,a1,*a2)));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            PyObject *sipResObj = sipConvertFromNewType(sipRes,sipType_QPixmap,SIP_NULLPTR);
            return sipBuildResult(0,"(RN)",sipResObj,a1,sipType_QSize,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QQuickImageProvider, sipName_requestPixmap, doc_QQuickImageProvider_requestPixmap);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QQuickImageProvider_requestTexture, "requestTexture(self, str, QSize) -> Tuple[QQuickTextureFactory, QSize]");

extern "C" {static PyObject *meth_QQuickImageProvider_requestTexture(PyObject *, PyObject *);}
static PyObject *meth_QQuickImageProvider_requestTexture(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const  ::QString* a0;
        int a0State = 0;
         ::QSize* a1;
        const  ::QSize* a2;
         ::QQuickImageProvider *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J9", &sipSelf, sipType_QQuickImageProvider, &sipCpp, sipType_QString, &a0, &a0State, sipType_QSize, &a2))
        {
             ::QQuickTextureFactory*sipRes;
            a1 = new  ::QSize();

            sipRes = (sipSelfWasArg ? sipCpp-> ::QQuickImageProvider::requestTexture(*a0,a1,*a2) : sipCpp->requestTexture(*a0,a1,*a2));
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            PyObject *sipResObj = sipConvertFromNewType(sipRes,sipType_QQuickTextureFactory,SIP_NULLPTR);
            return sipBuildResult(0,"(RN)",sipResObj,a1,sipType_QSize,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QQuickImageProvider, sipName_requestTexture, doc_QQuickImageProvider_requestTexture);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_QQuickImageProvider(void *, const sipTypeDef *);}
static void *cast_QQuickImageProvider(void *sipCppV, const sipTypeDef *targetType)
{
     ::QQuickImageProvider *sipCpp = reinterpret_cast< ::QQuickImageProvider *>(sipCppV);

    if (targetType == sipType_QQuickImageProvider)
        return sipCppV;

    if (targetType == sipType_QQmlImageProviderBase)
        return static_cast< ::QQmlImageProviderBase *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QQuickImageProvider(void *, int);}
static void release_QQuickImageProvider(void *sipCppV, int sipState)
{
    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipQQuickImageProvider *>(sipCppV);
    else
        delete reinterpret_cast< ::QQuickImageProvider *>(sipCppV);
}


extern "C" {static void assign_QQuickImageProvider(void *, Py_ssize_t, void *);}
static void assign_QQuickImageProvider(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QQuickImageProvider *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QQuickImageProvider *>(sipSrc);
}


extern "C" {static void *copy_QQuickImageProvider(const void *, Py_ssize_t);}
static void *copy_QQuickImageProvider(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new  ::QQuickImageProvider(reinterpret_cast<const  ::QQuickImageProvider *>(sipSrc)[sipSrcIdx]);
}


extern "C" {static void dealloc_QQuickImageProvider(sipSimpleWrapper *);}
static void dealloc_QQuickImageProvider(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipQQuickImageProvider *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_QQuickImageProvider(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_QQuickImageProvider(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QQuickImageProvider(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipQQuickImageProvider *sipCpp = SIP_NULLPTR;

    {
         ::QQmlImageProviderBase::ImageType a0;
         ::QQmlImageProviderBase::Flags a1def = QQmlImageProviderBase::Flags();
         ::QQmlImageProviderBase::Flags* a1 = &a1def;
        int a1State = 0;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_flags,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "E|J1", sipType_QQmlImageProviderBase_ImageType, &a0, sipType_QQmlImageProviderBase_Flags, &a1, &a1State))
        {
            sipCpp = new sipQQuickImageProvider(a0,*a1);
            sipReleaseType(a1, sipType_QQmlImageProviderBase_Flags, a1State);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QQuickImageProvider* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QQuickImageProvider, &a0))
        {
            sipCpp = new sipQQuickImageProvider(*a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QQuickImageProvider[] = {{3, 2, 1}};


static PyMethodDef methods_QQuickImageProvider[] = {
    {sipName_flags, meth_QQuickImageProvider_flags, METH_VARARGS, doc_QQuickImageProvider_flags},
    {sipName_imageType, meth_QQuickImageProvider_imageType, METH_VARARGS, doc_QQuickImageProvider_imageType},
    {sipName_requestImage, meth_QQuickImageProvider_requestImage, METH_VARARGS, doc_QQuickImageProvider_requestImage},
    {sipName_requestPixmap, meth_QQuickImageProvider_requestPixmap, METH_VARARGS, doc_QQuickImageProvider_requestPixmap},
    {sipName_requestTexture, meth_QQuickImageProvider_requestTexture, METH_VARARGS, doc_QQuickImageProvider_requestTexture}
};

PyDoc_STRVAR(doc_QQuickImageProvider, "\1QQuickImageProvider(QQmlImageProviderBase.ImageType, flags: Union[QQmlImageProviderBase.Flags, QQmlImageProviderBase.Flag] = QQmlImageProviderBase.Flags())\n"
"QQuickImageProvider(QQuickImageProvider)");


static pyqt5ClassPluginDef plugin_QQuickImageProvider = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtQuick_QQuickImageProvider = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QQuickImageProvider,
        SIP_NULLPTR,
        &plugin_QQuickImageProvider
    },
    {
        sipNameNr_QQuickImageProvider,
        {0, 0, 1},
        5, methods_QQuickImageProvider,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QQuickImageProvider,
    -1,
    -1,
    supers_QQuickImageProvider,
    SIP_NULLPTR,
    init_type_QQuickImageProvider,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QQuickImageProvider,
    assign_QQuickImageProvider,
    SIP_NULLPTR,
    copy_QQuickImageProvider,
    release_QQuickImageProvider,
    cast_QQuickImageProvider,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QQuickImageProvider),
};
