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

#include "sipAPI_dataview.h"

        #include <wx/treelist.h>

    int _wxTreeListItem___nonzero__(wxTreeListItem* self)
    {
        return self->IsOk();
    }
    int _wxTreeListItem___bool__(wxTreeListItem* self)
    {
        return self->IsOk();
    }
    long _wxTreeListItem___hash__(wxTreeListItem* self)
    {
        return (long)self->GetID();
    }
    bool _wxTreeListItem___eq__(wxTreeListItem* self, wxTreeListItem* other)
    {
        return other ? (self->GetID() == other->GetID()) : false;
    }
    bool _wxTreeListItem___ne__(wxTreeListItem* self, wxTreeListItem* other)
    {
        return other ? (self->GetID() != other->GetID()) : true;
    }


PyDoc_STRVAR(doc_wxTreeListItem_IsOk, "IsOk() -> bool\n"
"\n"
"Return true if the item is valid.");

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

    {
        const  ::wxTreeListItem *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsOk();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_TreeListItem, sipName_IsOk, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_wxTreeListItem___ne__(PyObject *,PyObject *);}
static PyObject *slot_wxTreeListItem___ne__(PyObject *sipSelf,PyObject *sipArg)
{
     ::wxTreeListItem *sipCpp = reinterpret_cast< ::wxTreeListItem *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxTreeListItem));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxTreeListItem* other;

        if (sipParseArgs(&sipParseErr, sipArg, "1J8", sipType_wxTreeListItem, &other))
        {
            bool sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxTreeListItem___ne__(sipCpp, other);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI__dataview, ne_slot, sipType_wxTreeListItem, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_wxTreeListItem___eq__(PyObject *,PyObject *);}
static PyObject *slot_wxTreeListItem___eq__(PyObject *sipSelf,PyObject *sipArg)
{
     ::wxTreeListItem *sipCpp = reinterpret_cast< ::wxTreeListItem *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxTreeListItem));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxTreeListItem* other;

        if (sipParseArgs(&sipParseErr, sipArg, "1J8", sipType_wxTreeListItem, &other))
        {
            bool sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxTreeListItem___eq__(sipCpp, other);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI__dataview, eq_slot, sipType_wxTreeListItem, sipSelf, sipArg);
}


extern "C" {static long slot_wxTreeListItem___hash__(PyObject *);}
static long slot_wxTreeListItem___hash__(PyObject *sipSelf)
{
     ::wxTreeListItem *sipCpp = reinterpret_cast< ::wxTreeListItem *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxTreeListItem));

    if (!sipCpp)
        return 0L;


    {
        {
            long sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxTreeListItem___hash__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


extern "C" {static int slot_wxTreeListItem___bool__(PyObject *);}
static int slot_wxTreeListItem___bool__(PyObject *sipSelf)
{
     ::wxTreeListItem *sipCpp = reinterpret_cast< ::wxTreeListItem *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxTreeListItem));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxTreeListItem___bool__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


extern "C" {static int slot_wxTreeListItem___nonzero__(PyObject *);}
static int slot_wxTreeListItem___nonzero__(PyObject *sipSelf)
{
     ::wxTreeListItem *sipCpp = reinterpret_cast< ::wxTreeListItem *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxTreeListItem));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxTreeListItem___nonzero__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


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

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

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void assign_wxTreeListItem(void *, SIP_SSIZE_T, void *);}
static void assign_wxTreeListItem(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxTreeListItem *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxTreeListItem *>(sipSrc);
}


extern "C" {static void *copy_wxTreeListItem(const void *, SIP_SSIZE_T);}
static void *copy_wxTreeListItem(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxTreeListItem(reinterpret_cast<const  ::wxTreeListItem *>(sipSrc)[sipSrcIdx]);
}


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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxTreeListItem();
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const  ::wxTreeListItem* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_wxTreeListItem[] = {
    {(void *)slot_wxTreeListItem___ne__, ne_slot},
    {(void *)slot_wxTreeListItem___eq__, eq_slot},
    {(void *)slot_wxTreeListItem___hash__, hash_slot},
    {(void *)slot_wxTreeListItem___bool__, bool_slot},
    {(void *)slot_wxTreeListItem___nonzero__, bool_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_wxTreeListItem[] = {
    {SIP_MLNAME_CAST(sipName_IsOk), meth_wxTreeListItem_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeListItem_IsOk)}
};

PyDoc_STRVAR(doc_wxTreeListItem, "TreeListItem()\n"
"\n"
"Unique identifier of an item in wxTreeListCtrl.");


sipClassTypeDef sipTypeDef__dataview_wxTreeListItem = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxTreeListItem,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_TreeListItem,
        {0, 0, 1},
        1, methods_wxTreeListItem,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxTreeListItem,
    -1,
    -1,
    SIP_NULLPTR,
    slots_wxTreeListItem,
    init_type_wxTreeListItem,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxTreeListItem,
    assign_wxTreeListItem,
    array_wxTreeListItem,
    copy_wxTreeListItem,
    release_wxTreeListItem,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
