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

#include "sipAPI_dataview.h"




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


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


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


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



extern "C" {static int convertTo_wxDVCVariant(PyObject *, void **, int *, PyObject *);}
static int convertTo_wxDVCVariant(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj)
{
    ::wxDVCVariant **sipCppPtr = reinterpret_cast< ::wxDVCVariant **>(sipCppPtrV);
        // Code to test a PyObject for compatibility.
        if (!sipIsErr) {
            // Any type should work since we'll just use the PyObject directly
            // if the type is not one that is explicitly supported.
            return TRUE;
        }

        // Code to create a new wxVariant from the PyObject
        wxVariant* value =  new wxVariant(wxDVCVariant_in_helper(sipPy));
        *sipCppPtr = value;
        return sipGetState(sipTransferObj);
}


extern "C" {static PyObject *convertFrom_wxDVCVariant(void *, PyObject *);}
static PyObject *convertFrom_wxDVCVariant(void *sipCppV, PyObject *)
{
    ::wxDVCVariant *sipCpp = reinterpret_cast< ::wxDVCVariant *>(sipCppV);
        // Code to convert a wxVariant to a PyObject.
        if (sipCpp == NULL) {
            return Py_None;
        } else {
            return wxDVCVariant_out_helper(*sipCpp);
        }
}


sipMappedTypeDef sipTypeDef__dataview_wxDVCVariant = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ALLOW_NONE|SIP_TYPE_MAPPED,
        sipNameNr_wxDVCVariant,
        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_wxDVCVariant,
    array_wxDVCVariant,
    copy_wxDVCVariant,
    release_wxDVCVariant,
    convertTo_wxDVCVariant,
    convertFrom_wxDVCVariant
};
