/*
 * 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/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;

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

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_GraphicsObject, sipName_IsOk, 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;
}


extern "C" {static int slot_wxGraphicsObject___nonzero__(PyObject *);}
static int slot_wxGraphicsObject___nonzero__(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___nonzero__(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_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


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


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


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


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


static PyMethodDef methods_wxGraphicsObject[] = {
    {SIP_MLNAME_CAST(sipName_GetRenderer), meth_wxGraphicsObject_GetRenderer, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGraphicsObject_GetRenderer)},
    {SIP_MLNAME_CAST(sipName_IsNull), meth_wxGraphicsObject_IsNull, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGraphicsObject_IsNull)},
    {SIP_MLNAME_CAST(sipName_IsOk), meth_wxGraphicsObject_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGraphicsObject_IsOk)}
};

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},
        3, 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,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxGraphicsObject,
    assign_wxGraphicsObject,
    array_wxGraphicsObject,
    copy_wxGraphicsObject,
    release_wxGraphicsObject,
    cast_wxGraphicsObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
