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

#include "sipAPI_core.h"
        #include <wx/cshelp.h>
        #include <wx/window.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxContextHelp : public ::wxContextHelp
{
public:
    sipwxContextHelp(::wxWindow*, bool);
    sipwxContextHelp(const ::wxContextHelp&);
    ~sipwxContextHelp();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxContextHelp::sipwxContextHelp(::wxWindow*window, bool doNow): ::wxContextHelp(window, doNow), sipPySelf(SIP_NULLPTR)
{
}

sipwxContextHelp::sipwxContextHelp(const ::wxContextHelp& a0): ::wxContextHelp(a0), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxContextHelp_BeginContextHelp, "BeginContextHelp(window) -> bool\n"
"\n"
"Puts the application into context-sensitive help mode.");

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

    {
        ::wxWindow* window;
        ::wxContextHelp *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxContextHelp, &sipCpp, sipType_wxWindow, &window))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->BeginContextHelp(window);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_ContextHelp, sipName_BeginContextHelp, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxContextHelp_EndContextHelp, "EndContextHelp() -> bool\n"
"\n"
"Ends context-sensitive help mode.");

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

    {
        ::wxContextHelp *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxContextHelp, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->EndContextHelp();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_ContextHelp, sipName_EndContextHelp, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxContextHelp)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxContextHelp *>(sipCppV);
    else
        delete reinterpret_cast< ::wxContextHelp *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void array_delete_wxContextHelp(void *);}
static void array_delete_wxContextHelp(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxContextHelp *>(sipCpp);
}


extern "C" {static void assign_wxContextHelp(void *, Py_ssize_t, void *);}
static void assign_wxContextHelp(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxContextHelp *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxContextHelp *>(sipSrc);
}


extern "C" {static void *copy_wxContextHelp(const void *, Py_ssize_t);}
static void *copy_wxContextHelp(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::wxContextHelp(reinterpret_cast<const ::wxContextHelp *>(sipSrc)[sipSrcIdx]);
}


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

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


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

    {
        ::wxWindow* window = 0;
        bool doNow = 1;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J8b", sipType_wxWindow, &window, &doNow))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxContextHelp(window, doNow);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxContextHelp* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxContextHelp[] = {
    {sipName_BeginContextHelp, SIP_MLMETH_CAST(meth_wxContextHelp_BeginContextHelp), METH_VARARGS|METH_KEYWORDS, doc_wxContextHelp_BeginContextHelp},
    {sipName_EndContextHelp, meth_wxContextHelp_EndContextHelp, METH_VARARGS, doc_wxContextHelp_EndContextHelp}
};

PyDoc_STRVAR(doc_wxContextHelp, "ContextHelp(window=None, doNow=True) -> None\n"
"\n"
"This class changes the cursor to a query and puts the application into\n"
"a 'context-sensitive help mode'.");


sipClassTypeDef sipTypeDef__core_wxContextHelp = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxContextHelp,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_ContextHelp,
        {0, 0, 1},
        2, methods_wxContextHelp,
        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_wxContextHelp,
    -1,
    -1,
    supers_wxContextHelp,
    SIP_NULLPTR,
    init_type_wxContextHelp,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxContextHelp,
    assign_wxContextHelp,
    array_wxContextHelp,
    copy_wxContextHelp,
    release_wxContextHelp,
    cast_wxContextHelp,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxContextHelp,
    sizeof (::wxContextHelp),
};
