/*
 * 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/grid.h>
        #include <wx/window.h>
        #include <wx/event.h>
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/control.h>
        #include <wx/event.h>
        #include <wx/grid.h>
        #include <wx/gdicmn.h>
        #include <wx/dc.h>
    PyObject* _wxGridCellBoolEditor_EndEdit(wxGridCellBoolEditor* self, int row, int col, const wxGrid* grid, const wxString* oldval)
    {
        bool rv;
        wxString newval;
        rv = self->EndEdit(row, col, grid, *oldval, &newval);
        if (rv) {
            return wx2PyString(newval);
        }
        else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }


class sipwxGridCellBoolEditor : public ::wxGridCellBoolEditor
{
public:
    sipwxGridCellBoolEditor();
    virtual ~sipwxGridCellBoolEditor();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void BeginEdit(int, int, ::wxGrid*) SIP_OVERRIDE;
    ::wxGridCellEditor* Clone() const SIP_OVERRIDE;
    void Create(::wxWindow*, ::wxWindowID, ::wxEvtHandler*) SIP_OVERRIDE;
    void Destroy() SIP_OVERRIDE;
    bool EndEdit(int, int, const ::wxGrid*, const ::wxString&, ::wxString*) SIP_OVERRIDE;
    void ApplyEdit(int, int, ::wxGrid*) SIP_OVERRIDE;
    void HandleReturn(::wxKeyEvent&) SIP_OVERRIDE;
    void PaintBackground(::wxDC&, const ::wxRect&, const ::wxGridCellAttr&) SIP_OVERRIDE;
    void Reset() SIP_OVERRIDE;
    void SetSize(const ::wxRect&) SIP_OVERRIDE;
    void Show(bool, ::wxGridCellAttr*) SIP_OVERRIDE;
    void StartingClick() SIP_OVERRIDE;
    void StartingKey(::wxKeyEvent&) SIP_OVERRIDE;
    bool IsAcceptedKey(::wxKeyEvent&) SIP_OVERRIDE;
    ::wxString GetValue() const SIP_OVERRIDE;
    ::wxGridActivationResult TryActivate(int, int, ::wxGrid*, const ::wxGridActivationSource&) SIP_OVERRIDE;
    void DoActivate(int, int, ::wxGrid*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[17];
};

sipwxGridCellBoolEditor::sipwxGridCellBoolEditor(): ::wxGridCellBoolEditor(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxGridCellBoolEditor::BeginEdit(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_BeginEdit);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::BeginEdit(row, col, grid);
        return;
    }

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}

::wxGridCellEditor* sipwxGridCellBoolEditor::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxGridCellBoolEditor::Clone();

    extern ::wxGridCellEditor* sipVH__grid_7(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

void sipwxGridCellBoolEditor::Create(::wxWindow*parent, ::wxWindowID id, ::wxEvtHandler*evtHandler)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, SIP_NULLPTR, sipName_Create);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::Create(parent, id, evtHandler);
        return;
    }

    extern void sipVH__grid_8(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindow*, ::wxWindowID, ::wxEvtHandler*);

    sipVH__grid_8(sipGILState, 0, sipPySelf, sipMeth, parent, id, evtHandler);
}

void sipwxGridCellBoolEditor::Destroy()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_Destroy);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::Destroy();
        return;
    }

    extern void sipVH__grid_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__grid_9(sipGILState, 0, sipPySelf, sipMeth);
}

bool sipwxGridCellBoolEditor::EndEdit(int row, int col, const ::wxGrid*grid, const ::wxString& oldval, ::wxString*newval)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[4], &sipPySelf, SIP_NULLPTR, sipName_EndEdit);

    if (!sipMeth)
        return ::wxGridCellBoolEditor::EndEdit(row, col, grid, oldval, newval);

    extern bool sipVH__grid_10(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, const ::wxGrid*, const ::wxString&, ::wxString*);

    return sipVH__grid_10(sipGILState, 0, sipPySelf, sipMeth, row, col, grid, oldval, newval);
}

void sipwxGridCellBoolEditor::ApplyEdit(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, SIP_NULLPTR, sipName_ApplyEdit);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::ApplyEdit(row, col, grid);
        return;
    }

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}

void sipwxGridCellBoolEditor::HandleReturn(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[6], &sipPySelf, SIP_NULLPTR, sipName_HandleReturn);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::HandleReturn(event);
        return;
    }

    extern void sipVH__grid_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    sipVH__grid_11(sipGILState, 0, sipPySelf, sipMeth, event);
}

void sipwxGridCellBoolEditor::PaintBackground(::wxDC& dc, const ::wxRect& rectCell, const ::wxGridCellAttr& attr)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[7], &sipPySelf, SIP_NULLPTR, sipName_PaintBackground);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::PaintBackground(dc, rectCell, attr);
        return;
    }

    extern void sipVH__grid_12(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxDC&, const ::wxRect&, const ::wxGridCellAttr&);

    sipVH__grid_12(sipGILState, 0, sipPySelf, sipMeth, dc, rectCell, attr);
}

void sipwxGridCellBoolEditor::Reset()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[8], &sipPySelf, SIP_NULLPTR, sipName_Reset);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::Reset();
        return;
    }

    extern void sipVH__grid_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__grid_9(sipGILState, 0, sipPySelf, sipMeth);
}

void sipwxGridCellBoolEditor::SetSize(const ::wxRect& rect)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[9], &sipPySelf, SIP_NULLPTR, sipName_SetSize);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::SetSize(rect);
        return;
    }

    extern void sipVH__grid_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxRect&);

    sipVH__grid_13(sipGILState, 0, sipPySelf, sipMeth, rect);
}

void sipwxGridCellBoolEditor::Show(bool show, ::wxGridCellAttr*attr)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[10], &sipPySelf, SIP_NULLPTR, sipName_Show);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::Show(show, attr);
        return;
    }

    extern void sipVH__grid_14(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, bool, ::wxGridCellAttr*);

    sipVH__grid_14(sipGILState, 0, sipPySelf, sipMeth, show, attr);
}

void sipwxGridCellBoolEditor::StartingClick()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[11], &sipPySelf, SIP_NULLPTR, sipName_StartingClick);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::StartingClick();
        return;
    }

    extern void sipVH__grid_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__grid_9(sipGILState, 0, sipPySelf, sipMeth);
}

void sipwxGridCellBoolEditor::StartingKey(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[12], &sipPySelf, SIP_NULLPTR, sipName_StartingKey);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::StartingKey(event);
        return;
    }

    extern void sipVH__grid_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    sipVH__grid_11(sipGILState, 0, sipPySelf, sipMeth, event);
}

bool sipwxGridCellBoolEditor::IsAcceptedKey(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[13], &sipPySelf, SIP_NULLPTR, sipName_IsAcceptedKey);

    if (!sipMeth)
        return ::wxGridCellBoolEditor::IsAcceptedKey(event);

    extern bool sipVH__grid_15(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    return sipVH__grid_15(sipGILState, 0, sipPySelf, sipMeth, event);
}

::wxString sipwxGridCellBoolEditor::GetValue() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[14]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetValue);

    if (!sipMeth)
        return ::wxGridCellBoolEditor::GetValue();

    extern ::wxString sipVH__grid_16(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

::wxGridActivationResult sipwxGridCellBoolEditor::TryActivate(int row, int col, ::wxGrid*grid, const ::wxGridActivationSource& actSource)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[15], &sipPySelf, SIP_NULLPTR, sipName_TryActivate);

    if (!sipMeth)
        return ::wxGridCellBoolEditor::TryActivate(row, col, grid, actSource);

    extern ::wxGridActivationResult sipVH__grid_17(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*, const ::wxGridActivationSource&);

    return sipVH__grid_17(sipGILState, 0, sipPySelf, sipMeth, row, col, grid, actSource);
}

void sipwxGridCellBoolEditor::DoActivate(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[16], &sipPySelf, SIP_NULLPTR, sipName_DoActivate);

    if (!sipMeth)
    {
        ::wxGridCellBoolEditor::DoActivate(row, col, grid);
        return;
    }

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_IsTrueValue, "IsTrueValue(value) -> bool\n"
"\n"
"Returns true if the given value is equal to the string representation\n"
"of the truth value we currently use (see UseStringValues()).");

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

    {
        const ::wxString* value;
        int valueState = 0;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString, &value, &valueState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGridCellBoolEditor::IsTrueValue(*value);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxString *>(value), sipType_wxString, valueState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_IsTrueValue, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_UseStringValues, "UseStringValues(valueTrue=\"1\", valueFalse=wx.EmptyString)\n"
"\n"
"This method allows you to customize the values returned by GetValue()\n"
"for the cell using this editor.");

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

    {
        const ::wxString& valueTruedef = "1";
        const ::wxString* valueTrue = &valueTruedef;
        int valueTrueState = 0;
        const ::wxString& valueFalsedef = wxEmptyString;
        const ::wxString* valueFalse = &valueFalsedef;
        int valueFalseState = 0;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "|J1J1", sipType_wxString, &valueTrue, &valueTrueState, sipType_wxString, &valueFalse, &valueFalseState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            ::wxGridCellBoolEditor::UseStringValues(*valueTrue, *valueFalse);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxString *>(valueTrue), sipType_wxString, valueTrueState);
            sipReleaseType(const_cast<::wxString *>(valueFalse), sipType_wxString, valueFalseState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_UseStringValues, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_BeginEdit, "BeginEdit(self, row: int, col: int, grid: Optional[Grid])");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_BeginEdit(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_BeginEdit(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        int row;
        int col;
        ::wxGrid* grid;
        ::wxGridCellBoolEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8", &sipSelf, sipType_wxGridCellBoolEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellBoolEditor::BeginEdit(row, col, grid) : sipCpp->BeginEdit(row, col, grid));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_BeginEdit, doc_wxGridCellBoolEditor_BeginEdit);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_Clone, "Clone(self) -> Optional[GridCellEditor]");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_Clone(PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_Clone(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxGridCellBoolEditor *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGridCellBoolEditor::Clone() : sipCpp->Clone());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_Clone, doc_wxGridCellBoolEditor_Clone);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_Create, "Create(self, parent: Optional[Window], id: int, evtHandler: Optional[EvtHandler])");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_Create(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_Create(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        ::wxWindow* parent;
        ::wxWindowID id;
        ::wxEvtHandler* evtHandler;
        ::wxGridCellBoolEditor *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8iJ8", &sipSelf, sipType_wxGridCellBoolEditor, &sipCpp, sipType_wxWindow, &parent, &id, sipType_wxEvtHandler, &evtHandler))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellBoolEditor::Create(parent, id, evtHandler) : sipCpp->Create(parent, id, evtHandler));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_Create, doc_wxGridCellBoolEditor_Create);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_ApplyEdit, "ApplyEdit(self, row: int, col: int, grid: Optional[Grid])");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_ApplyEdit(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_ApplyEdit(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        int row;
        int col;
        ::wxGrid* grid;
        ::wxGridCellBoolEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8", &sipSelf, sipType_wxGridCellBoolEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellBoolEditor::ApplyEdit(row, col, grid) : sipCpp->ApplyEdit(row, col, grid));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_ApplyEdit, doc_wxGridCellBoolEditor_ApplyEdit);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_Reset, "Reset(self)");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_Reset(PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_Reset(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        ::wxGridCellBoolEditor *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridCellBoolEditor, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCellBoolEditor::Reset() : sipCpp->Reset());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_Reset, doc_wxGridCellBoolEditor_Reset);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_GetValue, "GetValue(self) -> Any");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_GetValue(PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_GetValue(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxGridCellBoolEditor *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString((sipSelfWasArg ? sipCpp->::wxGridCellBoolEditor::GetValue() : sipCpp->GetValue()));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_GetValue, doc_wxGridCellBoolEditor_GetValue);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellBoolEditor_EndEdit, "EndEdit(row, col, grid, oldval)\n"
"\n"
"End editing the cell.\n"
"\n"
"This function must check if the current value of the editing cell\n"
"is valid and different from the original value in its string\n"
"form. If not then simply return None.  If it has changed then\n"
"this method should save the new value so that ApplyEdit can\n"
"apply it later and the string representation of the new value\n"
"should be returned.\n"
"\n"
"Notice that this method shoiuld not modify the grid as the\n"
"change could still be vetoed.");

extern "C" {static PyObject *meth_wxGridCellBoolEditor_EndEdit(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridCellBoolEditor_EndEdit(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        int row;
        int col;
        const ::wxGrid* grid;
        const ::wxString* oldval;
        int oldvalState = 0;
        ::wxGridCellBoolEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
            sipName_oldval,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8J1", &sipSelf, sipType_wxGridCellBoolEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid, sipType_wxString, &oldval, &oldvalState))
        {
            PyObject * sipRes = SIP_NULLPTR;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGridCellBoolEditor_EndEdit(sipCpp, row, col, grid, oldval);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(const_cast<::wxString *>(oldval), sipType_wxString, oldvalState);

            if (sipIsErr)
                return 0;

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellBoolEditor, sipName_EndEdit, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGridCellBoolEditor)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxGridCellEditor)->ctd_cast(static_cast<::wxGridCellEditor *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridCellBoolEditor *>(sipCppV);
    else
        delete reinterpret_cast<::wxGridCellBoolEditor *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGridCellBoolEditor();
            Py_END_ALLOW_THREADS

            *sipOwner = Py_None;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxGridCellBoolEditor[] = {
    {sipName_ApplyEdit, SIP_MLMETH_CAST(meth_wxGridCellBoolEditor_ApplyEdit), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellBoolEditor_ApplyEdit},
    {sipName_BeginEdit, SIP_MLMETH_CAST(meth_wxGridCellBoolEditor_BeginEdit), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellBoolEditor_BeginEdit},
    {sipName_Clone, meth_wxGridCellBoolEditor_Clone, METH_VARARGS, doc_wxGridCellBoolEditor_Clone},
    {sipName_Create, SIP_MLMETH_CAST(meth_wxGridCellBoolEditor_Create), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellBoolEditor_Create},
    {sipName_EndEdit, SIP_MLMETH_CAST(meth_wxGridCellBoolEditor_EndEdit), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellBoolEditor_EndEdit},
    {sipName_GetValue, meth_wxGridCellBoolEditor_GetValue, METH_VARARGS, doc_wxGridCellBoolEditor_GetValue},
    {sipName_IsTrueValue, SIP_MLMETH_CAST(meth_wxGridCellBoolEditor_IsTrueValue), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellBoolEditor_IsTrueValue},
    {sipName_Reset, meth_wxGridCellBoolEditor_Reset, METH_VARARGS, doc_wxGridCellBoolEditor_Reset},
    {sipName_UseStringValues, SIP_MLMETH_CAST(meth_wxGridCellBoolEditor_UseStringValues), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellBoolEditor_UseStringValues}
};

PyDoc_STRVAR(doc_wxGridCellBoolEditor, "GridCellBoolEditor()\n"
"\n"
"Grid cell editor for boolean data.");


sipClassTypeDef sipTypeDef__grid_wxGridCellBoolEditor = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxGridCellBoolEditor,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridCellBoolEditor,
        {0, 0, 1},
        9, methods_wxGridCellBoolEditor,
        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_wxGridCellBoolEditor,
    -1,
    -1,
    supers_wxGridCellBoolEditor,
    SIP_NULLPTR,
    init_type_wxGridCellBoolEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridCellBoolEditor,
    SIP_NULLPTR,
    array_wxGridCellBoolEditor,
    SIP_NULLPTR,
    release_wxGridCellBoolEditor,
    cast_wxGridCellBoolEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
