/*
 * 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/utils.h>
        #include <wx/window.h>


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

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

    Py_END_ALLOW_THREADS
}


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


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


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


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

    {
        bool disable = 1;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|b", &disable))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxWindowDisabler(disable);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    {
        ::wxWindow* winToSkip;
        ::wxWindow* winToSkip2 = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|J8", sipType_wxWindow, &winToSkip, sipType_wxWindow, &winToSkip2))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxWindowDisabler(winToSkip, winToSkip2);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}

PyDoc_STRVAR(doc_wxWindowDisabler, "WindowDisabler(disable=True) -> None\n"
"WindowDisabler(winToSkip, winToSkip2=None) -> None\n"
"\n"
"This class disables all top level windows of the application (maybe\n"
"with the exception of one of them) in its constructor and enables them\n"
"back in its destructor.");


sipClassTypeDef sipTypeDef__core_wxWindowDisabler = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxWindowDisabler,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_WindowDisabler,
        {0, 0, 1},
        0, SIP_NULLPTR,
        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_wxWindowDisabler,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxWindowDisabler,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxWindowDisabler,
    SIP_NULLPTR,
    array_wxWindowDisabler,
    SIP_NULLPTR,
    release_wxWindowDisabler,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxWindowDisabler,
    sizeof (::wxWindowDisabler),
};
