/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     Copyright: (c) 2020 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 *array_wxImage_HSVValue(Py_ssize_t);}
static void *array_wxImage_HSVValue(Py_ssize_t sipNrElem)
{
    return new ::wxImage::HSVValue[sipNrElem];
}


extern "C" {static void array_delete_wxImage_HSVValue(void *);}
static void array_delete_wxImage_HSVValue(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxImage::HSVValue *>(sipCpp);
}


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


extern "C" {static void *copy_wxImage_HSVValue(const void *, Py_ssize_t);}
static void *copy_wxImage_HSVValue(const void *sipSrc, Py_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) -> None\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,
        {278, 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,
    SIP_NULLPTR,
    SIP_NULLPTR,
    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,
    array_delete_wxImage_HSVValue,
    sizeof (::wxImage::HSVValue),
};
