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

#include "sipAPI_core.h"

        #include <wx/affinematrix2dbase.h>



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

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

    Py_END_ALLOW_THREADS
}


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


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


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


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


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

    {
         ::wxDouble v11 = 1;
         ::wxDouble v12 = 0;
         ::wxDouble v21 = 0;
         ::wxDouble v22 = 1;

        static const char *sipKwdList[] = {
            sipName_v11,
            sipName_v12,
            sipName_v21,
            sipName_v22,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|dddd", &v11, &v12, &v21, &v22))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxMatrix2D(v11,v12,v21,v22);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const  ::wxMatrix2D* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


extern "C" {static PyObject *varget_wxMatrix2D_m_11(void *, PyObject *, PyObject *);}
static PyObject *varget_wxMatrix2D_m_11(void *sipSelf, PyObject *, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = sipCpp->m_11;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxMatrix2D_m_11(void *, PyObject *, PyObject *);}
static int varset_wxMatrix2D_m_11(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->m_11 = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_wxMatrix2D_m_12(void *, PyObject *, PyObject *);}
static PyObject *varget_wxMatrix2D_m_12(void *sipSelf, PyObject *, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = sipCpp->m_12;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxMatrix2D_m_12(void *, PyObject *, PyObject *);}
static int varset_wxMatrix2D_m_12(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->m_12 = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_wxMatrix2D_m_21(void *, PyObject *, PyObject *);}
static PyObject *varget_wxMatrix2D_m_21(void *sipSelf, PyObject *, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = sipCpp->m_21;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxMatrix2D_m_21(void *, PyObject *, PyObject *);}
static int varset_wxMatrix2D_m_21(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->m_21 = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_wxMatrix2D_m_22(void *, PyObject *, PyObject *);}
static PyObject *varget_wxMatrix2D_m_22(void *sipSelf, PyObject *, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = sipCpp->m_22;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxMatrix2D_m_22(void *, PyObject *, PyObject *);}
static int varset_wxMatrix2D_m_22(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::wxDouble sipVal;
     ::wxMatrix2D *sipCpp = reinterpret_cast< ::wxMatrix2D *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->m_22 = sipVal;

    return 0;
}

sipVariableDef variables_wxMatrix2D[] = {
    {InstanceVariable, sipName_m_11, (PyMethodDef *)varget_wxMatrix2D_m_11, (PyMethodDef *)varset_wxMatrix2D_m_11, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_m_12, (PyMethodDef *)varget_wxMatrix2D_m_12, (PyMethodDef *)varset_wxMatrix2D_m_12, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_m_21, (PyMethodDef *)varget_wxMatrix2D_m_21, (PyMethodDef *)varset_wxMatrix2D_m_21, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_m_22, (PyMethodDef *)varget_wxMatrix2D_m_22, (PyMethodDef *)varset_wxMatrix2D_m_22, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxMatrix2D, "Matrix2D(v11=1, v12=0, v21=0, v22=1)\n"
"\n"
"A simple container for 2x2 matrix.");


sipClassTypeDef sipTypeDef__core_wxMatrix2D = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxMatrix2D,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_Matrix2D,
        {0, 0, 1},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        4, variables_wxMatrix2D,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxMatrix2D,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxMatrix2D,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxMatrix2D,
    assign_wxMatrix2D,
    array_wxMatrix2D,
    copy_wxMatrix2D,
    release_wxMatrix2D,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
