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

        #include <wx/timer.h>


PyDoc_STRVAR(doc_wxTimerRunner_Start, "Start(milli, oneShot=False)");

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

    {
        int milli;
        bool oneShot = 0;
         ::wxTimerRunner *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi|b", &sipSelf, sipType_wxTimerRunner, &sipCpp, &milli, &oneShot))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Start(milli,oneShot);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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

    {
         ::wxTimer* timer;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxTimer, &timer))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxTimerRunner(*timer);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
         ::wxTimer* timer;
        int milli;
        bool oneShot = 0;

        static const char *sipKwdList[] = {
            sipName_timer,
            sipName_milli,
            sipName_oneShot,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9i|b", sipType_wxTimer, &timer, &milli, &oneShot))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxTimerRunner(*timer,milli,oneShot);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxTimerRunner[] = {
    {SIP_MLNAME_CAST(sipName_Start), SIP_MLMETH_CAST(meth_wxTimerRunner_Start), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTimerRunner_Start)}
};

PyDoc_STRVAR(doc_wxTimerRunner, "TimerRunner(timer)\n"
"TimerRunner(timer, milli, oneShot=False)\n"
"\n"
"Starts the timer in its ctor, stops in the dtor.");


sipClassTypeDef sipTypeDef__core_wxTimerRunner = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxTimerRunner,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_TimerRunner,
        {0, 0, 1},
        1, methods_wxTimerRunner,
        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_wxTimerRunner,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxTimerRunner,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxTimerRunner,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxTimerRunner,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
