/*
 * 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/bitmap.h>
        #include <wx/gdicmn.h>
        #include <wx/gdicmn.h>
        #include <wx/gdicmn.h>
    int _wxNativePixelData___nonzero__(wxNativePixelData* self)
    {
        return (int)self->operator bool();
    }
    int _wxNativePixelData___bool__(wxNativePixelData* self)
    {
        return self->operator bool();
    }


class sipwxNativePixelData : public ::wxNativePixelData
{
public:
    sipwxNativePixelData(::wxBitmap&);
    sipwxNativePixelData(::wxBitmap&, const ::wxRect&);
    sipwxNativePixelData(::wxBitmap&, const ::wxPoint&, const ::wxSize&);
    sipwxNativePixelData(const ::wxNativePixelData&);
    ~sipwxNativePixelData();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxNativePixelData::sipwxNativePixelData(::wxBitmap& bmp): ::wxNativePixelData(bmp), sipPySelf(SIP_NULLPTR)
{
}

sipwxNativePixelData::sipwxNativePixelData(::wxBitmap& bmp, const ::wxRect& rect): ::wxNativePixelData(bmp, rect), sipPySelf(SIP_NULLPTR)
{
}

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

sipwxNativePixelData::sipwxNativePixelData(const ::wxNativePixelData& a0): ::wxNativePixelData(a0), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxNativePixelData_GetPixels, "GetPixels() -> NativePixelData_Accessor");

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

    {
        const ::wxNativePixelData *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_NativePixelData, sipName_GetPixels, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxNativePixelData___nonzero__, "__nonzero__() -> int");

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

    {
        ::wxNativePixelData *sipCpp;

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

            if (sipIsErr)
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_NativePixelData, sipName___nonzero__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static int slot_wxNativePixelData___bool__(PyObject *);}
static int slot_wxNativePixelData___bool__(PyObject *sipSelf)
{
    ::wxNativePixelData *sipCpp = reinterpret_cast<::wxNativePixelData *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxNativePixelData));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxNativePixelData___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_wxNativePixelData(void *, const sipTypeDef *);}
static void *cast_wxNativePixelData(void *sipCppV, const sipTypeDef *targetType)
{
    ::wxNativePixelData *sipCpp = reinterpret_cast<::wxNativePixelData *>(sipCppV);

    if (targetType == sipType_wxNativePixelData)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxNativePixelData *>(sipCppV);
    else
        delete reinterpret_cast<::wxNativePixelData *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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

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


extern "C" {static void *init_type_wxNativePixelData(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxNativePixelData(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipwxNativePixelData *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 sipwxNativePixelData(*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 sipwxNativePixelData(*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 sipwxNativePixelData(*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 ::wxNativePixelData* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


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


static PyMethodDef methods_wxNativePixelData[] = {
    {sipName_GetPixels, meth_wxNativePixelData_GetPixels, METH_VARARGS, doc_wxNativePixelData_GetPixels},
    {sipName___nonzero__, meth_wxNativePixelData___nonzero__, METH_VARARGS, doc_wxNativePixelData___nonzero__}
};

sipVariableDef variables_wxNativePixelData[] = {
    {PropertyVariable, sipName_Pixels, &methods_wxNativePixelData[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxNativePixelData, "NativePixelData(bmp)\n"
"NativePixelData(bmp, rect)\n"
"NativePixelData(bmp, pt, sz)\n"
"\n"
"A class providing direct access to a :class:`wx.Bitmap`'s\n"
"internal data without alpha channel (RGB).");


sipClassTypeDef sipTypeDef__core_wxNativePixelData = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxNativePixelData,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_NativePixelData,
        {0, 0, 1},
        2, methods_wxNativePixelData,
        0, SIP_NULLPTR,
        1, variables_wxNativePixelData,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxNativePixelData,
    -1,
    -1,
    supers_wxNativePixelData,
    slots_wxNativePixelData,
    init_type_wxNativePixelData,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxNativePixelData,
    assign_wxNativePixelData,
    SIP_NULLPTR,
    copy_wxNativePixelData,
    release_wxNativePixelData,
    cast_wxNativePixelData,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
