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

#line 27 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutexlocker.sip"
#include "qpycore_pyqtmutexlocker.h"
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"

#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutex.sip"
#include <qmutex.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"
#line 48 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutex.sip"
#include <qmutex.h>
#line 36 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"


PyDoc_STRVAR(doc_PyQtMutexLocker_mutex, "mutex(self) -> QMutex|QRecursiveMutex");

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

    {
        ::PyQtMutexLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_PyQtMutexLocker, &sipCpp))
        {
            PyObject * sipRes;

            sipRes = sipCpp->mutex();

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutexLocker, sipName_mutex, doc_PyQtMutexLocker_mutex);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_PyQtMutexLocker_unlock, "unlock(self)");

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

    {
        ::PyQtMutexLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_PyQtMutexLocker, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->unlock();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutexLocker, sipName_unlock, doc_PyQtMutexLocker_unlock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_PyQtMutexLocker_relock, "relock(self)");

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

    {
        ::PyQtMutexLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_PyQtMutexLocker, &sipCpp))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->relock();
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutexLocker, sipName_relock, doc_PyQtMutexLocker_relock);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_PyQtMutexLocker___enter__, "__enter__(self) -> Any");

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

    {
        ::PyQtMutexLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_PyQtMutexLocker, &sipCpp))
        {
            PyObject * sipRes = SIP_NULLPTR;

#line 53 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutexlocker.sip"
    // Just return a reference to self.
    sipRes = sipSelf;
    Py_INCREF(sipRes);
#line 137 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutexLocker, sipName___enter__, doc_PyQtMutexLocker___enter__);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_PyQtMutexLocker___exit__, "__exit__(self, type: Any, value: Any, traceback: Any)");

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

    {
        PyObject * a0;
        PyObject * a1;
        PyObject * a2;
        ::PyQtMutexLocker *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BP0P0P0", &sipSelf, sipType_PyQtMutexLocker, &sipCpp, &a0, &a1, &a2))
        {
#line 60 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutexlocker.sip"
    sipCpp->unlock();
#line 166 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QMutexLocker, sipName___exit__, doc_PyQtMutexLocker___exit__);

    return SIP_NULLPTR;
}


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


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


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

    {
        ::QMutex* a0;
        PyObject *a0Wrapper;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "@J8", &a0Wrapper, sipType_QMutex, &a0))
        {
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutexlocker.sip"
    Py_BEGIN_ALLOW_THREADS
    sipCpp = new PyQtMutexLocker(a0, a0Wrapper);
    Py_END_ALLOW_THREADS
#line 212 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"

            return sipCpp;
        }
    }

    {
        ::QRecursiveMutex* a0;
        PyObject *a0Wrapper;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "@J8", &a0Wrapper, sipType_QRecursiveMutex, &a0))
        {
#line 40 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qmutexlocker.sip"
    Py_BEGIN_ALLOW_THREADS
    sipCpp = new PyQtMutexLocker(a0, a0Wrapper);
    Py_END_ALLOW_THREADS
#line 228 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCorePyQtMutexLocker.cpp"

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_PyQtMutexLocker[] = {
    {sipName___enter__, meth_PyQtMutexLocker___enter__, METH_VARARGS, doc_PyQtMutexLocker___enter__},
    {sipName___exit__, meth_PyQtMutexLocker___exit__, METH_VARARGS, doc_PyQtMutexLocker___exit__},
    {sipName_mutex, meth_PyQtMutexLocker_mutex, METH_VARARGS, doc_PyQtMutexLocker_mutex},
    {sipName_relock, meth_PyQtMutexLocker_relock, METH_VARARGS, doc_PyQtMutexLocker_relock},
    {sipName_unlock, meth_PyQtMutexLocker_unlock, METH_VARARGS, doc_PyQtMutexLocker_unlock}
};

PyDoc_STRVAR(doc_PyQtMutexLocker, "\1QMutexLocker(mutex: QMutex|None)\n"
"QMutexLocker(mutex: QRecursiveMutex|None)");


sipClassTypeDef sipTypeDef_QtCore_PyQtMutexLocker = {
    {
        SIP_NULLPTR,
        SIP_TYPE_NONLAZY|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_PyQtMutexLocker,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QMutexLocker,
        {0, 0, 1},
        5, methods_PyQtMutexLocker,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_PyQtMutexLocker,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_PyQtMutexLocker,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_PyQtMutexLocker,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_PyQtMutexLocker,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::PyQtMutexLocker),
};
