/*
 * 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/graphics.h>
        #include <wx/graphics.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>
    bool _wxGraphicsObject_IsOk(wxGraphicsObject* self)
    {
        return !self->IsNull();
    }
    int _wxGraphicsObject___nonzero__(wxGraphicsObject* self)
    {
        return !self->IsNull();
    }
    int _wxGraphicsObject___bool__(wxGraphicsObject* self)
    {
        return !self->IsNull();
    }


PyDoc_STRVAR(doc_wxGraphicsObject_GetRenderer, "GetRenderer() -> GraphicsRenderer\n"
"\n"
"Returns the renderer that was used to create this instance, or NULL if\n"
"it has not been initialized yet.");

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

    {
        const ::wxGraphicsObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsObject, &sipCpp))
        {
            ::wxGraphicsRenderer*sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsObject is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetRenderer();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsObject, sipName_GetRenderer, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsObject_IsNull, "IsNull() -> bool");

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

    {
        const ::wxGraphicsObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsObject, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsNull();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsObject, sipName_IsNull, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsObject_IsOk, "IsOk() -> bool");

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

    {
        ::wxGraphicsObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsObject, &sipCpp))
        {
            bool sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGraphicsObject_IsOk(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsObject, sipName_IsOk, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsObject___nonzero__, "__nonzero__() -> bool");

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

    {
        ::wxGraphicsObject *sipCpp;

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

            if (sipIsErr)
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsObject, sipName___nonzero__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static int slot_wxGraphicsObject___bool__(PyObject *);}
static int slot_wxGraphicsObject___bool__(PyObject *sipSelf)
{
    ::wxGraphicsObject *sipCpp = reinterpret_cast< ::wxGraphicsObject *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxGraphicsObject));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGraphicsObject___bool__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


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

    if (targetType == sipType_wxGraphicsObject)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const ::wxGraphicsObject* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


/* Define this type's Python slots. */
static sipPySlotDef slots_wxGraphicsObject[] = {
    {(void *)slot_wxGraphicsObject___bool__, bool_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_wxGraphicsObject[] = {
    {sipName_GetRenderer, meth_wxGraphicsObject_GetRenderer, METH_VARARGS, doc_wxGraphicsObject_GetRenderer},
    {sipName_IsNull, meth_wxGraphicsObject_IsNull, METH_VARARGS, doc_wxGraphicsObject_IsNull},
    {sipName_IsOk, meth_wxGraphicsObject_IsOk, METH_VARARGS, doc_wxGraphicsObject_IsOk},
    {sipName___nonzero__, meth_wxGraphicsObject___nonzero__, METH_VARARGS, doc_wxGraphicsObject___nonzero__}
};

sipVariableDef variables_wxGraphicsObject[] = {
    {PropertyVariable, sipName_Renderer, &methods_wxGraphicsObject[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGraphicsObject, "This class is the superclass of native graphics objects like pens etc.");


sipClassTypeDef sipTypeDef__core_wxGraphicsObject = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxGraphicsObject,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GraphicsObject,
        {0, 0, 1},
        4, methods_wxGraphicsObject,
        0, SIP_NULLPTR,
        1, variables_wxGraphicsObject,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGraphicsObject,
    -1,
    -1,
    supers_wxGraphicsObject,
    slots_wxGraphicsObject,
    init_type_wxGraphicsObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGraphicsObject,
    assign_wxGraphicsObject,
    array_wxGraphicsObject,
    copy_wxGraphicsObject,
    release_wxGraphicsObject,
    cast_wxGraphicsObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxGraphicsObject,
    sizeof (::wxGraphicsObject),
};
