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

#include "sipAPI_grid.h"
        #include <wx/grid.h>
        #include <wx/event.h>
        #include <wx/event.h>


PyDoc_STRVAR(doc_wxGridActivationSource_GetOrigin, "GetOrigin() -> Origin\n"
"\n"
"Get the origin of the activation.");

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

    {
        const ::wxGridActivationSource *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridActivationSource, &sipCpp))
        {
            ::wxGridActivationSource::Origin sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetOrigin();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxGridActivationSource_Origin);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridActivationSource, sipName_GetOrigin, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridActivationSource_GetKeyEvent, "GetKeyEvent() -> wx.KeyEvent\n"
"\n"
"Get the key event corresponding to the key press activating the cell.");

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

    {
        const ::wxGridActivationSource *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridActivationSource, &sipCpp))
        {
            ::wxKeyEvent*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxKeyEvent(sipCpp->GetKeyEvent());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes, sipType_wxKeyEvent, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridActivationSource, sipName_GetKeyEvent, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridActivationSource_GetMouseEvent, "GetMouseEvent() -> wx.MouseEvent\n"
"\n"
"Get the mouse event corresponding to the click activating the cell.");

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

    {
        const ::wxGridActivationSource *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridActivationSource, &sipCpp))
        {
            ::wxMouseEvent*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxMouseEvent(sipCpp->GetMouseEvent());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes, sipType_wxMouseEvent, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridActivationSource, sipName_GetMouseEvent, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


static PyMethodDef methods_wxGridActivationSource[] = {
    {sipName_GetKeyEvent, meth_wxGridActivationSource_GetKeyEvent, METH_VARARGS, doc_wxGridActivationSource_GetKeyEvent},
    {sipName_GetMouseEvent, meth_wxGridActivationSource_GetMouseEvent, METH_VARARGS, doc_wxGridActivationSource_GetMouseEvent},
    {sipName_GetOrigin, meth_wxGridActivationSource_GetOrigin, METH_VARARGS, doc_wxGridActivationSource_GetOrigin}
};

static sipEnumMemberDef enummembers_wxGridActivationSource[] = {
    {sipName_Key, static_cast<int>(::wxGridActivationSource::Key), 6},
    {sipName_Mouse, static_cast<int>(::wxGridActivationSource::Mouse), 6},
    {sipName_Program, static_cast<int>(::wxGridActivationSource::Program), 6},
};

sipVariableDef variables_wxGridActivationSource[] = {
    {PropertyVariable, sipName_MouseEvent, &methods_wxGridActivationSource[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_KeyEvent, &methods_wxGridActivationSource[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGridActivationSource, "Represents a source of cell activation, which may be either a user\n"
"event (mouse or keyboard) or the program itself.");


sipClassTypeDef sipTypeDef__grid_wxGridActivationSource = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxGridActivationSource,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridActivationSource,
        {0, 0, 1},
        3, methods_wxGridActivationSource,
        3, enummembers_wxGridActivationSource,
        2, variables_wxGridActivationSource,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGridActivationSource,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridActivationSource,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridActivationSource,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
