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

#include "sipAPI_core.h"
        #include <wx/busyinfo.h>
        #include <wx/busyinfo.h>
        #include <wx/window.h>


class sipwxBusyInfo : public  ::wxBusyInfo
{
public:
    sipwxBusyInfo(const  ::wxBusyInfoFlags&);
    sipwxBusyInfo(const  ::wxString&, ::wxWindow*);
    ~sipwxBusyInfo();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxBusyInfo(const sipwxBusyInfo &);
    sipwxBusyInfo &operator = (const sipwxBusyInfo &);
};

sipwxBusyInfo::sipwxBusyInfo(const  ::wxBusyInfoFlags& flags):  ::wxBusyInfo(flags), sipPySelf(SIP_NULLPTR)
{
}

sipwxBusyInfo::sipwxBusyInfo(const  ::wxString& msg, ::wxWindow*parent):  ::wxBusyInfo(msg,parent), sipPySelf(SIP_NULLPTR)
{
}

sipwxBusyInfo::~sipwxBusyInfo()
{
    sipInstanceDestroyedEx(&sipPySelf);
}


PyDoc_STRVAR(doc_wxBusyInfo_UpdateText, "UpdateText(str)\n"
"\n"
"Update the information text.");

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

    {
        const  ::wxString* str;
        int strState = 0;
         ::wxBusyInfo *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxBusyInfo, &sipCpp, sipType_wxString, &str, &strState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->UpdateText(*str);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(str), sipType_wxString, strState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_BusyInfo, sipName_UpdateText, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxBusyInfo_UpdateLabel, "UpdateLabel(str)\n"
"\n"
"Same as UpdateText() but doesn't interpret the string as containing\n"
"markup.");

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

    {
        const  ::wxString* str;
        int strState = 0;
         ::wxBusyInfo *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxBusyInfo, &sipCpp, sipType_wxString, &str, &strState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->UpdateLabel(*str);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(str), sipType_wxString, strState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_BusyInfo, sipName_UpdateLabel, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxBusyInfo *>(sipCppV);
    else
        delete reinterpret_cast< ::wxBusyInfo *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_wxBusyInfo(sipSimpleWrapper *);}
static void dealloc_wxBusyInfo(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipwxBusyInfo *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxBusyInfo(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_wxBusyInfo(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxBusyInfo(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipwxBusyInfo *sipCpp = SIP_NULLPTR;

    {
        const  ::wxBusyInfoFlags* flags;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxBusyInfoFlags, &flags))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxBusyInfo(*flags);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxString* msg;
        int msgState = 0;
         ::wxWindow* parent = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|J8", sipType_wxString, &msg, &msgState, sipType_wxWindow, &parent))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxBusyInfo(*msg,parent);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(msg), sipType_wxString, msgState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxBusyInfo[] = {
    {sipName_UpdateLabel, SIP_MLMETH_CAST(meth_wxBusyInfo_UpdateLabel), METH_VARARGS|METH_KEYWORDS, doc_wxBusyInfo_UpdateLabel},
    {sipName_UpdateText, SIP_MLMETH_CAST(meth_wxBusyInfo_UpdateText), METH_VARARGS|METH_KEYWORDS, doc_wxBusyInfo_UpdateText}
};

PyDoc_STRVAR(doc_wxBusyInfo, "BusyInfo(flags)\n"
"BusyInfo(msg, parent=None)\n"
"\n"
"This class makes it easy to tell your user that the program is\n"
"temporarily busy.");


sipClassTypeDef sipTypeDef__core_wxBusyInfo = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxBusyInfo,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_BusyInfo,
        {0, 0, 1},
        2, methods_wxBusyInfo,
        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_wxBusyInfo,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxBusyInfo,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxBusyInfo,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxBusyInfo,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
