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

#include "sipAPI_dataview.h"
        #include <wx/dataview.h>
        #include <wx/bmpbndl.h>
        #include <wx/icon.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


PyDoc_STRVAR(doc_wxDataViewIconText_GetBitmapBundle, "GetBitmapBundle() -> wx.BitmapBundle\n"
"\n"
"Gets the associated image.");

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

    {
        const ::wxDataViewIconText *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxBitmapBundle(sipCpp->GetBitmapBundle());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_DataViewIconText, sipName_GetBitmapBundle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataViewIconText_GetIcon, "GetIcon() -> wx.Icon\n"
"\n"
"Gets the icon.");

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

    {
        const ::wxDataViewIconText *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxIcon(sipCpp->GetIcon());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_DataViewIconText, sipName_GetIcon, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataViewIconText_GetText, "GetText() -> str\n"
"\n"
"Gets the text.");

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

    {
        const ::wxDataViewIconText *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString(sipCpp->GetText());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_DataViewIconText, sipName_GetText, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataViewIconText_SetBitmapBundle, "SetBitmapBundle(bitmap) -> None\n"
"\n"
"Sets the associated image.");

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

    {
        const ::wxBitmapBundle* bitmap;
        int bitmapState = 0;
        ::wxDataViewIconText *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxDataViewIconText, &sipCpp, sipType_wxBitmapBundle, &bitmap, &bitmapState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetBitmapBundle(*bitmap);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxBitmapBundle *>(bitmap), sipType_wxBitmapBundle, bitmapState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_DataViewIconText, sipName_SetBitmapBundle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataViewIconText_SetIcon, "SetIcon(icon) -> None\n"
"\n"
"Set the icon.");

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

    {
        const ::wxIcon* icon;
        ::wxDataViewIconText *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxDataViewIconText, &sipCpp, sipType_wxIcon, &icon))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetIcon(*icon);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_DataViewIconText, sipName_SetIcon, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxDataViewIconText_SetText, "SetText(text) -> None\n"
"\n"
"Set the text.");

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

    {
        const ::wxString* text;
        int textState = 0;
        ::wxDataViewIconText *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxDataViewIconText, &sipCpp, sipType_wxString, &text, &textState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetText(*text);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(text), sipType_wxString, textState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_DataViewIconText, sipName_SetText, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxDataViewIconText)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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


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


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


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


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

    {
        const ::wxString& textdef = wxEmptyString;
        const ::wxString* text = &textdef;
        int textState = 0;
        const ::wxBitmapBundle& bitmapdef = wxBitmapBundle();
        const ::wxBitmapBundle* bitmap = &bitmapdef;
        int bitmapState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J1J1", sipType_wxString, &text, &textState, sipType_wxBitmapBundle, &bitmap, &bitmapState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxDataViewIconText(*text, *bitmap);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(text), sipType_wxString, textState);
            sipReleaseType(const_cast< ::wxBitmapBundle *>(bitmap), sipType_wxBitmapBundle, bitmapState);

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

            return sipCpp;
        }
    }

    {
        const ::wxDataViewIconText* other;

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

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

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

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxDataViewIconText[] = {{26, 0, 1}};


static PyMethodDef methods_wxDataViewIconText[] = {
    {sipName_GetBitmapBundle, meth_wxDataViewIconText_GetBitmapBundle, METH_VARARGS, doc_wxDataViewIconText_GetBitmapBundle},
    {sipName_GetIcon, meth_wxDataViewIconText_GetIcon, METH_VARARGS, doc_wxDataViewIconText_GetIcon},
    {sipName_GetText, meth_wxDataViewIconText_GetText, METH_VARARGS, doc_wxDataViewIconText_GetText},
    {sipName_SetBitmapBundle, SIP_MLMETH_CAST(meth_wxDataViewIconText_SetBitmapBundle), METH_VARARGS|METH_KEYWORDS, doc_wxDataViewIconText_SetBitmapBundle},
    {sipName_SetIcon, SIP_MLMETH_CAST(meth_wxDataViewIconText_SetIcon), METH_VARARGS|METH_KEYWORDS, doc_wxDataViewIconText_SetIcon},
    {sipName_SetText, SIP_MLMETH_CAST(meth_wxDataViewIconText_SetText), METH_VARARGS|METH_KEYWORDS, doc_wxDataViewIconText_SetText}
};

sipVariableDef variables_wxDataViewIconText[] = {
    {PropertyVariable, sipName_Text, &methods_wxDataViewIconText[2], &methods_wxDataViewIconText[5], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Icon, &methods_wxDataViewIconText[1], &methods_wxDataViewIconText[4], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_BitmapBundle, &methods_wxDataViewIconText[0], &methods_wxDataViewIconText[3], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxDataViewIconText, "DataViewIconText(text='', bitmap=wx.BitmapBundle()) -> None\n"
"DataViewIconText(other) -> None\n"
"\n"
"wxDataViewIconText is used by wxDataViewIconTextRenderer for data\n"
"transfer.");


sipClassTypeDef sipTypeDef__dataview_wxDataViewIconText = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxDataViewIconText,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_DataViewIconText,
        {0, 0, 1},
        6, methods_wxDataViewIconText,
        0, SIP_NULLPTR,
        3, variables_wxDataViewIconText,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxDataViewIconText,
    -1,
    -1,
    supers_wxDataViewIconText,
    SIP_NULLPTR,
    init_type_wxDataViewIconText,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxDataViewIconText,
    assign_wxDataViewIconText,
    array_wxDataViewIconText,
    copy_wxDataViewIconText,
    release_wxDataViewIconText,
    cast_wxDataViewIconText,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxDataViewIconText,
    sizeof (::wxDataViewIconText),
};
