/*
 * 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/image.h>
            #include <wx/image.h>



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

    delete reinterpret_cast< ::wxImage::HSVValue *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void *array_wxImage_HSVValue(SIP_SSIZE_T);}
static void *array_wxImage_HSVValue(SIP_SSIZE_T sipNrElem)
{
    return new  ::wxImage::HSVValue[sipNrElem];
}


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


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


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

    {
        double h = 0;
        double s = 0;
        double v = 0;

        static const char *sipKwdList[] = {
            sipName_h,
            sipName_s,
            sipName_v,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|ddd", &h, &s, &v))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxImage::HSVValue(h,s,v);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const  ::wxImage::HSVValue* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


extern "C" {static PyObject *varget_wxImage_HSVValue_hue(void *, PyObject *, PyObject *);}
static PyObject *varget_wxImage_HSVValue_hue(void *sipSelf, PyObject *, PyObject *)
{
    double sipVal;
     ::wxImage::HSVValue *sipCpp = reinterpret_cast< ::wxImage::HSVValue *>(sipSelf);

    sipVal = sipCpp->hue;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxImage_HSVValue_hue(void *, PyObject *, PyObject *);}
static int varset_wxImage_HSVValue_hue(void *sipSelf, PyObject *sipPy, PyObject *)
{
    double sipVal;
     ::wxImage::HSVValue *sipCpp = reinterpret_cast< ::wxImage::HSVValue *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

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

    sipCpp->hue = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_wxImage_HSVValue_saturation(void *, PyObject *, PyObject *);}
static PyObject *varget_wxImage_HSVValue_saturation(void *sipSelf, PyObject *, PyObject *)
{
    double sipVal;
     ::wxImage::HSVValue *sipCpp = reinterpret_cast< ::wxImage::HSVValue *>(sipSelf);

    sipVal = sipCpp->saturation;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxImage_HSVValue_saturation(void *, PyObject *, PyObject *);}
static int varset_wxImage_HSVValue_saturation(void *sipSelf, PyObject *sipPy, PyObject *)
{
    double sipVal;
     ::wxImage::HSVValue *sipCpp = reinterpret_cast< ::wxImage::HSVValue *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

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

    sipCpp->saturation = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_wxImage_HSVValue_value(void *, PyObject *, PyObject *);}
static PyObject *varget_wxImage_HSVValue_value(void *sipSelf, PyObject *, PyObject *)
{
    double sipVal;
     ::wxImage::HSVValue *sipCpp = reinterpret_cast< ::wxImage::HSVValue *>(sipSelf);

    sipVal = sipCpp->value;

    return PyFloat_FromDouble(sipVal);
}


extern "C" {static int varset_wxImage_HSVValue_value(void *, PyObject *, PyObject *);}
static int varset_wxImage_HSVValue_value(void *sipSelf, PyObject *sipPy, PyObject *)
{
    double sipVal;
     ::wxImage::HSVValue *sipCpp = reinterpret_cast< ::wxImage::HSVValue *>(sipSelf);

    sipVal = PyFloat_AsDouble(sipPy);

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

    sipCpp->value = sipVal;

    return 0;
}

sipVariableDef variables_wxImage_HSVValue[] = {
    {InstanceVariable, sipName_hue, (PyMethodDef *)varget_wxImage_HSVValue_hue, (PyMethodDef *)varset_wxImage_HSVValue_hue, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_saturation, (PyMethodDef *)varget_wxImage_HSVValue_saturation, (PyMethodDef *)varset_wxImage_HSVValue_saturation, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_value, (PyMethodDef *)varget_wxImage_HSVValue_value, (PyMethodDef *)varset_wxImage_HSVValue_value, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxImage_HSVValue, "HSVValue(h=0.0, s=0.0, v=0.0)\n"
"\n"
"A simple class which stores hue, saturation and value as doubles in\n"
"the range 0.0-1.0.");


sipClassTypeDef sipTypeDef__core_wxImage_HSVValue = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxImage__HSVValue,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_HSVValue,
        {251, 255, 0},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        3, variables_wxImage_HSVValue,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxImage_HSVValue,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxImage_HSVValue,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxImage_HSVValue,
    assign_wxImage_HSVValue,
    array_wxImage_HSVValue,
    copy_wxImage_HSVValue,
    release_wxImage_HSVValue,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
