/*
 * 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 55 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgtexturematerial.sip"
#include <qsgtexturematerial.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGTextureMaterial.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGTextureMaterial.cpp"
#line 176 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGTextureMaterial.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgtexture.sip"
#include <qsgtexture.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGTextureMaterial.cpp"
#line 183 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGTextureMaterial.cpp"
#line 183 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 45 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGTextureMaterial.cpp"


class sipQSGTextureMaterial : public  ::QSGTextureMaterial
{
public:
    sipQSGTextureMaterial();
    virtual ~sipQSGTextureMaterial();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    int compare(const  ::QSGMaterial*) const SIP_OVERRIDE;
     ::QSGMaterialShader* createShader() const SIP_OVERRIDE;
     ::QSGMaterialType* type() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[3];
};

sipQSGTextureMaterial::sipQSGTextureMaterial():  ::QSGTextureMaterial(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

int sipQSGTextureMaterial::compare(const  ::QSGMaterial*a0) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::QSGTextureMaterial::compare(a0);

    extern int sipVH_QtQuick_55(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QSGMaterial*);

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

 ::QSGMaterialShader* sipQSGTextureMaterial::createShader() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::QSGTextureMaterial::createShader();

    extern  ::QSGMaterialShader* sipVH_QtQuick_54(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

 ::QSGMaterialType* sipQSGTextureMaterial::type() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::QSGTextureMaterial::type();

    extern  ::QSGMaterialType* sipVH_QtQuick_53(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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


PyDoc_STRVAR(doc_QSGTextureMaterial_type, "type(self) -> QSGMaterialType");

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

    {
        const  ::QSGTextureMaterial *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSGTextureMaterial, &sipCpp))
        {
             ::QSGMaterialType*sipRes;

            sipRes = (sipSelfWasArg ? sipCpp-> ::QSGTextureMaterial::type() : sipCpp->type());

            return sipConvertFromType(sipRes,sipType_QSGMaterialType,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSGTextureMaterial, sipName_type, doc_QSGTextureMaterial_type);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGTextureMaterial_createShader, "createShader(self) -> QSGMaterialShader");

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

    {
        const  ::QSGTextureMaterial *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSGTextureMaterial, &sipCpp))
        {
             ::QSGMaterialShader*sipRes;

            sipRes = (sipSelfWasArg ? sipCpp-> ::QSGTextureMaterial::createShader() : sipCpp->createShader());

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

    sipNoMethod(sipParseErr, sipName_QSGTextureMaterial, sipName_createShader, doc_QSGTextureMaterial_createShader);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QSGTextureMaterial)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_QSGOpaqueTextureMaterial)->ctd_cast(static_cast< ::QSGOpaqueTextureMaterial *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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


extern "C" {static void *array_QSGTextureMaterial(Py_ssize_t);}
static void *array_QSGTextureMaterial(Py_ssize_t sipNrElem)
{
    return new  ::QSGTextureMaterial[sipNrElem];
}


extern "C" {static void array_delete_QSGTextureMaterial(void *);}
static void array_delete_QSGTextureMaterial(void *sipCpp)
{
    delete[] reinterpret_cast< ::QSGTextureMaterial *>(sipCpp);
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new sipQSGTextureMaterial();

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QSGTextureMaterial[] = {{82, 255, 1}};


static PyMethodDef methods_QSGTextureMaterial[] = {
    {sipName_createShader, meth_QSGTextureMaterial_createShader, METH_VARARGS, doc_QSGTextureMaterial_createShader},
    {sipName_type, meth_QSGTextureMaterial_type, METH_VARARGS, doc_QSGTextureMaterial_type}
};

PyDoc_STRVAR(doc_QSGTextureMaterial, "\1QSGTextureMaterial()");


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


sipClassTypeDef sipTypeDef_QtQuick_QSGTextureMaterial = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSGTextureMaterial,
        SIP_NULLPTR,
        &plugin_QSGTextureMaterial
    },
    {
        sipNameNr_QSGTextureMaterial,
        {0, 0, 1},
        2, methods_QSGTextureMaterial,
        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_QSGTextureMaterial,
    -1,
    -1,
    supers_QSGTextureMaterial,
    SIP_NULLPTR,
    init_type_QSGTextureMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSGTextureMaterial,
    SIP_NULLPTR,
    array_QSGTextureMaterial,
    SIP_NULLPTR,
    release_QSGTextureMaterial,
    cast_QSGTextureMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QSGTextureMaterial,
    sizeof ( ::QSGTextureMaterial),
};
