/*
 * 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 "sipAPIQtWidgets.h"

#line 186 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionFocusRect.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qcolor.sip"
#include <qcolor.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionFocusRect.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionFocusRect.cpp"


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

    if (targetType == sipType_QStyleOptionFocusRect)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const  ::QStyleOptionFocusRect* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

static sipEnumMemberDef enummembers_QStyleOptionFocusRect[] = {
    {sipName_Type, static_cast<int>( ::QStyleOptionFocusRect::Type), 334},
    {sipName_Version, static_cast<int>( ::QStyleOptionFocusRect::Version), 335},
};


extern "C" {static PyObject *varget_QStyleOptionFocusRect_backgroundColor(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionFocusRect_backgroundColor(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QColor*sipVal;
     ::QStyleOptionFocusRect *sipCpp = reinterpret_cast< ::QStyleOptionFocusRect *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -126);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->backgroundColor;

    sipPy = sipConvertFromType(sipVal, sipType_QColor, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -22, sipPySelf);
        sipKeepReference(sipPySelf, -126, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QStyleOptionFocusRect_backgroundColor(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionFocusRect_backgroundColor(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QColor*sipVal;
     ::QStyleOptionFocusRect *sipCpp = reinterpret_cast< ::QStyleOptionFocusRect *>(sipSelf);

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

    if (sipIsErr)
        return -1;

    sipCpp->backgroundColor = *sipVal;

    sipReleaseType(sipVal, sipType_QColor, sipValState);

    return 0;
}

sipVariableDef variables_QStyleOptionFocusRect[] = {
    {InstanceVariable, sipName_backgroundColor, (PyMethodDef *)varget_QStyleOptionFocusRect_backgroundColor, (PyMethodDef *)varset_QStyleOptionFocusRect_backgroundColor, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QStyleOptionFocusRect, "\1QStyleOptionFocusRect()\n"
"QStyleOptionFocusRect(QStyleOptionFocusRect)");


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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionFocusRect = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionFocusRect,
        SIP_NULLPTR,
        &plugin_QStyleOptionFocusRect
    },
    {
        sipNameNr_QStyleOptionFocusRect,
        {0, 0, 1},
        0, SIP_NULLPTR,
        2, enummembers_QStyleOptionFocusRect,
        1, variables_QStyleOptionFocusRect,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionFocusRect,
    -1,
    -1,
    supers_QStyleOptionFocusRect,
    SIP_NULLPTR,
    init_type_QStyleOptionFocusRect,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionFocusRect,
    assign_QStyleOptionFocusRect,
    array_QStyleOptionFocusRect,
    copy_QStyleOptionFocusRect,
    release_QStyleOptionFocusRect,
    cast_QStyleOptionFocusRect,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionFocusRect,
    sizeof ( ::QStyleOptionFocusRect),
};
