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

#include "sipAPI_core.h"




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


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


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


/* Call the mapped type's destructor. */
extern "C" {static void release_wxTreeItemData(void *, int);}
static void release_wxTreeItemData(void *sipCppV, int)
{
    ::wxTreeItemData *sipCpp = reinterpret_cast< ::wxTreeItemData *>(sipCppV);
    Py_BEGIN_ALLOW_THREADS
    delete sipCpp;
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_wxTreeItemData(PyObject *, void **, int *, PyObject *);}
static int convertTo_wxTreeItemData(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj)
{
    ::wxTreeItemData **sipCppPtr = reinterpret_cast< ::wxTreeItemData **>(sipCppPtrV);
        // Code to test a PyObject for compatibility
        if (!sipIsErr) {
            return TRUE; // any python object is valid
        }

        // Code to create a new wxTreeItemData from the PyObject
        wxPyTreeItemData* data =  new wxPyTreeItemData(sipPy);
        *sipCppPtr = data;
        return sipGetState(sipTransferObj);
}


extern "C" {static PyObject *convertFrom_wxTreeItemData(void *, PyObject *);}
static PyObject *convertFrom_wxTreeItemData(void *sipCppV, PyObject *)
{
    ::wxTreeItemData *sipCpp = reinterpret_cast< ::wxTreeItemData *>(sipCppV);
        // Code to convert a wxPyTreeItemData back to the PyObject.
        PyObject* obj;
        obj = wxPyTreeItemData::SafeGetData(static_cast<wxPyTreeItemData*>(sipCpp));
        return obj;
}


sipMappedTypeDef sipTypeDef__core_wxTreeItemData = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_MAPPED,
        sipNameNr_wxTreeItemData,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        -1,
        {0, 0, 1},
        0, SIP_NULLPTR,
        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}
    },
    assign_wxTreeItemData,
    array_wxTreeItemData,
    copy_wxTreeItemData,
    release_wxTreeItemData,
    convertTo_wxTreeItemData,
    convertFrom_wxTreeItemData
};
