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

#include "sipAPI_propgrid.h"
        #include <wx/propgrid/property.h>
        #include <wx/colour.h>
        #include <wx/font.h>
        #include <wx/bmpbndl.h>
        #include <wx/propgrid/property.h>
        #include <wx/propgrid/property.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxPGChoiceEntry : public ::wxPGChoiceEntry
{
public:
    sipwxPGChoiceEntry();
    sipwxPGChoiceEntry(const ::wxPGChoiceEntry&);
    sipwxPGChoiceEntry(const ::wxString&, int);
    ~sipwxPGChoiceEntry();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxPGChoiceEntry(const sipwxPGChoiceEntry &);
    sipwxPGChoiceEntry &operator = (const sipwxPGChoiceEntry &);
};

sipwxPGChoiceEntry::sipwxPGChoiceEntry(): ::wxPGChoiceEntry(), sipPySelf(SIP_NULLPTR)
{
}

sipwxPGChoiceEntry::sipwxPGChoiceEntry(const ::wxPGChoiceEntry& other): ::wxPGChoiceEntry(other), sipPySelf(SIP_NULLPTR)
{
}

sipwxPGChoiceEntry::sipwxPGChoiceEntry(const ::wxString& label, int value): ::wxPGChoiceEntry(label, value), sipPySelf(SIP_NULLPTR)
{
}

sipwxPGChoiceEntry::~sipwxPGChoiceEntry()
{
    sipInstanceDestroyedEx(&sipPySelf);
}


PyDoc_STRVAR(doc_wxPGChoiceEntry_SetValue, "SetValue(value)");

extern "C" {static PyObject *meth_wxPGChoiceEntry_SetValue(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxPGChoiceEntry_SetValue(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int value;
        ::wxPGChoiceEntry *sipCpp;

        static const char *sipKwdList[] = {
            sipName_value,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxPGChoiceEntry, &sipCpp, &value))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetValue(value);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_PGChoiceEntry, sipName_SetValue, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPGChoiceEntry_GetValue, "GetValue() -> int");

extern "C" {static PyObject *meth_wxPGChoiceEntry_GetValue(PyObject *, PyObject *);}
static PyObject *meth_wxPGChoiceEntry_GetValue(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxPGChoiceEntry *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPGChoiceEntry, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetValue();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_PGChoiceEntry, sipName_GetValue, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxPGChoiceEntry(void *, const sipTypeDef *);}
static void *cast_wxPGChoiceEntry(void *sipCppV, const sipTypeDef *targetType)
{
    ::wxPGChoiceEntry *sipCpp = reinterpret_cast<::wxPGChoiceEntry *>(sipCppV);

    if (targetType == sipType_wxPGChoiceEntry)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxPGCell)->ctd_cast(static_cast<::wxPGCell *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxPGChoiceEntry *>(sipCppV);
    else
        delete reinterpret_cast<::wxPGChoiceEntry *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


extern "C" {static void dealloc_wxPGChoiceEntry(sipSimpleWrapper *);}
static void dealloc_wxPGChoiceEntry(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipwxPGChoiceEntry *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxPGChoiceEntry(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_wxPGChoiceEntry(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxPGChoiceEntry(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipwxPGChoiceEntry *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPGChoiceEntry();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxPGChoiceEntry* other;

        static const char *sipKwdList[] = {
            sipName_other,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxPGChoiceEntry, &other))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPGChoiceEntry(*other);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxString* label;
        int labelState = 0;
        int value = wxPG_INVALID_VALUE;

        static const char *sipKwdList[] = {
            sipName_label,
            sipName_value,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|i", sipType_wxString, &label, &labelState, &value))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPGChoiceEntry(*label, value);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxString *>(label), sipType_wxString, labelState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxPGChoiceEntry[] = {{26, 255, 1}};


static PyMethodDef methods_wxPGChoiceEntry[] = {
    {sipName_GetValue, meth_wxPGChoiceEntry_GetValue, METH_VARARGS, doc_wxPGChoiceEntry_GetValue},
    {sipName_SetValue, SIP_MLMETH_CAST(meth_wxPGChoiceEntry_SetValue), METH_VARARGS|METH_KEYWORDS, doc_wxPGChoiceEntry_SetValue}
};

sipVariableDef variables_wxPGChoiceEntry[] = {
    {PropertyVariable, sipName_Value, &methods_wxPGChoiceEntry[0], &methods_wxPGChoiceEntry[1], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxPGChoiceEntry, "PGChoiceEntry()\n"
"PGChoiceEntry(other)\n"
"PGChoiceEntry(label, value=PG_INVALID_VALUE)\n"
"\n"
"Data of a single wxPGChoices choice.");


sipClassTypeDef sipTypeDef__propgrid_wxPGChoiceEntry = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxPGChoiceEntry,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_PGChoiceEntry,
        {0, 0, 1},
        2, methods_wxPGChoiceEntry,
        0, SIP_NULLPTR,
        1, variables_wxPGChoiceEntry,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPGChoiceEntry,
    -1,
    -1,
    supers_wxPGChoiceEntry,
    SIP_NULLPTR,
    init_type_wxPGChoiceEntry,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxPGChoiceEntry,
    assign_wxPGChoiceEntry,
    array_wxPGChoiceEntry,
    copy_wxPGChoiceEntry,
    release_wxPGChoiceEntry,
    cast_wxPGChoiceEntry,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
