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

#line 183 "/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/sipQtQuickQSGMaterial.cpp"
#line 26 "/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/sipQtQuickQSGMaterial.cpp"
#line 176 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtQuick/sipQtQuickQSGMaterial.cpp"


class sipQSGMaterial : public  ::QSGMaterial
{
public:
    sipQSGMaterial();
    virtual ~sipQSGMaterial();

    /*
     * 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:
    sipQSGMaterial(const sipQSGMaterial &);
    sipQSGMaterial &operator = (const sipQSGMaterial &);

    char sipPyMethods[3];
};

sipQSGMaterial::sipQSGMaterial():  ::QSGMaterial(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

int sipQSGMaterial::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  ::QSGMaterial::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* sipQSGMaterial::createShader() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return 0;

    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* sipQSGMaterial::type() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return 0;

    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_QSGMaterial_type, "type(self) -> QSGMaterialType");

extern "C" {static PyObject *meth_QSGMaterial_type(PyObject *, PyObject *);}
static PyObject *meth_QSGMaterial_type(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    PyObject *sipOrigSelf = sipSelf;

    {
        const  ::QSGMaterial *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QSGMaterial, sipName_type);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->type();

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

    sipNoMethod(sipParseErr, sipName_QSGMaterial, sipName_type, doc_QSGMaterial_type);

    return SIP_NULLPTR;
}


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

extern "C" {static PyObject *meth_QSGMaterial_createShader(PyObject *, PyObject *);}
static PyObject *meth_QSGMaterial_createShader(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    PyObject *sipOrigSelf = sipSelf;

    {
        const  ::QSGMaterial *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QSGMaterial, sipName_createShader);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->createShader();

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

    sipNoMethod(sipParseErr, sipName_QSGMaterial, sipName_createShader, doc_QSGMaterial_createShader);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGMaterial_compare, "compare(self, QSGMaterial) -> int");

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

    {
        const  ::QSGMaterial* a0;
        const  ::QSGMaterial *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QSGMaterial, &sipCpp, sipType_QSGMaterial, &a0))
        {
            int sipRes;

            sipRes = (sipSelfWasArg ? sipCpp-> ::QSGMaterial::compare(a0) : sipCpp->compare(a0));

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSGMaterial, sipName_compare, doc_QSGMaterial_compare);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGMaterial_flags, "flags(self) -> QSGMaterial.Flags");

extern "C" {static PyObject *meth_QSGMaterial_flags(PyObject *, PyObject *);}
static PyObject *meth_QSGMaterial_flags(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QSGMaterial *sipCpp;

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

            sipRes = new  ::QSGMaterial::Flags(sipCpp->flags());

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

    sipNoMethod(sipParseErr, sipName_QSGMaterial, sipName_flags, doc_QSGMaterial_flags);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGMaterial_setFlag, "setFlag(self, Union[QSGMaterial.Flags, QSGMaterial.Flag], enabled: bool = True)");

extern "C" {static PyObject *meth_QSGMaterial_setFlag(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QSGMaterial_setFlag(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QSGMaterial::Flags* a0;
        int a0State = 0;
        bool a1 = 1;
         ::QSGMaterial *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|b", &sipSelf, sipType_QSGMaterial, &sipCpp, sipType_QSGMaterial_Flags, &a0, &a0State, &a1))
        {
            sipCpp->setFlag(*a0,a1);
            sipReleaseType(a0, sipType_QSGMaterial_Flags, a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QSGMaterial, sipName_setFlag, doc_QSGMaterial_setFlag);

    return SIP_NULLPTR;
}


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QSGMaterial[] = {
    {sipName_compare, meth_QSGMaterial_compare, METH_VARARGS, doc_QSGMaterial_compare},
    {sipName_createShader, meth_QSGMaterial_createShader, METH_VARARGS, doc_QSGMaterial_createShader},
    {sipName_flags, meth_QSGMaterial_flags, METH_VARARGS, doc_QSGMaterial_flags},
    {sipName_setFlag, SIP_MLMETH_CAST(meth_QSGMaterial_setFlag), METH_VARARGS|METH_KEYWORDS, doc_QSGMaterial_setFlag},
    {sipName_type, meth_QSGMaterial_type, METH_VARARGS, doc_QSGMaterial_type}
};

static sipEnumMemberDef enummembers_QSGMaterial[] = {
    {sipName_Blending, static_cast<int>( ::QSGMaterial::Blending), 59},
    {sipName_CustomCompileStep, static_cast<int>( ::QSGMaterial::CustomCompileStep), 59},
    {sipName_RequiresDeterminant, static_cast<int>( ::QSGMaterial::RequiresDeterminant), 59},
    {sipName_RequiresFullMatrix, static_cast<int>( ::QSGMaterial::RequiresFullMatrix), 59},
    {sipName_RequiresFullMatrixExceptTranslate, static_cast<int>( ::QSGMaterial::RequiresFullMatrixExceptTranslate), 59},
    {sipName_RhiShaderWanted, static_cast<int>( ::QSGMaterial::RhiShaderWanted), 59},
    {sipName_SupportsRhiShader, static_cast<int>( ::QSGMaterial::SupportsRhiShader), 59},
};

PyDoc_STRVAR(doc_QSGMaterial, "\1QSGMaterial()");


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


sipClassTypeDef sipTypeDef_QtQuick_QSGMaterial = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSGMaterial,
        SIP_NULLPTR,
        &plugin_QSGMaterial
    },
    {
        sipNameNr_QSGMaterial,
        {0, 0, 1},
        5, methods_QSGMaterial,
        7, enummembers_QSGMaterial,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QSGMaterial,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QSGMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSGMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QSGMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QSGMaterial),
};
