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

#include "sipAPI_core.h"

        #include <wx/dcmemory.h>

        #include <wx/dc.h>
        #include <wx/bitmap.h>
    #include <wx/setup.h>
    #include <wxPython/wxpy_api.h>
        #include <wx/gdicmn.h>
        #include <wx/graphics.h>
        #include <wx/gdicmn.h>
        #include <wx/palette.h>
        #include <wx/colour.h>
        #include <wx/gdicmn.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 sipwxMemoryDC : public  ::wxMemoryDC
{
public:
    sipwxMemoryDC();
    sipwxMemoryDC( ::wxDC*);
    sipwxMemoryDC( ::wxBitmap&);
    ~sipwxMemoryDC();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxMemoryDC::sipwxMemoryDC():  ::wxMemoryDC(), sipPySelf(SIP_NULLPTR)
{
}

sipwxMemoryDC::sipwxMemoryDC( ::wxDC*dc):  ::wxMemoryDC(dc), sipPySelf(SIP_NULLPTR)
{
}

sipwxMemoryDC::sipwxMemoryDC( ::wxBitmap& bitmap):  ::wxMemoryDC(bitmap), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxMemoryDC_SelectObject, "SelectObject(bitmap)\n"
"\n"
"Works exactly like SelectObjectAsSource() but this is the function you\n"
"should use when you select a bitmap because you want to modify it,\n"
"e.g.");

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

    {
         ::wxBitmap* bitmap;
         ::wxMemoryDC *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxMemoryDC, &sipCpp, sipType_wxBitmap, &bitmap))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SelectObject(*bitmap);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_MemoryDC, sipName_SelectObject, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxMemoryDC_SelectObjectAsSource, "SelectObjectAsSource(bitmap)\n"
"\n"
"Selects the given bitmap into the device context, to use as the memory\n"
"bitmap.");

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

    {
        const  ::wxBitmap* bitmap;
         ::wxMemoryDC *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxMemoryDC, &sipCpp, sipType_wxBitmap, &bitmap))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SelectObjectAsSource(*bitmap);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_MemoryDC, sipName_SelectObjectAsSource, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxMemoryDC_GetSelectedBitmap, "GetSelectedBitmap() -> Bitmap");

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

    {
         ::wxMemoryDC *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = &sipCpp->GetSelectedBitmap();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_MemoryDC, sipName_GetSelectedBitmap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxDC)
        return static_cast< ::wxDC *>(sipCpp);

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

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxMemoryDC *>(sipCppV);
    else
        delete reinterpret_cast< ::wxMemoryDC *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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

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


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

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

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMemoryDC();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
         ::wxDC* dc;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8", sipType_wxDC, &dc))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMemoryDC(dc);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
         ::wxBitmap* bitmap;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxBitmap, &bitmap))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMemoryDC(*bitmap);
            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_wxMemoryDC[] = {{97, 255, 1}};


static PyMethodDef methods_wxMemoryDC[] = {
    {SIP_MLNAME_CAST(sipName_GetSelectedBitmap), meth_wxMemoryDC_GetSelectedBitmap, METH_VARARGS, SIP_MLDOC_CAST(doc_wxMemoryDC_GetSelectedBitmap)},
    {SIP_MLNAME_CAST(sipName_SelectObject), SIP_MLMETH_CAST(meth_wxMemoryDC_SelectObject), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryDC_SelectObject)},
    {SIP_MLNAME_CAST(sipName_SelectObjectAsSource), SIP_MLMETH_CAST(meth_wxMemoryDC_SelectObjectAsSource), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryDC_SelectObjectAsSource)}
};

sipVariableDef variables_wxMemoryDC[] = {
    {PropertyVariable, sipName_SelectedBitmap, &methods_wxMemoryDC[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxMemoryDC, "MemoryDC()\n"
"MemoryDC(dc)\n"
"MemoryDC(bitmap)\n"
"\n"
"A memory device context provides a means to draw graphics onto a\n"
"bitmap.");


sipClassTypeDef sipTypeDef__core_wxMemoryDC = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxMemoryDC,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_MemoryDC,
        {0, 0, 1},
        3, methods_wxMemoryDC,
        0, SIP_NULLPTR,
        1, variables_wxMemoryDC,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxMemoryDC,
    -1,
    -1,
    supers_wxMemoryDC,
    SIP_NULLPTR,
    init_type_wxMemoryDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxMemoryDC,
    SIP_NULLPTR,
    array_wxMemoryDC,
    SIP_NULLPTR,
    release_wxMemoryDC,
    cast_wxMemoryDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
