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

#include "sipAPI_core.h"

        #include <wx/dataobj.h>

        #include <wx/dataobj.h>
        #include <wx/dataobj.h>
    bool _wxDataObjectSimple_GetDataHere(const wxDataObjectSimple* self, wxPyBuffer* buf)
    {
        if (!buf->checkSize(self->GetDataSize()))
            return false;
        return self->GetDataHere(buf->m_ptr);
    }
    bool _wxDataObjectSimple_SetData(wxDataObjectSimple* self, wxPyBuffer* buf)
    {
        return self->SetData(buf->m_len, buf->m_ptr);
    }
    bool _wxDataObjectSimple_SetData(wxDataObjectSimple* self, const wxDataFormat* format, wxPyBuffer* buf)
    {
        return self->SetData(*format, buf->m_len, buf->m_ptr);
    }
    PyObject* _wxDataObjectSimple_GetAllFormats(const wxDataObjectSimple* self, wxDataObject::Direction dir)
    {
        size_t count = self->GetFormatCount(dir);
        wxDataFormat* formats = new wxDataFormat[count];
        self->GetAllFormats(formats, dir);
        wxPyThreadBlocker blocker;
        PyObject* list = PyList_New(count);
        for (size_t i=0; i<count; i++) {
            wxDataFormat* format = new wxDataFormat(formats[i]);
            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
        }
        delete [] formats;
        return list;
    }


class sipwxDataObjectSimple : public  ::wxDataObjectSimple
{
public:
    sipwxDataObjectSimple(const  ::wxDataFormat&);
    virtual ~sipwxDataObjectSimple();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool SetData(size_t,const void*) SIP_OVERRIDE;
    size_t GetDataSize() const SIP_OVERRIDE;
    bool GetDataHere(void*) const SIP_OVERRIDE;
    void GetAllFormats( ::wxDataFormat*, ::wxDataObject::Direction) const SIP_OVERRIDE;
    size_t GetFormatCount( ::wxDataObject::Direction) const SIP_OVERRIDE;
     ::wxDataFormat GetPreferredFormat( ::wxDataObject::Direction) const SIP_OVERRIDE;
    bool SetData(const  ::wxDataFormat&,size_t,const void*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[7];
};

sipwxDataObjectSimple::sipwxDataObjectSimple(const  ::wxDataFormat& format):  ::wxDataObjectSimple(format), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

bool sipwxDataObjectSimple::SetData(size_t len,const void*buf)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxDataObjectSimple::SetData(len,buf);

    extern bool sipVH__core_71(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, size_t,const void*);

    return sipVH__core_71(sipGILState, 0, sipPySelf, sipMeth, len, buf);
}

size_t sipwxDataObjectSimple::GetDataSize() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxDataObjectSimple::GetDataSize();

    extern size_t sipVH__core_70(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxDataObjectSimple::GetDataHere(void*buf) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[2]),sipPySelf,SIP_NULLPTR,sipName_GetDataHere);

    if (!sipMeth)
        return  ::wxDataObjectSimple::GetDataHere(buf);

    extern bool sipVH__core_69(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, void*);

    return sipVH__core_69(sipGILState, 0, sipPySelf, sipMeth, buf);
}

void sipwxDataObjectSimple::GetAllFormats( ::wxDataFormat*formats, ::wxDataObject::Direction dir) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[3]),sipPySelf,SIP_NULLPTR,sipName_GetAllFormats);

    if (!sipMeth)
    {
         ::wxDataObjectSimple::GetAllFormats(formats,dir);
        return;
    }

    extern void sipVH__core_61(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxDataFormat*, ::wxDataObject::Direction);

    sipVH__core_61(sipGILState, 0, sipPySelf, sipMeth, formats, dir);
}

size_t sipwxDataObjectSimple::GetFormatCount( ::wxDataObject::Direction dir) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[4]),sipPySelf,SIP_NULLPTR,sipName_GetFormatCount);

    if (!sipMeth)
        return  ::wxDataObjectSimple::GetFormatCount(dir);

    extern size_t sipVH__core_64(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxDataObject::Direction);

    return sipVH__core_64(sipGILState, 0, sipPySelf, sipMeth, dir);
}

 ::wxDataFormat sipwxDataObjectSimple::GetPreferredFormat( ::wxDataObject::Direction dir) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[5]),sipPySelf,SIP_NULLPTR,sipName_GetPreferredFormat);

    if (!sipMeth)
        return  ::wxDataObjectSimple::GetPreferredFormat(dir);

    extern  ::wxDataFormat sipVH__core_65(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxDataObject::Direction);

    return sipVH__core_65(sipGILState, 0, sipPySelf, sipMeth, dir);
}

bool sipwxDataObjectSimple::SetData(const  ::wxDataFormat& format,size_t len,const void*buf)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxDataObjectSimple::SetData(format,len,buf);

    extern bool sipVH__core_67(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxDataFormat&,size_t,const void*);

    return sipVH__core_67(sipGILState, 0, sipPySelf, sipMeth, format, len, buf);
}


PyDoc_STRVAR(doc_wxDataObjectSimple_GetDataHere, "GetDataHere(buf) -> bool\n"
"\n"
"Copies this data object's data bytes to the given buffer");

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

    {
         ::wxPyBuffer* buf;
        int bufState = 0;
        const  ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ0", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxPyBuffer,&buf, &bufState))
        {
            bool sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxDataObjectSimple_GetDataHere(sipCpp, buf);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(buf,sipType_wxPyBuffer,bufState);

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_GetDataHere, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_GetDataSize, "GetDataSize() -> size_t\n"
"\n"
"Gets the size of our data.");

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

    {
        const  ::wxDataObjectSimple *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxDataObjectSimple, &sipCpp))
        {
            size_t sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxDataObjectSimple::GetDataSize() : sipCpp->GetDataSize());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_GetDataSize, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_GetFormat, "GetFormat() -> DataFormat\n"
"\n"
"Returns the (one and only one) format supported by this object.");

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

    {
        const  ::wxDataObjectSimple *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxDataFormat(sipCpp->GetFormat());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_GetFormat, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_SetData, "SetData(buf) -> bool\n"
"SetData(format, buf) -> bool\n"
"\n"
"Copies data from the provided buffer to this data object.\n"
"");

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

    {
         ::wxPyBuffer* buf;
        int bufState = 0;
         ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ0", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxPyBuffer,&buf, &bufState))
        {
            bool sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxDataObjectSimple_SetData(sipCpp, buf);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(buf,sipType_wxPyBuffer,bufState);

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    {
        const  ::wxDataFormat* format;
         ::wxPyBuffer* buf;
        int bufState = 0;
         ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J0", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxDataFormat, &format, sipType_wxPyBuffer,&buf, &bufState))
        {
            bool sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxDataObjectSimple_SetData(sipCpp, format, buf);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(buf,sipType_wxPyBuffer,bufState);

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_SetData, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_SetFormat, "SetFormat(format)\n"
"\n"
"Sets the supported format.");

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

    {
        const  ::wxDataFormat* format;
         ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxDataFormat, &format))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetFormat(*format);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_SetFormat, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_GetAllFormats, "GetAllFormats(dir=DataObject.Get)\n"
"\n"
"Returns a list of wx.DataFormat objects which this data object\n"
"supports transferring in the given direction.");

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

    {
         ::wxDataObject::Direction dir = wxDataObject::Get;
        const  ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxDataObject_Direction, &dir))
        {
            PyObject * sipRes = SIP_NULLPTR;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxDataObjectSimple_GetAllFormats(sipCpp, dir);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_GetAllFormats, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_GetFormatCount, "GetFormatCount(self, dir: DataObject.Direction = wxDataObject.Get) -> int");

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

    {
         ::wxDataObject::Direction dir =  ::wxDataObject::Get;
        const  ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxDataObject_Direction, &dir))
        {
            size_t sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxDataObjectSimple::GetFormatCount(dir) : sipCpp->GetFormatCount(dir));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_GetFormatCount, doc_wxDataObjectSimple_GetFormatCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataObjectSimple_GetPreferredFormat, "GetPreferredFormat(self, dir: DataObject.Direction = wxDataObject.Get) -> DataFormat");

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

    {
         ::wxDataObject::Direction dir =  ::wxDataObject::Get;
        const  ::wxDataObjectSimple *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_wxDataObjectSimple, &sipCpp, sipType_wxDataObject_Direction, &dir))
        {
             ::wxDataFormat*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxDataFormat((sipSelfWasArg ? sipCpp-> ::wxDataObjectSimple::GetPreferredFormat(dir) : sipCpp->GetPreferredFormat(dir)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_DataObjectSimple, sipName_GetPreferredFormat, doc_wxDataObjectSimple_GetPreferredFormat);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxDataObject)
        return static_cast< ::wxDataObject *>(sipCpp);

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxDataObjectSimple *>(sipCppV);
    else
        delete reinterpret_cast< ::wxDataObjectSimple *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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

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


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

    {
        const  ::wxDataFormat& formatdef = wxFormatInvalid;
        const  ::wxDataFormat* format = &formatdef;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J9", sipType_wxDataFormat, &format))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxDataObjectSimple(*format);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxString* formatName;
        int formatNameState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1", sipType_wxString,&formatName, &formatNameState))
        {
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipCpp = new sipwxDataObjectSimple(wxDataFormat(*formatName));
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(const_cast< ::wxString *>(formatName),sipType_wxString,formatNameState);

            if (sipIsErr)
            {
                if (sipUnused)
                {
                    Py_XDECREF(*sipUnused);
                }

                sipAddException(sipErrorFail, sipParseErr);
                return SIP_NULLPTR;
            }

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxDataObjectSimple[] = {
    {SIP_MLNAME_CAST(sipName_GetAllFormats), SIP_MLMETH_CAST(meth_wxDataObjectSimple_GetAllFormats), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_GetAllFormats)},
    {SIP_MLNAME_CAST(sipName_GetDataHere), SIP_MLMETH_CAST(meth_wxDataObjectSimple_GetDataHere), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_GetDataHere)},
    {SIP_MLNAME_CAST(sipName_GetDataSize), meth_wxDataObjectSimple_GetDataSize, METH_VARARGS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_GetDataSize)},
    {SIP_MLNAME_CAST(sipName_GetFormat), meth_wxDataObjectSimple_GetFormat, METH_VARARGS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_GetFormat)},
    {SIP_MLNAME_CAST(sipName_GetFormatCount), SIP_MLMETH_CAST(meth_wxDataObjectSimple_GetFormatCount), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_GetFormatCount)},
    {SIP_MLNAME_CAST(sipName_GetPreferredFormat), SIP_MLMETH_CAST(meth_wxDataObjectSimple_GetPreferredFormat), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_GetPreferredFormat)},
    {SIP_MLNAME_CAST(sipName_SetData), SIP_MLMETH_CAST(meth_wxDataObjectSimple_SetData), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_SetData)},
    {SIP_MLNAME_CAST(sipName_SetFormat), SIP_MLMETH_CAST(meth_wxDataObjectSimple_SetFormat), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataObjectSimple_SetFormat)}
};

sipVariableDef variables_wxDataObjectSimple[] = {
    {PropertyVariable, sipName_Format, &methods_wxDataObjectSimple[3], &methods_wxDataObjectSimple[7], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_DataSize, &methods_wxDataObjectSimple[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_DataHere, &methods_wxDataObjectSimple[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_AllFormats, &methods_wxDataObjectSimple[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxDataObjectSimple, "DataObjectSimple(format=FormatInvalid)\n"
"DataObjectSimple(formatName)\n"
"\n"
"This is the simplest possible implementation of the wxDataObject\n"
"class.");


sipClassTypeDef sipTypeDef__core_wxDataObjectSimple = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxDataObjectSimple,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_DataObjectSimple,
        {0, 0, 1},
        8, methods_wxDataObjectSimple,
        0, SIP_NULLPTR,
        4, variables_wxDataObjectSimple,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxDataObjectSimple,
    -1,
    -1,
    supers_wxDataObjectSimple,
    SIP_NULLPTR,
    init_type_wxDataObjectSimple,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxDataObjectSimple,
    SIP_NULLPTR,
    array_wxDataObjectSimple,
    SIP_NULLPTR,
    release_wxDataObjectSimple,
    cast_wxDataObjectSimple,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
