/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.8.6
 *
 * Copyright (c) 2023 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 "sipAPIQtWidgets.h"

#line 712 "/usr/src/debug/python3-pyqt5/5.15.10/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/usr/src/debug/python3-pyqt5/5.15.10/QtWidgets/sipQtWidgetsQStyleOptionComplex.cpp"

#line 26 "/usr/src/debug/python3-pyqt5/5.15.10/sip/QtWidgets/qstyle.sip"
#include <qstyle.h>
#line 33 "/usr/src/debug/python3-pyqt5/5.15.10/QtWidgets/sipQtWidgetsQStyleOptionComplex.cpp"
#line 28 "/usr/src/debug/python3-pyqt5/5.15.10/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 36 "/usr/src/debug/python3-pyqt5/5.15.10/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::StyleOptionVersion::Version;
        int a1 = QStyleOption::OptionType::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[] = {{315, 255, 1}};

static sipEnumMemberDef enummembers_QStyleOptionComplex[] = {
    {sipName_Type, static_cast<int>(::QStyleOptionComplex::Type), 328},
    {sipName_Version, static_cast<int>(::QStyleOptionComplex::Version), 329},
};


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

    sipPy = sipGetReference(sipPySelf, -84);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->activeSubControls;

    sipPy = sipConvertFromType(sipVal, sipType_QStyle_SubControls, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -83, sipPySelf);
        sipKeepReference(sipPySelf, -84, sipPy);
    }

    return sipPy;
}


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_QStyle_SubControls, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->activeSubControls = *sipVal;

    sipReleaseType(sipVal, sipType_QStyle_SubControls, sipValState);

    return 0;
}


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

    sipPy = sipGetReference(sipPySelf, -86);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->subControls;

    sipPy = sipConvertFromType(sipVal, sipType_QStyle_SubControls, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -85, sipPySelf);
        sipKeepReference(sipPySelf, -86, sipPy);
    }

    return sipPy;
}


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_QStyle_SubControls, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->subControls = *sipVal;

    sipReleaseType(sipVal, sipType_QStyle_SubControls, 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},
};

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


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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionComplex = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionComplex,
        SIP_NULLPTR,
        &plugin_QStyleOptionComplex,
    },
    {
        sipNameNr_QStyleOptionComplex,
        {0, 0, 1},
        0, SIP_NULLPTR,
        2, enummembers_QStyleOptionComplex,
        2, variables_QStyleOptionComplex,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, 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),
};
