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

#include "sipAPI_richtext.h"
        
        
        class wxRichTextObjectList_iterator {
        public:
            wxRichTextObjectList_iterator(wxRichTextObjectList::compatibility_iterator start)
                : m_node(start) {}

            wxRichTextObject* __next__() {
                wxRichTextObject* obj = NULL;
                if (m_node) {
                    obj = (wxRichTextObject*) m_node->GetData();
                    m_node = m_node->GetNext();
                }
                else {
                    PyErr_SetString(PyExc_StopIteration, "");
                }
                return (wxRichTextObject*)obj;
            }
        private:
            wxRichTextObjectList::compatibility_iterator m_node;
        };
        #include <wx/richtext/richtextbuffer.h>


extern "C" {static PyObject *slot_wxRichTextObjectList_iterator___iter__(PyObject *);}
static PyObject *slot_wxRichTextObjectList_iterator___iter__(PyObject *sipSelf)
{
    ::wxRichTextObjectList_iterator *sipCpp = reinterpret_cast<::wxRichTextObjectList_iterator *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxRichTextObjectList_iterator));

    if (!sipCpp)
        return SIP_NULLPTR;


    {
        {
            PyObject * sipRes = SIP_NULLPTR;
        return PyObject_SelfIter(sipSelf);

            return sipRes;
        }
    }

    return 0;
}


extern "C" {static PyObject *slot_wxRichTextObjectList_iterator___next__(PyObject *);}
static PyObject *slot_wxRichTextObjectList_iterator___next__(PyObject *sipSelf)
{
    ::wxRichTextObjectList_iterator *sipCpp = reinterpret_cast<::wxRichTextObjectList_iterator *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxRichTextObjectList_iterator));

    if (!sipCpp)
        return SIP_NULLPTR;


    {
        {
            ::wxRichTextObject*sipRes = 0;
        sipRes = sipCpp->__next__();
        if (PyErr_Occurred())
            return NULL;

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

    return 0;
}


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

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

    Py_END_ALLOW_THREADS
}


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


/* Define this type's Python slots. */
static sipPySlotDef slots_wxRichTextObjectList_iterator[] = {
    {(void *)slot_wxRichTextObjectList_iterator___iter__, iter_slot},
    {(void *)slot_wxRichTextObjectList_iterator___next__, next_slot},
    {0, (sipPySlotType)0}
};


sipClassTypeDef sipTypeDef__richtext_wxRichTextObjectList_iterator = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxRichTextObjectList_iterator,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_RichTextObjectList_iterator,
        {0, 0, 1},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    SIP_NULLPTR,
    -1,
    -1,
    SIP_NULLPTR,
    slots_wxRichTextObjectList_iterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxRichTextObjectList_iterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxRichTextObjectList_iterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    0,
};
