/*
 * 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/withimages.h>

        #include <wx/imaglist.h>


class sipwxWithImages : public  ::wxWithImages
{
public:
    sipwxWithImages();
    virtual ~sipwxWithImages();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void SetImageList( ::wxImageList*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxWithImages(const sipwxWithImages &);
    sipwxWithImages &operator = (const sipwxWithImages &);

    char sipPyMethods[1];
};

sipwxWithImages::sipwxWithImages():  ::wxWithImages(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxWithImages::SetImageList( ::wxImageList*imageList)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_SetImageList);

    if (!sipMeth)
    {
         ::wxWithImages::SetImageList(imageList);
        return;
    }

    extern void sipVH__core_140(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxImageList*);

    sipVH__core_140(sipGILState, 0, sipPySelf, sipMeth, imageList);
}


PyDoc_STRVAR(doc_wxWithImages_AssignImageList, "AssignImageList(imageList)\n"
"\n"
"Sets the image list for the page control and takes ownership of the\n"
"list.");

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

    {
         ::wxImageList* imageList;
         ::wxWithImages *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ:", &sipSelf, sipType_wxWithImages, &sipCpp, sipType_wxImageList, &imageList))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->AssignImageList(imageList);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_WithImages, sipName_AssignImageList, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWithImages_SetImageList, "SetImageList(imageList)\n"
"\n"
"Sets the image list to use.");

extern "C" {static PyObject *meth_wxWithImages_SetImageList(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxWithImages_SetImageList(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
         ::wxImageList* imageList;
         ::wxWithImages *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxWithImages, &sipCpp, sipType_wxImageList, &imageList))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp-> ::wxWithImages::SetImageList(imageList) : sipCpp->SetImageList(imageList));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_WithImages, sipName_SetImageList, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWithImages_GetImageList, "GetImageList() -> ImageList\n"
"\n"
"Returns the associated image list, may be NULL.");

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

    {
        const  ::wxWithImages *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetImageList();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes,sipType_wxImageList,SIP_NULLPTR);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_WithImages, sipName_GetImageList, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxWithImages *>(sipCppV);
    else
        delete reinterpret_cast< ::wxWithImages *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxWithImages();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxWithImages[] = {
    {SIP_MLNAME_CAST(sipName_AssignImageList), SIP_MLMETH_CAST(meth_wxWithImages_AssignImageList), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWithImages_AssignImageList)},
    {SIP_MLNAME_CAST(sipName_GetImageList), meth_wxWithImages_GetImageList, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWithImages_GetImageList)},
    {SIP_MLNAME_CAST(sipName_SetImageList), SIP_MLMETH_CAST(meth_wxWithImages_SetImageList), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWithImages_SetImageList)}
};

static sipEnumMemberDef enummembers_wxWithImages[] = {
    {sipName_NO_IMAGE, static_cast<int>( ::wxWithImages::NO_IMAGE), -1},
};

sipVariableDef variables_wxWithImages[] = {
    {PropertyVariable, sipName_ImageList, &methods_wxWithImages[1], &methods_wxWithImages[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxWithImages, "WithImages()\n"
"\n"
"A mixin class to be used with other classes that use a wxImageList.");


sipClassTypeDef sipTypeDef__core_wxWithImages = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxWithImages,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_WithImages,
        {0, 0, 1},
        3, methods_wxWithImages,
        1, enummembers_wxWithImages,
        1, variables_wxWithImages,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxWithImages,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxWithImages,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxWithImages,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxWithImages,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
