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

#include "sipAPI_propgrid.h"




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


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


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


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



extern "C" {static int convertTo_wxPGVariant(PyObject *, void **, int *, PyObject *);}
static int convertTo_wxPGVariant(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj)
{
    ::wxPGVariant **sipCppPtr = reinterpret_cast< ::wxPGVariant **>(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(wxPGVariant_in_helper(sipPy));
        *sipCppPtr = value;
        return sipGetState(sipTransferObj);
}


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


sipMappedTypeDef sipTypeDef__propgrid_wxPGVariant = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ALLOW_NONE|SIP_TYPE_MAPPED,
        sipNameNr_wxPGVariant,
        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_wxPGVariant,
    array_wxPGVariant,
    copy_wxPGVariant,
    release_wxPGVariant,
    convertTo_wxPGVariant,
    convertFrom_wxPGVariant
};
