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

#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtGui/qpainterstateguard.sip"
#include <qpainterstateguard.h>
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtGui/sipQtGuiQPainterStateGuard.cpp"

#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtGui/qpainter.sip"
#include <qpainter.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtGui/sipQtGuiQPainterStateGuard.cpp"


PyDoc_STRVAR(doc_QPainterStateGuard_swap, "swap(self, other: QPainterStateGuard)");

extern "C" {static PyObject *meth_QPainterStateGuard_swap(PyObject *, PyObject *);}
static PyObject *meth_QPainterStateGuard_swap(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QPainterStateGuard* a0;
        ::QPainterStateGuard *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QPainterStateGuard, &sipCpp, sipType_QPainterStateGuard, &a0))
        {
            sipCpp->swap(*a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QPainterStateGuard, sipName_swap, doc_QPainterStateGuard_swap);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPainterStateGuard_save, "save(self)");

extern "C" {static PyObject *meth_QPainterStateGuard_save(PyObject *, PyObject *);}
static PyObject *meth_QPainterStateGuard_save(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QPainterStateGuard *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QPainterStateGuard, &sipCpp))
        {
            sipCpp->save();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QPainterStateGuard, sipName_save, doc_QPainterStateGuard_save);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPainterStateGuard_restore, "restore(self)");

extern "C" {static PyObject *meth_QPainterStateGuard_restore(PyObject *, PyObject *);}
static PyObject *meth_QPainterStateGuard_restore(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QPainterStateGuard *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QPainterStateGuard, &sipCpp))
        {
            sipCpp->restore();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QPainterStateGuard, sipName_restore, doc_QPainterStateGuard_restore);

    return SIP_NULLPTR;
}


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


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


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

    {
        ::QPainter* a0;
        ::QPainterStateGuard::InitialState a1 = QPainterStateGuard::InitialState::Save;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_state,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|E", sipType_QPainter, &a0, sipType_QPainterStateGuard_InitialState, &a1))
        {
            sipCpp = new ::QPainterStateGuard(a0, a1);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QPainterStateGuard[] = {
    {sipName_restore, meth_QPainterStateGuard_restore, METH_VARARGS, doc_QPainterStateGuard_restore},
    {sipName_save, meth_QPainterStateGuard_save, METH_VARARGS, doc_QPainterStateGuard_save},
    {sipName_swap, meth_QPainterStateGuard_swap, METH_VARARGS, doc_QPainterStateGuard_swap}
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QPainterStateGuard[] = {
    {sipName_Save, static_cast<int>(::QPainterStateGuard::InitialState::Save)},
    {sipName_NoSave, static_cast<int>(::QPainterStateGuard::InitialState::NoSave)},
    {0, 0}
};

PyDoc_STRVAR(doc_QPainterStateGuard, "\1QPainterStateGuard(painter: QPainter|None, state: QPainterStateGuard.InitialState = QPainterStateGuard.InitialState.Save)");


sipClassTypeDef sipTypeDef_QtGui_QPainterStateGuard = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QPainterStateGuard,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QPainterStateGuard,
        {0, 0, 1},
        3, methods_QPainterStateGuard,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QPainterStateGuard, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QPainterStateGuard,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QPainterStateGuard,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QPainterStateGuard,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QPainterStateGuard,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::QPainterStateGuard),
};
