/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.14.0
 *
 * Copyright (c) 2024 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 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtQuick/qsgflatcolormaterial.sip"
#include <qsgflatcolormaterial.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtQuick/sipQtQuickQSGFlatColorMaterial.cpp"

#line 183 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtQuick/sipQtQuickQSGFlatColorMaterial.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtGui/qcolor.sip"
#include <qcolor.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.11/build/QtQuick/sipQtQuickQSGFlatColorMaterial.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.11/build/QtQuick/sipQtQuickQSGFlatColorMaterial.cpp"
#line 176 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.11/build/QtQuick/sipQtQuickQSGFlatColorMaterial.cpp"
#line 183 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtQuick/qsgmaterial.sip"
#include <qsgmaterial.h>
#line 45 "/build/pyqt5/src/PyQt5-5.15.11/build/QtQuick/sipQtQuickQSGFlatColorMaterial.cpp"


class sipQSGFlatColorMaterial : public ::QSGFlatColorMaterial
{
public:
    sipQSGFlatColorMaterial();
    virtual ~sipQSGFlatColorMaterial();

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

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[3];
};

sipQSGFlatColorMaterial::sipQSGFlatColorMaterial(): ::QSGFlatColorMaterial(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

    if (!sipMeth)
        return ::QSGFlatColorMaterial::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);
}

::QSGMaterialShader* sipQSGFlatColorMaterial::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 ::QSGFlatColorMaterial::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);
}

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

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

    if (!sipMeth)
        return ::QSGFlatColorMaterial::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);
}


PyDoc_STRVAR(doc_QSGFlatColorMaterial_type, "type(self) -> Optional[QSGMaterialType]");

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

    {
        const ::QSGFlatColorMaterial *sipCpp;

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

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

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

    sipNoMethod(sipParseErr, sipName_QSGFlatColorMaterial, sipName_type, doc_QSGFlatColorMaterial_type);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGFlatColorMaterial_createShader, "createShader(self) -> Optional[QSGMaterialShader]");

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

    {
        const ::QSGFlatColorMaterial *sipCpp;

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

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

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

    sipNoMethod(sipParseErr, sipName_QSGFlatColorMaterial, sipName_createShader, doc_QSGFlatColorMaterial_createShader);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGFlatColorMaterial_setColor, "setColor(self, color: Union[QColor, Qt.GlobalColor])");

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

    {
        const ::QColor* a0;
        int a0State = 0;
        ::QSGFlatColorMaterial *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QSGFlatColorMaterial, &sipCpp, sipType_QColor, &a0, &a0State))
        {
            sipCpp->setColor(*a0);
            sipReleaseType(const_cast< ::QColor *>(a0), sipType_QColor, a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QSGFlatColorMaterial, sipName_setColor, doc_QSGFlatColorMaterial_setColor);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGFlatColorMaterial_color, "color(self) -> QColor");

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

    {
        const ::QSGFlatColorMaterial *sipCpp;

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

            sipRes = new ::QColor(sipCpp->color());

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

    sipNoMethod(sipParseErr, sipName_QSGFlatColorMaterial, sipName_color, doc_QSGFlatColorMaterial_color);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSGFlatColorMaterial_compare, "compare(self, other: Optional[QSGMaterial]) -> int");

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

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

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

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

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSGFlatColorMaterial, sipName_compare, doc_QSGFlatColorMaterial_compare);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QSGFlatColorMaterial)
        return sipCppV;

    if (targetType == sipType_QSGMaterial)
        return static_cast< ::QSGMaterial *>(sipCpp);

    return SIP_NULLPTR;
}


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


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


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_QSGFlatColorMaterial[] = {
    {sipName_color, meth_QSGFlatColorMaterial_color, METH_VARARGS, doc_QSGFlatColorMaterial_color},
    {sipName_compare, meth_QSGFlatColorMaterial_compare, METH_VARARGS, doc_QSGFlatColorMaterial_compare},
    {sipName_createShader, meth_QSGFlatColorMaterial_createShader, METH_VARARGS, doc_QSGFlatColorMaterial_createShader},
    {sipName_setColor, meth_QSGFlatColorMaterial_setColor, METH_VARARGS, doc_QSGFlatColorMaterial_setColor},
    {sipName_type, meth_QSGFlatColorMaterial_type, METH_VARARGS, doc_QSGFlatColorMaterial_type}
};

PyDoc_STRVAR(doc_QSGFlatColorMaterial, "\1QSGFlatColorMaterial()");


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


sipClassTypeDef sipTypeDef_QtQuick_QSGFlatColorMaterial = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSGFlatColorMaterial,
        SIP_NULLPTR,
        &plugin_QSGFlatColorMaterial,
    },
    {
        sipNameNr_QSGFlatColorMaterial,
        {0, 0, 1},
        5, methods_QSGFlatColorMaterial,
        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_QSGFlatColorMaterial,
    -1,
    -1,
    supers_QSGFlatColorMaterial,
    SIP_NULLPTR,
    init_type_QSGFlatColorMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSGFlatColorMaterial,
    SIP_NULLPTR,
    array_QSGFlatColorMaterial,
    SIP_NULLPTR,
    release_QSGFlatColorMaterial,
    cast_QSGFlatColorMaterial,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QSGFlatColorMaterial,
    sizeof (::QSGFlatColorMaterial),
};
