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

#include "sipAPI_xrc.h"
        #include <wx/object.h>


class sipwxXmlSubclassFactory : public ::wxXmlSubclassFactory
{
public:
    sipwxXmlSubclassFactory();
    sipwxXmlSubclassFactory(const ::wxXmlSubclassFactory&);
    virtual ~sipwxXmlSubclassFactory();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    ::wxObject* Create(const ::wxString&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipwxXmlSubclassFactory::sipwxXmlSubclassFactory(): ::wxXmlSubclassFactory(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxXmlSubclassFactory::sipwxXmlSubclassFactory(const ::wxXmlSubclassFactory& a0): ::wxXmlSubclassFactory(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

::wxObject* sipwxXmlSubclassFactory::Create(const ::wxString& className)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, sipName_XmlSubclassFactory, sipName_Create);

    if (!sipMeth)
        return 0;

    extern ::wxObject* sipVH__xrc_2(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);

    return sipVH__xrc_2(sipGILState, 0, sipPySelf, sipMeth, className);
}


PyDoc_STRVAR(doc_wxXmlSubclassFactory_Create, "Create(className) -> Object");

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

    {
        const ::wxString* className;
        int classNameState = 0;
        ::wxXmlSubclassFactory *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxXmlSubclassFactory, &sipCpp, sipType_wxString, &className, &classNameState))
        {
            ::wxObject*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_XmlSubclassFactory, sipName_Create);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->Create(*className);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(className), sipType_wxString, classNameState);

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_XmlSubclassFactory, sipName_Create, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxXmlSubclassFactory *>(sipCppV);
    else
        delete reinterpret_cast< ::wxXmlSubclassFactory *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxXmlSubclassFactory();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxXmlSubclassFactory* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxXmlSubclassFactory[] = {
    {sipName_Create, SIP_MLMETH_CAST(meth_wxXmlSubclassFactory_Create), METH_VARARGS|METH_KEYWORDS, doc_wxXmlSubclassFactory_Create}
};

PyDoc_STRVAR(doc_wxXmlSubclassFactory, "XmlSubclassFactory() -> None");


sipClassTypeDef sipTypeDef__xrc_wxXmlSubclassFactory = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxXmlSubclassFactory,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_XmlSubclassFactory,
        {0, 0, 1},
        1, methods_wxXmlSubclassFactory,
        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},
    },
    doc_wxXmlSubclassFactory,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxXmlSubclassFactory,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxXmlSubclassFactory,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxXmlSubclassFactory,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxXmlSubclassFactory),
};
