/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.3
 *
 * Copyright (c) 2026 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 379 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"

#line 25 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qflags.sip"
#include <qglobal.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtGui/qicon.sip"
#include <qicon.h>
#line 36 "/build/pyqt6/src/pyqt6-6.11.0/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 30 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qsize.sip"
#include <qsize.h>
#line 39 "/build/pyqt6/src/pyqt6-6.11.0/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 24 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 42 "/build/pyqt6/src/pyqt6-6.11.0/build/QtWidgets/sipQtWidgetsQStyleOptionButton.cpp"
#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 45 "/build/pyqt6/src/pyqt6-6.11.0/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[] = {{305, 255, 1}};


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

    sipVal = &sipCpp->features;

    return sipConvertFromType(sipVal, sipType_QFlags_0100QStyleOptionButton_ButtonFeature, SIP_NULLPTR);
}


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

    if (sipIsErr)
        return -1;

    sipCpp->features = *sipVal;

    sipReleaseType(sipVal, sipType_QFlags_0100QStyleOptionButton_ButtonFeature, 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, -83);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->icon;

    sipPy = sipConvertFromType(sipVal, sipType_QIcon, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -23, sipPySelf);
        sipKeepReference(sipPySelf, -83, 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, -84);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->iconSize;

    sipPy = sipConvertFromType(sipVal, sipType_QSize, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -21, sipPySelf);
        sipKeepReference(sipPySelf, -84, 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},
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QStyleOptionButton[] = {
    {sipName_None_, static_cast<int>(::QStyleOptionButton::None)},
    {sipName_Flat, static_cast<int>(::QStyleOptionButton::Flat)},
    {sipName_HasMenu, static_cast<int>(::QStyleOptionButton::HasMenu)},
    {sipName_DefaultButton, static_cast<int>(::QStyleOptionButton::DefaultButton)},
    {sipName_AutoDefaultButton, static_cast<int>(::QStyleOptionButton::AutoDefaultButton)},
    {sipName_CommandLinkButton, static_cast<int>(::QStyleOptionButton::CommandLinkButton)},
    {sipName_Type, static_cast<int>(::QStyleOptionButton::Type)},
    {sipName_Version, static_cast<int>(::QStyleOptionButton::Version)},
    {0, 0}
};

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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionButton = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionButton,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QStyleOptionButton,
        {0, 0, 1},
        0, SIP_NULLPTR,
        4, variables_QStyleOptionButton,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QStyleOptionButton, 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),
};
