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

#include "sipAPI_core.h"

        #include <wx/process.h>

        #include <wx/object.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxProcessEvent : public  ::wxProcessEvent
{
public:
    sipwxProcessEvent(int,int,int);
    sipwxProcessEvent(const  ::wxProcessEvent&);
    virtual ~sipwxProcessEvent();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxEvent* Clone() const SIP_OVERRIDE;
     ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxProcessEvent(const sipwxProcessEvent &);
    sipwxProcessEvent &operator = (const sipwxProcessEvent &);

    char sipPyMethods[2];
};

sipwxProcessEvent::sipwxProcessEvent(int id,int pid,int exitcode):  ::wxProcessEvent(id,pid,exitcode), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxProcessEvent::sipwxProcessEvent(const  ::wxProcessEvent& a0):  ::wxProcessEvent(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

 ::wxEvent* sipwxProcessEvent::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,sipName_ProcessEvent,sipName_Clone);

    if (!sipMeth)
        return 0;

    extern  ::wxEvent* sipVH__core_91(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__core_91(sipGILState, 0, sipPySelf, sipMeth);
}

 ::wxEventCategory sipwxProcessEvent::GetEventCategory() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[1]),sipPySelf,SIP_NULLPTR,sipName_GetEventCategory);

    if (!sipMeth)
        return  ::wxProcessEvent::GetEventCategory();

    extern  ::wxEventCategory sipVH__core_92(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__core_92(sipGILState, 0, sipPySelf, sipMeth);
}


PyDoc_STRVAR(doc_wxProcessEvent_GetExitCode, "GetExitCode() -> int\n"
"\n"
"Returns the exist status.");

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

    {
         ::wxProcessEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxProcessEvent, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetExitCode();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_ProcessEvent, sipName_GetExitCode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxProcessEvent_GetPid, "GetPid() -> int\n"
"\n"
"Returns the process id.");

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

    {
         ::wxProcessEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxProcessEvent, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetPid();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_ProcessEvent, sipName_GetPid, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxProcessEvent(void *, const sipTypeDef *);}
static void *cast_wxProcessEvent(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxProcessEvent *sipCpp = reinterpret_cast< ::wxProcessEvent *>(sipCppV);

    if (targetType == sipType_wxEvent)
        return static_cast< ::wxEvent *>(sipCpp);

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxProcessEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxProcessEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        int id = 0;
        int pid = 0;
        int exitcode = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iii", &id, &pid, &exitcode))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxProcessEvent(id,pid,exitcode);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxProcessEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxProcessEvent[] = {{140, 255, 1}};


static PyMethodDef methods_wxProcessEvent[] = {
    {SIP_MLNAME_CAST(sipName_GetExitCode), meth_wxProcessEvent_GetExitCode, METH_VARARGS, SIP_MLDOC_CAST(doc_wxProcessEvent_GetExitCode)},
    {SIP_MLNAME_CAST(sipName_GetPid), meth_wxProcessEvent_GetPid, METH_VARARGS, SIP_MLDOC_CAST(doc_wxProcessEvent_GetPid)}
};

sipVariableDef variables_wxProcessEvent[] = {
    {PropertyVariable, sipName_Pid, &methods_wxProcessEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_ExitCode, &methods_wxProcessEvent[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxProcessEvent, "ProcessEvent(id=0, pid=0, exitcode=0)\n"
"\n"
"A process event is sent to the wxEvtHandler specified to wxProcess\n"
"when a process is terminated.");


sipClassTypeDef sipTypeDef__core_wxProcessEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxProcessEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_ProcessEvent,
        {0, 0, 1},
        2, methods_wxProcessEvent,
        0, SIP_NULLPTR,
        2, variables_wxProcessEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxProcessEvent,
    -1,
    -1,
    supers_wxProcessEvent,
    SIP_NULLPTR,
    init_type_wxProcessEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxProcessEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxProcessEvent,
    cast_wxProcessEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
