/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.7.0
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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 "sipAPIQtWidgets.h"

#line 712 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionComplex.cpp"

#line 25 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qflags.sip"
#include <qglobal.h>
#line 33 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionComplex.cpp"
#line 26 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtWidgets/qstyle.sip"
#include <qstyle.h>
#line 36 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionComplex.cpp"
#line 28 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 39 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionComplex.cpp"


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

    if (targetType == sipType_QStyleOptionComplex)
        return sipCppV;

    if (targetType == sipType_QStyleOption)
        return static_cast< ::QStyleOption *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QStyleOptionComplex(void *, int);}
static void release_QStyleOptionComplex(void *sipCppV, int)
{
    delete reinterpret_cast< ::QStyleOptionComplex *>(sipCppV);
}


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


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


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


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


extern "C" {static void dealloc_QStyleOptionComplex(sipSimpleWrapper *);}
static void dealloc_QStyleOptionComplex(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QStyleOptionComplex(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QStyleOptionComplex(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QStyleOptionComplex(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QStyleOptionComplex *sipCpp = SIP_NULLPTR;

    {
        int a0 = QStyleOptionComplex::Version;
        int a1 = QStyleOption::SO_Complex;

        static const char *sipKwdList[] = {
            sipName_version,
            sipName_type,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|ii", &a0, &a1))
        {
            sipCpp = new  ::QStyleOptionComplex(a0,a1);

            return sipCpp;
        }
    }

    {
        const  ::QStyleOptionComplex* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


extern "C" {static PyObject *varget_QStyleOptionComplex_activeSubControls(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionComplex_activeSubControls(void *sipSelf, PyObject *, PyObject *)
{
     ::QStyle::SubControls*sipVal;
     ::QStyleOptionComplex *sipCpp = reinterpret_cast< ::QStyleOptionComplex *>(sipSelf);

    sipVal = &sipCpp->activeSubControls;

    return sipConvertFromType(sipVal, sipType_QFlags_0100QStyle_SubControl, SIP_NULLPTR);
}


extern "C" {static int varset_QStyleOptionComplex_activeSubControls(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionComplex_activeSubControls(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QStyle::SubControls*sipVal;
     ::QStyleOptionComplex *sipCpp = reinterpret_cast< ::QStyleOptionComplex *>(sipSelf);

    int sipIsErr = 0;
    int sipValState;
    sipVal = reinterpret_cast< ::QStyle::SubControls *>(sipForceConvertToType(sipPy, sipType_QFlags_0100QStyle_SubControl, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->activeSubControls = *sipVal;

    sipReleaseType(sipVal, sipType_QFlags_0100QStyle_SubControl, sipValState);

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionComplex_subControls(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionComplex_subControls(void *sipSelf, PyObject *, PyObject *)
{
     ::QStyle::SubControls*sipVal;
     ::QStyleOptionComplex *sipCpp = reinterpret_cast< ::QStyleOptionComplex *>(sipSelf);

    sipVal = &sipCpp->subControls;

    return sipConvertFromType(sipVal, sipType_QFlags_0100QStyle_SubControl, SIP_NULLPTR);
}


extern "C" {static int varset_QStyleOptionComplex_subControls(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionComplex_subControls(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QStyle::SubControls*sipVal;
     ::QStyleOptionComplex *sipCpp = reinterpret_cast< ::QStyleOptionComplex *>(sipSelf);

    int sipIsErr = 0;
    int sipValState;
    sipVal = reinterpret_cast< ::QStyle::SubControls *>(sipForceConvertToType(sipPy, sipType_QFlags_0100QStyle_SubControl, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->subControls = *sipVal;

    sipReleaseType(sipVal, sipType_QFlags_0100QStyle_SubControl, sipValState);

    return 0;
}

sipVariableDef variables_QStyleOptionComplex[] = {
    {InstanceVariable, sipName_activeSubControls, (PyMethodDef *)varget_QStyleOptionComplex_activeSubControls, (PyMethodDef *)varset_QStyleOptionComplex_activeSubControls, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_subControls, (PyMethodDef *)varget_QStyleOptionComplex_subControls, (PyMethodDef *)varset_QStyleOptionComplex_subControls, SIP_NULLPTR, SIP_NULLPTR},
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QStyleOptionComplex[] = {
    {sipName_Type, static_cast<int>( ::QStyleOptionComplex::Type)},
    {sipName_Version, static_cast<int>( ::QStyleOptionComplex::Version)},
    {0, 0}
};

PyDoc_STRVAR(doc_QStyleOptionComplex, "\1QStyleOptionComplex(version: int = QStyleOptionComplex.Version, type: int = QStyleOption.SO_Complex)\n"
"QStyleOptionComplex(QStyleOptionComplex)");


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionComplex = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionComplex,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QStyleOptionComplex,
        {0, 0, 1},
        0, SIP_NULLPTR,
        2, variables_QStyleOptionComplex,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QStyleOptionComplex, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionComplex,
    -1,
    -1,
    supers_QStyleOptionComplex,
    SIP_NULLPTR,
    init_type_QStyleOptionComplex,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionComplex,
    assign_QStyleOptionComplex,
    array_QStyleOptionComplex,
    copy_QStyleOptionComplex,
    release_QStyleOptionComplex,
    cast_QStyleOptionComplex,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionComplex,
    sizeof ( ::QStyleOptionComplex),
};
