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

#include "sipAPI_propgrid.h"




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


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


extern "C" {static void *copy_wxPGVariant(const void *, SIP_SSIZE_T);}
static void *copy_wxPGVariant(const void *sipSrc, SIP_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 *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast< ::wxPGVariant *>(ptr);
    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,
        0,
        SIP_TYPE_ALLOW_NONE|SIP_TYPE_MAPPED,
        sipNameNr_wxPGVariant,     /* wxPGVariant */
        {0},
        0
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_wxPGVariant,
    array_wxPGVariant,
    copy_wxPGVariant,
    release_wxPGVariant,
    convertTo_wxPGVariant,
    convertFrom_wxPGVariant
};
