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

#include "sipAPI_core.h"
        #include <wx/dcmirror.h>
        #include <wx/dc.h>
    #include <wx/setup.h>
    #include <wxPython/wxpy_api.h>
        #include <wx/gdicmn.h>
        #include <wx/graphics.h>
        #include <wx/bitmap.h>
        #include <wx/gdicmn.h>
        #include <wx/palette.h>
        #include <wx/gdicmn.h>
        #include <wx/colour.h>
        #include <wx/affinematrix2d.h>
        #include <wx/pen.h>
        #include "arrayholder.h"
        #include <wx/brush.h>
        #include <wx/font.h>
        #include <wx/dc.h>
        #include <wx/region.h>
        #include <wx/icon.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxMirrorDC : public ::wxMirrorDC
{
public:
    sipwxMirrorDC(::wxDC&, bool);
    ~sipwxMirrorDC();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxMirrorDC(const sipwxMirrorDC &);
    sipwxMirrorDC &operator = (const sipwxMirrorDC &);
};

sipwxMirrorDC::sipwxMirrorDC(::wxDC& dc, bool mirror): ::wxMirrorDC(dc, mirror), sipPySelf(SIP_NULLPTR)
{
}

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


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

    if (targetType == sipType_wxMirrorDC)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxDC)->ctd_cast(static_cast<::wxDC *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxMirrorDC *>(sipCppV);
    else
        delete reinterpret_cast<::wxMirrorDC *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxDC* dc;
        bool mirror;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9b", sipType_wxDC, &dc, &mirror))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMirrorDC(*dc, mirror);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

PyDoc_STRVAR(doc_wxMirrorDC, "MirrorDC(dc, mirror)\n"
"\n"
"wxMirrorDC is a simple wrapper class which is always associated with a\n"
"real wxDC object and either forwards all of its operations to it\n"
"without changes (no mirroring takes place) or exchanges x and y\n"
"coordinates which makes it possible to reuse the same code to draw a\n"
"figure and its mirror  i.e.");


sipClassTypeDef sipTypeDef__core_wxMirrorDC = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxMirrorDC,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_MirrorDC,
        {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_wxMirrorDC,
    -1,
    -1,
    supers_wxMirrorDC,
    SIP_NULLPTR,
    init_type_wxMirrorDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxMirrorDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxMirrorDC,
    cast_wxMirrorDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
