/*
 * 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/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:
    void AddHelp( ::wxWindowBase*,const  ::wxString&) SIP_OVERRIDE;
    void AddHelp( ::wxWindowID,const  ::wxString&) SIP_OVERRIDE;
     ::wxString GetHelp(const  ::wxWindowBase*) 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);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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_110(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxWindowBase*);

    sipVH__core_110(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_191(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxWindowBase*);

    return sipVH__core_191(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_192(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxWindowBase*,const  ::wxPoint&, ::wxHelpEvent::Origin);

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


PyDoc_STRVAR(doc_wxSimpleHelpProvider_GetHelp, "GetHelp(self, window: WindowBase) -> object");

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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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_wxHelpProvider)
        return static_cast< ::wxHelpProvider *>(sipCpp);

    return sipCppV;
}


/* 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 assign_wxSimpleHelpProvider(void *, SIP_SSIZE_T, void *);}
static void assign_wxSimpleHelpProvider(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxSimpleHelpProvider *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxSimpleHelpProvider *>(sipSrc);
}


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


extern "C" {static void *copy_wxSimpleHelpProvider(const void *, SIP_SSIZE_T);}
static void *copy_wxSimpleHelpProvider(const void *sipSrc, SIP_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[] = {{240, 255, 1}};


static PyMethodDef methods_wxSimpleHelpProvider[] = {
    {SIP_MLNAME_CAST(sipName_GetHelp), SIP_MLMETH_CAST(meth_wxSimpleHelpProvider_GetHelp), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(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,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxSimpleHelpProvider,
    assign_wxSimpleHelpProvider,
    array_wxSimpleHelpProvider,
    copy_wxSimpleHelpProvider,
    release_wxSimpleHelpProvider,
    cast_wxSimpleHelpProvider,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
