/*
 * 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/object.h>
        #include <wx/object.h>
        #include <wx/object.h>
    const wxChar* _wxObject_GetClassName(wxObject* self)
    {
        return self->GetClassInfo()->GetClassName();
    }
    void _wxObject_Destroy(wxObject* self)
    {
        delete self;
    }


PyDoc_STRVAR(doc_wxObject_GetClassInfo, "GetClassInfo() -> ClassInfo\n"
"\n"
"This virtual function is redefined for every class that requires run-\n"
"time type information, when using the wxDECLARE_CLASS macro (or\n"
"similar).");

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

    {
        const ::wxObject *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetClassInfo();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes, sipType_wxClassInfo, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_GetClassInfo, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_GetRefData, "GetRefData() -> ObjectRefData\n"
"\n"
"Returns the wxObject::m_refData pointer, i.e. the data referenced by\n"
"this object.");

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

    {
        const ::wxObject *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetRefData();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes, sipType_wxRefCounter, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_GetRefData, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_IsSameAs, "IsSameAs(obj) -> bool\n"
"\n"
"Returns true if this object has the same data pointer as obj.");

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

    {
        const ::wxObject* obj;
        const ::wxObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxObject, &sipCpp, sipType_wxObject, &obj))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsSameAs(*obj);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_IsSameAs, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_Ref, "Ref(clone) -> None\n"
"\n"
"Makes this object refer to the data in clone.");

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

    {
        const ::wxObject* clone;
        ::wxObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxObject, &sipCpp, sipType_wxObject, &clone))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Ref(*clone);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_Ref, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_SetRefData, "SetRefData(data) -> None\n"
"\n"
"Sets the wxObject::m_refData pointer.");

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

    {
        ::wxObjectRefData* data;
        ::wxObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxObject, &sipCpp, sipType_wxRefCounter, &data))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetRefData(data);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_SetRefData, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_UnRef, "UnRef() -> None\n"
"\n"
"Decrements the reference count in the associated data, and if it is\n"
"zero, deletes the data.");

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

    {
        ::wxObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxObject, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->UnRef();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_UnRef, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_UnShare, "UnShare() -> None\n"
"\n"
"This is the same of AllocExclusive() but this method is public.");

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

    {
        ::wxObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxObject, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->UnShare();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_UnShare, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_GetClassName, "GetClassName() -> str\n"
"\n"
"Returns the class name of the C++ class using wxRTTI.");

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

    {
        ::wxObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxObject, &sipCpp))
        {
            const ::wxChar*sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxObject_GetClassName(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_FromWideChar(sipRes, (Py_ssize_t)wcslen(sipRes));
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_GetClassName, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxObject_Destroy, "Destroy() -> None\n"
"\n"
"Deletes the C++ object this Python object is a proxy for.");

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

    {
        ::wxObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxObject, &sipCpp))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxObject_Destroy(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            sipTransferTo(sipSelf, SIP_NULLPTR);

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Object, sipName_Destroy, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    delete reinterpret_cast< ::wxObject *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


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


extern "C" {static void dealloc_wxObject(sipSimpleWrapper *);}
static void dealloc_wxObject(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxObject(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_wxObject(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxObject(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    ::wxObject *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxObject();
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const ::wxObject* other;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxObject, &other))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxObject(*other);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxObject[] = {
    {sipName_Destroy, meth_wxObject_Destroy, METH_VARARGS, doc_wxObject_Destroy},
    {sipName_GetClassInfo, meth_wxObject_GetClassInfo, METH_VARARGS, doc_wxObject_GetClassInfo},
    {sipName_GetClassName, meth_wxObject_GetClassName, METH_VARARGS, doc_wxObject_GetClassName},
    {sipName_GetRefData, meth_wxObject_GetRefData, METH_VARARGS, doc_wxObject_GetRefData},
    {sipName_IsSameAs, SIP_MLMETH_CAST(meth_wxObject_IsSameAs), METH_VARARGS|METH_KEYWORDS, doc_wxObject_IsSameAs},
    {sipName_Ref, SIP_MLMETH_CAST(meth_wxObject_Ref), METH_VARARGS|METH_KEYWORDS, doc_wxObject_Ref},
    {sipName_SetRefData, SIP_MLMETH_CAST(meth_wxObject_SetRefData), METH_VARARGS|METH_KEYWORDS, doc_wxObject_SetRefData},
    {sipName_UnRef, meth_wxObject_UnRef, METH_VARARGS, doc_wxObject_UnRef},
    {sipName_UnShare, meth_wxObject_UnShare, METH_VARARGS, doc_wxObject_UnShare}
};

sipVariableDef variables_wxObject[] = {
    {PropertyVariable, sipName_RefData, &methods_wxObject[3], &methods_wxObject[6], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_ClassName, &methods_wxObject[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_ClassInfo, &methods_wxObject[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxObject, "Object() -> None\n"
"Object(other) -> None\n"
"\n"
"This is the root class of many of the wxWidgets classes.");


sipClassTypeDef sipTypeDef__core_wxObject = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxObject,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_Object,
        {0, 0, 1},
        9, methods_wxObject,
        0, SIP_NULLPTR,
        3, variables_wxObject,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxObject,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxObject,
    assign_wxObject,
    array_wxObject,
    copy_wxObject,
    release_wxObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxObject,
    sizeof (::wxObject),
};
