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

#include "sipAPI_core.h"
        #include <wx/bitmap.h>
        #include <wx/bitmap.h>
        #include <wx/colour.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxMask : public ::wxMask
{
public:
    sipwxMask();
    sipwxMask(const ::wxBitmap&, int);
    sipwxMask(const ::wxBitmap&);
    sipwxMask(const ::wxBitmap&, const ::wxColour&);
    sipwxMask(const ::wxMask&);
    ~sipwxMask();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxMask::sipwxMask(): ::wxMask(), sipPySelf(SIP_NULLPTR)
{
}

sipwxMask::sipwxMask(const ::wxBitmap& bitmap, int index): ::wxMask(bitmap, index), sipPySelf(SIP_NULLPTR)
{
}

sipwxMask::sipwxMask(const ::wxBitmap& bitmap): ::wxMask(bitmap), sipPySelf(SIP_NULLPTR)
{
}

sipwxMask::sipwxMask(const ::wxBitmap& bitmap, const ::wxColour& colour): ::wxMask(bitmap, colour), sipPySelf(SIP_NULLPTR)
{
}

sipwxMask::sipwxMask(const ::wxMask& a0): ::wxMask(a0), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxMask_GetBitmap, "GetBitmap() -> Bitmap\n"
"\n"
"Returns the mask as a monochrome bitmap.");

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

    {
        const ::wxMask *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxBitmap(sipCpp->GetBitmap());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Mask, sipName_GetBitmap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxMask)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxMask *>(sipCppV);
    else
        delete reinterpret_cast< ::wxMask *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void array_delete_wxMask(void *);}
static void array_delete_wxMask(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxMask *>(sipCpp);
}


extern "C" {static void assign_wxMask(void *, Py_ssize_t, void *);}
static void assign_wxMask(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxMask *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxMask *>(sipSrc);
}


extern "C" {static void *copy_wxMask(const void *, Py_ssize_t);}
static void *copy_wxMask(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::wxMask(reinterpret_cast<const ::wxMask *>(sipSrc)[sipSrcIdx]);
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMask();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxBitmap* bitmap;
        int index;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9i", sipType_wxBitmap, &bitmap, &index))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMask(*bitmap, index);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::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 sipwxMask(*bitmap);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxBitmap* bitmap;
        const ::wxColour* colour;
        int colourState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9J1", sipType_wxBitmap, &bitmap, sipType_wxColour, &colour, &colourState))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMask(*bitmap, *colour);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(colour), sipType_wxColour, colourState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxMask* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxMask[] = {
    {sipName_GetBitmap, meth_wxMask_GetBitmap, METH_VARARGS, doc_wxMask_GetBitmap}
};

sipVariableDef variables_wxMask[] = {
    {PropertyVariable, sipName_Bitmap, &methods_wxMask[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxMask, "Mask() -> None\n"
"Mask(bitmap, index) -> None\n"
"Mask(bitmap) -> None\n"
"Mask(bitmap, colour) -> None\n"
"\n"
"This class encapsulates a monochrome mask bitmap, where the masked\n"
"area is black and the unmasked area is white.");


sipClassTypeDef sipTypeDef__core_wxMask = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxMask,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_Mask,
        {0, 0, 1},
        1, methods_wxMask,
        0, SIP_NULLPTR,
        1, variables_wxMask,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxMask,
    -1,
    -1,
    supers_wxMask,
    SIP_NULLPTR,
    init_type_wxMask,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxMask,
    assign_wxMask,
    array_wxMask,
    copy_wxMask,
    release_wxMask,
    cast_wxMask,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxMask,
    sizeof (::wxMask),
};
