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

#include "sipAPI_richtext.h"

        #include <wx/richtext/richtextstyles.h>

        #include <wx/richtext/richtextbuffer.h>
        #include <wx/richtext/richtextbuffer.h>
        #include <wx/richtext/richtextstyles.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxRichTextCharacterStyleDefinition : public  ::wxRichTextCharacterStyleDefinition
{
public:
    sipwxRichTextCharacterStyleDefinition(const  ::wxString&);
    sipwxRichTextCharacterStyleDefinition(const  ::wxRichTextCharacterStyleDefinition&);
    virtual ~sipwxRichTextCharacterStyleDefinition();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxRichTextAttr GetStyleMergedWithBase(const  ::wxRichTextStyleSheet*) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipwxRichTextCharacterStyleDefinition::sipwxRichTextCharacterStyleDefinition(const  ::wxString& name):  ::wxRichTextCharacterStyleDefinition(name), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

 ::wxRichTextAttr sipwxRichTextCharacterStyleDefinition::GetStyleMergedWithBase(const  ::wxRichTextStyleSheet*sheet) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,SIP_NULLPTR,sipName_GetStyleMergedWithBase);

    if (!sipMeth)
        return  ::wxRichTextCharacterStyleDefinition::GetStyleMergedWithBase(sheet);

    extern  ::wxRichTextAttr sipVH__richtext_158(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxRichTextStyleSheet*);

    return sipVH__richtext_158(sipGILState, 0, sipPySelf, sipMeth, sheet);
}


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

    if (targetType == sipType_wxRichTextStyleDefinition)
        return static_cast< ::wxRichTextStyleDefinition *>(sipCpp);

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRichTextCharacterStyleDefinition *>(sipCppV);
    else
        delete reinterpret_cast< ::wxRichTextCharacterStyleDefinition *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void assign_wxRichTextCharacterStyleDefinition(void *, SIP_SSIZE_T, void *);}
static void assign_wxRichTextCharacterStyleDefinition(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxRichTextCharacterStyleDefinition *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxRichTextCharacterStyleDefinition *>(sipSrc);
}


extern "C" {static void *copy_wxRichTextCharacterStyleDefinition(const void *, SIP_SSIZE_T);}
static void *copy_wxRichTextCharacterStyleDefinition(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxRichTextCharacterStyleDefinition(reinterpret_cast<const  ::wxRichTextCharacterStyleDefinition *>(sipSrc)[sipSrcIdx]);
}


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

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


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

    {
        const  ::wxString& namedef = wxEmptyString;
        const  ::wxString* name = &namedef;
        int nameState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J1", sipType_wxString,&name, &nameState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRichTextCharacterStyleDefinition(*name);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(name),sipType_wxString,nameState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxRichTextCharacterStyleDefinition* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

PyDoc_STRVAR(doc_wxRichTextCharacterStyleDefinition, "RichTextCharacterStyleDefinition(name=wx.EmptyString)\n"
"\n"
"This class represents a character style definition, usually added to a\n"
"wxRichTextStyleSheet.");


sipClassTypeDef sipTypeDef__richtext_wxRichTextCharacterStyleDefinition = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRichTextCharacterStyleDefinition,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_RichTextCharacterStyleDefinition,
        {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},
    },
    doc_wxRichTextCharacterStyleDefinition,
    -1,
    -1,
    supers_wxRichTextCharacterStyleDefinition,
    SIP_NULLPTR,
    init_type_wxRichTextCharacterStyleDefinition,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxRichTextCharacterStyleDefinition,
    assign_wxRichTextCharacterStyleDefinition,
    array_wxRichTextCharacterStyleDefinition,
    copy_wxRichTextCharacterStyleDefinition,
    release_wxRichTextCharacterStyleDefinition,
    cast_wxRichTextCharacterStyleDefinition,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
