/*
 * 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 350 "/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/sipQtWidgetsQStyleOptionButton.cpp"

#line 350 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qicon.sip"
#include <qicon.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qsize.sip"
#include <qsize.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 45 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"


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

    if (targetType == sipType_QStyleOptionButton)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const  ::QStyleOptionButton* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

static sipEnumMemberDef enummembers_QStyleOptionButton[] = {
    {sipName_AutoDefaultButton, static_cast<int>( ::QStyleOptionButton::AutoDefaultButton), 320},
    {sipName_CommandLinkButton, static_cast<int>( ::QStyleOptionButton::CommandLinkButton), 320},
    {sipName_DefaultButton, static_cast<int>( ::QStyleOptionButton::DefaultButton), 320},
    {sipName_Flat, static_cast<int>( ::QStyleOptionButton::Flat), 320},
    {sipName_HasMenu, static_cast<int>( ::QStyleOptionButton::HasMenu), 320},
    {sipName_None_, static_cast<int>( ::QStyleOptionButton::None), 320},
    {sipName_Type, static_cast<int>( ::QStyleOptionButton::Type), 322},
    {sipName_Version, static_cast<int>( ::QStyleOptionButton::Version), 323},
};


extern "C" {static PyObject *varget_QStyleOptionButton_features(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionButton_features(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QStyleOptionButton::ButtonFeatures*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -111);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->features;

    sipPy = sipConvertFromType(sipVal, sipType_QStyleOptionButton_ButtonFeatures, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -110, sipPySelf);
        sipKeepReference(sipPySelf, -111, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QStyleOptionButton_features(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionButton_features(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QStyleOptionButton::ButtonFeatures*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

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

    if (sipIsErr)
        return -1;

    sipCpp->features = *sipVal;

    sipReleaseType(sipVal, sipType_QStyleOptionButton_ButtonFeatures, sipValState);

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionButton_icon(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionButton_icon(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QIcon*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -112);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->icon;

    sipPy = sipConvertFromType(sipVal, sipType_QIcon, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -20, sipPySelf);
        sipKeepReference(sipPySelf, -112, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QStyleOptionButton_icon(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionButton_icon(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QIcon*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

    int sipIsErr = 0;
    sipVal = reinterpret_cast< ::QIcon *>(sipForceConvertToType(sipPy, sipType_QIcon, SIP_NULLPTR, SIP_NOT_NONE, SIP_NULLPTR, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->icon = *sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionButton_iconSize(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionButton_iconSize(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QSize*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -113);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->iconSize;

    sipPy = sipConvertFromType(sipVal, sipType_QSize, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -32, sipPySelf);
        sipKeepReference(sipPySelf, -113, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QStyleOptionButton_iconSize(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionButton_iconSize(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QSize*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

    int sipIsErr = 0;
    sipVal = reinterpret_cast< ::QSize *>(sipForceConvertToType(sipPy, sipType_QSize, SIP_NULLPTR, SIP_NOT_NONE, SIP_NULLPTR, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->iconSize = *sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionButton_text(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionButton_text(void *sipSelf, PyObject *, PyObject *)
{
     ::QString*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

    sipVal = &sipCpp->text;

    return sipConvertFromType(sipVal, sipType_QString, SIP_NULLPTR);
}


extern "C" {static int varset_QStyleOptionButton_text(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionButton_text(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QString*sipVal;
     ::QStyleOptionButton *sipCpp = reinterpret_cast< ::QStyleOptionButton *>(sipSelf);

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

    if (sipIsErr)
        return -1;

    sipCpp->text = *sipVal;

    sipReleaseType(sipVal, sipType_QString, sipValState);

    return 0;
}

sipVariableDef variables_QStyleOptionButton[] = {
    {InstanceVariable, sipName_features, (PyMethodDef *)varget_QStyleOptionButton_features, (PyMethodDef *)varset_QStyleOptionButton_features, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_icon, (PyMethodDef *)varget_QStyleOptionButton_icon, (PyMethodDef *)varset_QStyleOptionButton_icon, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_iconSize, (PyMethodDef *)varget_QStyleOptionButton_iconSize, (PyMethodDef *)varset_QStyleOptionButton_iconSize, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_text, (PyMethodDef *)varget_QStyleOptionButton_text, (PyMethodDef *)varset_QStyleOptionButton_text, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QStyleOptionButton, "\1QStyleOptionButton()\n"
"QStyleOptionButton(QStyleOptionButton)");


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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionButton = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionButton,
        SIP_NULLPTR,
        &plugin_QStyleOptionButton
    },
    {
        sipNameNr_QStyleOptionButton,
        {0, 0, 1},
        0, SIP_NULLPTR,
        8, enummembers_QStyleOptionButton,
        4, variables_QStyleOptionButton,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionButton,
    -1,
    -1,
    supers_QStyleOptionButton,
    SIP_NULLPTR,
    init_type_QStyleOptionButton,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionButton,
    assign_QStyleOptionButton,
    array_QStyleOptionButton,
    copy_QStyleOptionButton,
    release_QStyleOptionButton,
    cast_QStyleOptionButton,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionButton,
    sizeof ( ::QStyleOptionButton),
};
