/*
 * 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/iconloc.h>
    wxIconLocation* _wxIconLocation_ctor()
    {
        return new wxIconLocation;
    }
    wxIconLocation* _wxIconLocation_ctor(const wxString* filename, int num)
    {
        #ifdef __WXMSW__
            return new wxIconLocation(*filename, num);
        #else
            return new wxIconLocation(*filename);
        #endif
    }
    int _wxIconLocation___nonzero__(wxIconLocation* self)
    {
        return self->IsOk();
    }
    int _wxIconLocation___bool__(wxIconLocation* self)
    {
        return self->IsOk();
    }
    int _wxIconLocation_GetIndex(wxIconLocation* self)
    {
        #ifdef __WXMSW__
            return self->GetIndex();
        #else
            return -1;
        #endif
    }
    void _wxIconLocation_SetIndex(wxIconLocation* self, int num)
    {
        #ifdef __WXMSW__
            self->SetIndex(num);
        #endif
    }


PyDoc_STRVAR(doc_wxIconLocation_IsOk, "IsOk() -> bool\n"
"\n"
"Returns true if the object is valid, i.e. was properly initialized,\n"
"and false otherwise.");

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

    {
        const ::wxIconLocation *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsOk();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_IconLocation, sipName_IsOk, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIconLocation_SetFileName, "SetFileName(filename) -> None");

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

    {
        const ::wxString* filename;
        int filenameState = 0;
        ::wxIconLocation *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxIconLocation, &sipCpp, sipType_wxString, &filename, &filenameState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetFileName(*filename);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(filename), sipType_wxString, filenameState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_IconLocation, sipName_SetFileName, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIconLocation_GetFileName, "GetFileName() -> str");

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

    {
        const ::wxIconLocation *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
        {
            ::wxString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString(sipCpp->GetFileName());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes, sipType_wxString, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_IconLocation, sipName_GetFileName, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIconLocation___nonzero__, "__nonzero__() -> bool");

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

    {
        ::wxIconLocation *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxIconLocation___nonzero__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_IconLocation, sipName___nonzero__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIconLocation_GetIndex, "GetIndex() -> int");

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

    {
        ::wxIconLocation *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxIconLocation_GetIndex(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_IconLocation, sipName_GetIndex, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIconLocation_SetIndex, "SetIndex(num) -> None");

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

    {
        int num;
        ::wxIconLocation *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxIconLocation, &sipCpp, &num))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxIconLocation_SetIndex(sipCpp, num);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_IconLocation, sipName_SetIndex, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static int slot_wxIconLocation___bool__(PyObject *);}
static int slot_wxIconLocation___bool__(PyObject *sipSelf)
{
    ::wxIconLocation *sipCpp = reinterpret_cast< ::wxIconLocation *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxIconLocation));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxIconLocation___bool__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const ::wxString* filename;
        int filenameState = 0;
        int num = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J0|i", sipType_wxString, &filename, &filenameState, &num))
        {
        PyErr_Clear();
        sipCpp = _wxIconLocation_ctor(filename, num);
            sipReleaseType(const_cast< ::wxString *>(filename), sipType_wxString, filenameState);

            return sipCpp;
        }
    }

    {
        const ::wxIconLocation* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_wxIconLocation[] = {
    {(void *)slot_wxIconLocation___bool__, bool_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_wxIconLocation[] = {
    {sipName_GetFileName, meth_wxIconLocation_GetFileName, METH_VARARGS, doc_wxIconLocation_GetFileName},
    {sipName_GetIndex, meth_wxIconLocation_GetIndex, METH_VARARGS, doc_wxIconLocation_GetIndex},
    {sipName_IsOk, meth_wxIconLocation_IsOk, METH_VARARGS, doc_wxIconLocation_IsOk},
    {sipName_SetFileName, SIP_MLMETH_CAST(meth_wxIconLocation_SetFileName), METH_VARARGS|METH_KEYWORDS, doc_wxIconLocation_SetFileName},
    {sipName_SetIndex, SIP_MLMETH_CAST(meth_wxIconLocation_SetIndex), METH_VARARGS|METH_KEYWORDS, doc_wxIconLocation_SetIndex},
    {sipName___nonzero__, meth_wxIconLocation___nonzero__, METH_VARARGS, doc_wxIconLocation___nonzero__}
};

sipVariableDef variables_wxIconLocation[] = {
    {PropertyVariable, sipName_Index, &methods_wxIconLocation[1], &methods_wxIconLocation[4], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_FileName, &methods_wxIconLocation[0], &methods_wxIconLocation[3], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxIconLocation, "IconLocation() -> None\n"
"IconLocation(filename, num=0) -> None\n"
"\n"
"wxIconLocation is a tiny class describing the location of an\n"
"(external, i.e.");


sipClassTypeDef sipTypeDef__core_wxIconLocation = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxIconLocation,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_IconLocation,
        {0, 0, 1},
        6, methods_wxIconLocation,
        0, SIP_NULLPTR,
        2, variables_wxIconLocation,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxIconLocation,
    -1,
    -1,
    SIP_NULLPTR,
    slots_wxIconLocation,
    init_type_wxIconLocation,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxIconLocation,
    assign_wxIconLocation,
    SIP_NULLPTR,
    copy_wxIconLocation,
    release_wxIconLocation,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxIconLocation),
};
