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

#include "sipAPI_propgrid.h"

        #include <wx/propgrid/props.h>

        #include <wx/propgrid/propgrid.h>
        #include <wx/propgrid/property.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxPGFileDialogAdapter : public  ::wxPGFileDialogAdapter
{
public:
    sipwxPGFileDialogAdapter();
    sipwxPGFileDialogAdapter(const  ::wxPGFileDialogAdapter&);
    virtual ~sipwxPGFileDialogAdapter();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool DoShowDialog( ::wxPropertyGrid*, ::wxPGProperty*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipwxPGFileDialogAdapter::sipwxPGFileDialogAdapter():  ::wxPGFileDialogAdapter(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

bool sipwxPGFileDialogAdapter::DoShowDialog( ::wxPropertyGrid*propGrid, ::wxPGProperty*property)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxPGFileDialogAdapter::DoShowDialog(propGrid,property);

    extern bool sipVH__propgrid_35(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxPropertyGrid*, ::wxPGProperty*);

    return sipVH__propgrid_35(sipGILState, 0, sipPySelf, sipMeth, propGrid, property);
}


PyDoc_STRVAR(doc_wxPGFileDialogAdapter_DoShowDialog, "DoShowDialog(propGrid, property) -> bool");

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

    {
         ::wxPropertyGrid* propGrid;
         ::wxPGProperty* property;
         ::wxPGFileDialogAdapter *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8J8", &sipSelf, sipType_wxPGFileDialogAdapter, &sipCpp, sipType_wxPropertyGrid, &propGrid, sipType_wxPGProperty, &property))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxPGFileDialogAdapter::DoShowDialog(propGrid,property) : sipCpp->DoShowDialog(propGrid,property));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_PGFileDialogAdapter, sipName_DoShowDialog, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxPGEditorDialogAdapter)
        return static_cast< ::wxPGEditorDialogAdapter *>(sipCpp);

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

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxPGFileDialogAdapter *>(sipCppV);
    else
        delete reinterpret_cast< ::wxPGFileDialogAdapter *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void assign_wxPGFileDialogAdapter(void *, SIP_SSIZE_T, void *);}
static void assign_wxPGFileDialogAdapter(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxPGFileDialogAdapter *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxPGFileDialogAdapter *>(sipSrc);
}


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


extern "C" {static void *copy_wxPGFileDialogAdapter(const void *, SIP_SSIZE_T);}
static void *copy_wxPGFileDialogAdapter(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxPGFileDialogAdapter(reinterpret_cast<const  ::wxPGFileDialogAdapter *>(sipSrc)[sipSrcIdx]);
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxPGFileDialogAdapter* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxPGFileDialogAdapter[] = {
    {SIP_MLNAME_CAST(sipName_DoShowDialog), SIP_MLMETH_CAST(meth_wxPGFileDialogAdapter_DoShowDialog), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPGFileDialogAdapter_DoShowDialog)}
};

PyDoc_STRVAR(doc_wxPGFileDialogAdapter, "");


sipClassTypeDef sipTypeDef__propgrid_wxPGFileDialogAdapter = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxPGFileDialogAdapter,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_PGFileDialogAdapter,
        {0, 0, 1},
        1, methods_wxPGFileDialogAdapter,
        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_wxPGFileDialogAdapter,
    -1,
    -1,
    supers_wxPGFileDialogAdapter,
    SIP_NULLPTR,
    init_type_wxPGFileDialogAdapter,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxPGFileDialogAdapter,
    assign_wxPGFileDialogAdapter,
    array_wxPGFileDialogAdapter,
    copy_wxPGFileDialogAdapter,
    release_wxPGFileDialogAdapter,
    cast_wxPGFileDialogAdapter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
