/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     Copyright: (c) 2020 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_core.h"
        #include <wx/windowid.h>



PyDoc_STRVAR(doc_wxIdManager_ReserveId, "ReserveId(count=1) -> int\n"
"\n"
"Called directly by wxWindow::NewControlId(), this function will create\n"
"a new ID or range of IDs.");

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

    {
        int count = 1;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "|i", &count))
        {
            ::wxWindowID sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxIdManager::ReserveId(count);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_IdManager, sipName_ReserveId, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIdManager_UnreserveId, "UnreserveId(id, count=1) -> None\n"
"\n"
"Called directly by wxWindow::UnreserveControlId(), this function will\n"
"unreserve an ID or range of IDs that is currently reserved.");

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

    {
        ::wxWindowID id;
        int count = 1;

        static const char *sipKwdList[] = {
            sipName_id,
            sipName_count,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "i|i", &id, &count))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            ::wxIdManager::UnreserveId(id, count);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_IdManager, sipName_UnreserveId, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxIdManager(void *, int);}
static void release_wxIdManager(void *sipCppV, int)
{
    Py_BEGIN_ALLOW_THREADS

    delete reinterpret_cast< ::wxIdManager *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const ::wxIdManager* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxIdManager, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxIdManager(*a0);
            Py_END_ALLOW_THREADS

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxIdManager[] = {
    {sipName_ReserveId, SIP_MLMETH_CAST(meth_wxIdManager_ReserveId), METH_VARARGS|METH_KEYWORDS, doc_wxIdManager_ReserveId},
    {sipName_UnreserveId, SIP_MLMETH_CAST(meth_wxIdManager_UnreserveId), METH_VARARGS|METH_KEYWORDS, doc_wxIdManager_UnreserveId}
};

PyDoc_STRVAR(doc_wxIdManager, "wxIdManager is responsible for allocating and releasing window IDs.");


sipClassTypeDef sipTypeDef__core_wxIdManager = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxIdManager,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_IdManager,
        {0, 0, 1},
        2, methods_wxIdManager,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxIdManager,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxIdManager,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxIdManager,
    assign_wxIdManager,
    array_wxIdManager,
    copy_wxIdManager,
    release_wxIdManager,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxIdManager,
    sizeof (::wxIdManager),
};
