/*
 * 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/cshelp.h>
        #include <wx/gdicmn.h>
        #include <wx/event.h>


class sipwxSimpleHelpProvider : public ::wxSimpleHelpProvider
{
public:
    sipwxSimpleHelpProvider();
    sipwxSimpleHelpProvider(const ::wxSimpleHelpProvider&);
    virtual ~sipwxSimpleHelpProvider();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    ::wxString GetHelp(const ::wxWindowBase*) SIP_OVERRIDE;
    void AddHelp(::wxWindowBase*, const ::wxString&) SIP_OVERRIDE;
    void AddHelp(::wxWindowID, const ::wxString&) SIP_OVERRIDE;
    void RemoveHelp(::wxWindowBase*) SIP_OVERRIDE;
    bool ShowHelp(::wxWindowBase*) SIP_OVERRIDE;
    bool ShowHelpAtPoint(::wxWindowBase*, const ::wxPoint&, ::wxHelpEvent::Origin) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[6];
};

sipwxSimpleHelpProvider::sipwxSimpleHelpProvider(): ::wxSimpleHelpProvider(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxString sipwxSimpleHelpProvider::GetHelp(const ::wxWindowBase*window)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxSimpleHelpProvider::GetHelp(window);

    extern ::wxString sipVH__core_210(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxWindowBase*);

    return sipVH__core_210(sipGILState, 0, sipPySelf, sipMeth, window);
}

void sipwxSimpleHelpProvider::AddHelp(::wxWindowBase*window, const ::wxString& text)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_AddHelp);

    if (!sipMeth)
    {
        ::wxSimpleHelpProvider::AddHelp(window, text);
        return;
    }

    extern void sipVH__core_205(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindowBase*, const ::wxString&);

    sipVH__core_205(sipGILState, 0, sipPySelf, sipMeth, window, text);
}

void sipwxSimpleHelpProvider::AddHelp(::wxWindowID id, const ::wxString& text)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxSimpleHelpProvider::AddHelp(id, text);
        return;
    }

    extern void sipVH__core_206(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindowID, const ::wxString&);

    sipVH__core_206(sipGILState, 0, sipPySelf, sipMeth, id, text);
}

void sipwxSimpleHelpProvider::RemoveHelp(::wxWindowBase*window)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxSimpleHelpProvider::RemoveHelp(window);
        return;
    }

    extern void sipVH__core_125(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindowBase*);

    sipVH__core_125(sipGILState, 0, sipPySelf, sipMeth, window);
}

bool sipwxSimpleHelpProvider::ShowHelp(::wxWindowBase*window)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxSimpleHelpProvider::ShowHelp(window);

    extern bool sipVH__core_208(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindowBase*);

    return sipVH__core_208(sipGILState, 0, sipPySelf, sipMeth, window);
}

bool sipwxSimpleHelpProvider::ShowHelpAtPoint(::wxWindowBase*window, const ::wxPoint& point, ::wxHelpEvent::Origin origin)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxSimpleHelpProvider::ShowHelpAtPoint(window, point, origin);

    extern bool sipVH__core_209(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindowBase*, const ::wxPoint&, ::wxHelpEvent::Origin);

    return sipVH__core_209(sipGILState, 0, sipPySelf, sipMeth, window, point, origin);
}


PyDoc_STRVAR(doc_wxSimpleHelpProvider_GetHelp, "GetHelp(self, window: WindowBase|None) -> Any");

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

    {
        const ::wxWindowBase* window;
        ::wxSimpleHelpProvider *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxSimpleHelpProvider, &sipCpp, sipType_wxWindowBase, &window))
        {
            ::wxString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString((sipSelfWasArg ? sipCpp->::wxSimpleHelpProvider::GetHelp(window) : sipCpp->GetHelp(window)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_SimpleHelpProvider, sipName_GetHelp, doc_wxSimpleHelpProvider_GetHelp);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxSimpleHelpProvider)
        return sipCppV;

    if (targetType == sipType_wxHelpProvider)
        return static_cast< ::wxHelpProvider *>(sipCpp);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxSimpleHelpProvider *>(sipCppV);
    else
        delete reinterpret_cast< ::wxSimpleHelpProvider *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


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


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxSimpleHelpProvider();
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxSimpleHelpProvider* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxSimpleHelpProvider[] = {
    {sipName_GetHelp, SIP_MLMETH_CAST(meth_wxSimpleHelpProvider_GetHelp), METH_VARARGS|METH_KEYWORDS, doc_wxSimpleHelpProvider_GetHelp}
};

PyDoc_STRVAR(doc_wxSimpleHelpProvider, "wxSimpleHelpProvider is an implementation of wxHelpProvider which\n"
"supports only plain text help strings, and shows the string associated\n"
"with the control (if any) in a tooltip.");


sipClassTypeDef sipTypeDef__core_wxSimpleHelpProvider = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxSimpleHelpProvider,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_SimpleHelpProvider,
        {0, 0, 1},
        1, methods_wxSimpleHelpProvider,
        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_wxSimpleHelpProvider,
    -1,
    -1,
    supers_wxSimpleHelpProvider,
    SIP_NULLPTR,
    init_type_wxSimpleHelpProvider,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxSimpleHelpProvider,
    assign_wxSimpleHelpProvider,
    array_wxSimpleHelpProvider,
    copy_wxSimpleHelpProvider,
    release_wxSimpleHelpProvider,
    cast_wxSimpleHelpProvider,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxSimpleHelpProvider,
    sizeof (::wxSimpleHelpProvider),
};
