/*
 * 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/gdicmn.h>
        #include <wx/gdicmn.h>
        #include <wx/gdicmn.h>
    int _wxAlphaPixelData___nonzero__(wxAlphaPixelData* self)
    {
        return (int)self->operator bool();
    }
    int _wxAlphaPixelData___bool__(wxAlphaPixelData* self)
    {
        return self->operator bool();
    }


class sipwxAlphaPixelData : public ::wxAlphaPixelData
{
public:
    sipwxAlphaPixelData(::wxBitmap&);
    sipwxAlphaPixelData(::wxBitmap&, const ::wxRect&);
    sipwxAlphaPixelData(::wxBitmap&, const ::wxPoint&, const ::wxSize&);
    sipwxAlphaPixelData(const ::wxAlphaPixelData&);
    ~sipwxAlphaPixelData();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxAlphaPixelData::sipwxAlphaPixelData(::wxBitmap& bmp): ::wxAlphaPixelData(bmp), sipPySelf(SIP_NULLPTR)
{
}

sipwxAlphaPixelData::sipwxAlphaPixelData(::wxBitmap& bmp, const ::wxRect& rect): ::wxAlphaPixelData(bmp, rect), sipPySelf(SIP_NULLPTR)
{
}

sipwxAlphaPixelData::sipwxAlphaPixelData(::wxBitmap& bmp, const ::wxPoint& pt, const ::wxSize& sz): ::wxAlphaPixelData(bmp, pt, sz), sipPySelf(SIP_NULLPTR)
{
}

sipwxAlphaPixelData::sipwxAlphaPixelData(const ::wxAlphaPixelData& a0): ::wxAlphaPixelData(a0), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxAlphaPixelData_GetPixels, "GetPixels() -> AlphaPixelData_Accessor");

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

    {
        const ::wxAlphaPixelData *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxAlphaPixelData_Accessor(sipCpp->GetPixels());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_AlphaPixelData, sipName_GetPixels, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxAlphaPixelData___nonzero__, "__nonzero__() -> bool");

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

    {
        ::wxAlphaPixelData *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxAlphaPixelData, &sipCpp))
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxAlphaPixelData___nonzero__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_AlphaPixelData, sipName___nonzero__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static int slot_wxAlphaPixelData___bool__(PyObject *);}
static int slot_wxAlphaPixelData___bool__(PyObject *sipSelf)
{
    ::wxAlphaPixelData *sipCpp = reinterpret_cast< ::wxAlphaPixelData *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxAlphaPixelData));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxAlphaPixelData___bool__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


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

    if (targetType == sipType_wxAlphaPixelData)
        return sipCppV;

    if (targetType == sipType_wxPixelDataBase)
        return static_cast< ::wxPixelDataBase *>(sipCpp);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxAlphaPixelData *>(sipCppV);
    else
        delete reinterpret_cast< ::wxAlphaPixelData *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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

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


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

    {
        ::wxBitmap* bmp;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxBitmap, &bmp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxAlphaPixelData(*bmp);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        ::wxBitmap* bmp;
        const ::wxRect* rect;
        int rectState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9J1", sipType_wxBitmap, &bmp, sipType_wxRect, &rect, &rectState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxAlphaPixelData(*bmp, *rect);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxRect *>(rect), sipType_wxRect, rectState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        ::wxBitmap* bmp;
        const ::wxPoint* pt;
        int ptState = 0;
        const ::wxSize* sz;
        int szState = 0;

        static const char *sipKwdList[] = {
            sipName_bmp,
            sipName_pt,
            sipName_sz,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9J1J1", sipType_wxBitmap, &bmp, sipType_wxPoint, &pt, &ptState, sipType_wxSize, &sz, &szState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxAlphaPixelData(*bmp, *pt, *sz);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxPoint *>(pt), sipType_wxPoint, ptState);
            sipReleaseType(const_cast< ::wxSize *>(sz), sipType_wxSize, szState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxAlphaPixelData* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


/* Define this type's Python slots. */
static sipPySlotDef slots_wxAlphaPixelData[] = {
    {(void *)slot_wxAlphaPixelData___bool__, bool_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_wxAlphaPixelData[] = {
    {sipName_GetPixels, meth_wxAlphaPixelData_GetPixels, METH_VARARGS, doc_wxAlphaPixelData_GetPixels},
    {sipName___nonzero__, meth_wxAlphaPixelData___nonzero__, METH_VARARGS, doc_wxAlphaPixelData___nonzero__}
};

sipVariableDef variables_wxAlphaPixelData[] = {
    {PropertyVariable, sipName_Pixels, &methods_wxAlphaPixelData[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxAlphaPixelData, "AlphaPixelData(bmp) -> None\n"
"AlphaPixelData(bmp, rect) -> None\n"
"AlphaPixelData(bmp, pt, sz) -> None\n"
"\n"
"A class providing direct access to a :class:`wx.Bitmap`'s\n"
"internal data including the alpha channel (RGBA).");


sipClassTypeDef sipTypeDef__core_wxAlphaPixelData = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxAlphaPixelData,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_AlphaPixelData,
        {0, 0, 1},
        2, methods_wxAlphaPixelData,
        0, SIP_NULLPTR,
        1, variables_wxAlphaPixelData,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxAlphaPixelData,
    -1,
    -1,
    supers_wxAlphaPixelData,
    slots_wxAlphaPixelData,
    init_type_wxAlphaPixelData,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxAlphaPixelData,
    assign_wxAlphaPixelData,
    SIP_NULLPTR,
    copy_wxAlphaPixelData,
    release_wxAlphaPixelData,
    cast_wxAlphaPixelData,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxAlphaPixelData),
};
