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

#include "sipAPI_adv.h"
        #include <wx/gifdecod.h>
        #include <wx/stream.h>
        #include <wx/colour.h>
        #include <wx/gdicmn.h>
        #include <wx/gdicmn.h>
        #include <wx/image.h>
        #include <wx/animdecod.h>


class sipwxGIFDecoder : public ::wxGIFDecoder
{
public:
    sipwxGIFDecoder();
    virtual ~sipwxGIFDecoder();

    /*
     * There is a public method for every protected method visible from
     * this class.
     */
    bool sipProtectVirt_DoCanRead(bool, ::wxInputStream&) const;

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool Load(::wxInputStream&) SIP_OVERRIDE;
    ::wxAnimationDecoder* Clone() const SIP_OVERRIDE;
    ::wxAnimationType GetType() const SIP_OVERRIDE;
    bool ConvertToImage(uint, ::wxImage*) const SIP_OVERRIDE;
    ::wxSize GetFrameSize(uint) const SIP_OVERRIDE;
    ::wxPoint GetFramePosition(uint) const SIP_OVERRIDE;
    ::wxAnimationDisposal GetDisposalMethod(uint) const SIP_OVERRIDE;
    long GetDelay(uint) const SIP_OVERRIDE;
    ::wxColour GetTransparentColour(uint) const SIP_OVERRIDE;
    bool DoCanRead(::wxInputStream&) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxGIFDecoder(const sipwxGIFDecoder &);
    sipwxGIFDecoder &operator = (const sipwxGIFDecoder &);

    char sipPyMethods[10];
};

sipwxGIFDecoder::sipwxGIFDecoder(): ::wxGIFDecoder(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

bool sipwxGIFDecoder::Load(::wxInputStream& stream)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_Load);

    if (!sipMeth)
        return ::wxGIFDecoder::Load(stream);

    extern bool sipVH__adv_38(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxInputStream&);

    return sipVH__adv_38(sipGILState, 0, sipPySelf, sipMeth, stream);
}

::wxAnimationDecoder* sipwxGIFDecoder::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[1]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_Clone);

    if (!sipMeth)
        return ::wxGIFDecoder::Clone();

    extern ::wxAnimationDecoder* sipVH__adv_39(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__adv_39(sipGILState, 0, sipPySelf, sipMeth);
}

::wxAnimationType sipwxGIFDecoder::GetType() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[2]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetType);

    if (!sipMeth)
        return ::wxGIFDecoder::GetType();

    extern ::wxAnimationType sipVH__adv_40(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__adv_40(sipGILState, 0, sipPySelf, sipMeth);
}

bool sipwxGIFDecoder::ConvertToImage(uint frame, ::wxImage*image) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[3]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_ConvertToImage);

    if (!sipMeth)
        return ::wxGIFDecoder::ConvertToImage(frame, image);

    extern bool sipVH__adv_41(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, uint, ::wxImage*);

    return sipVH__adv_41(sipGILState, 0, sipPySelf, sipMeth, frame, image);
}

::wxSize sipwxGIFDecoder::GetFrameSize(uint frame) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[4]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetFrameSize);

    if (!sipMeth)
        return ::wxGIFDecoder::GetFrameSize(frame);

    extern ::wxSize sipVH__adv_42(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, uint);

    return sipVH__adv_42(sipGILState, 0, sipPySelf, sipMeth, frame);
}

::wxPoint sipwxGIFDecoder::GetFramePosition(uint frame) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[5]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetFramePosition);

    if (!sipMeth)
        return ::wxGIFDecoder::GetFramePosition(frame);

    extern ::wxPoint sipVH__adv_43(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, uint);

    return sipVH__adv_43(sipGILState, 0, sipPySelf, sipMeth, frame);
}

::wxAnimationDisposal sipwxGIFDecoder::GetDisposalMethod(uint frame) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[6]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetDisposalMethod);

    if (!sipMeth)
        return ::wxGIFDecoder::GetDisposalMethod(frame);

    extern ::wxAnimationDisposal sipVH__adv_44(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, uint);

    return sipVH__adv_44(sipGILState, 0, sipPySelf, sipMeth, frame);
}

long sipwxGIFDecoder::GetDelay(uint frame) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[7]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetDelay);

    if (!sipMeth)
        return ::wxGIFDecoder::GetDelay(frame);

    extern long sipVH__adv_45(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, uint);

    return sipVH__adv_45(sipGILState, 0, sipPySelf, sipMeth, frame);
}

::wxColour sipwxGIFDecoder::GetTransparentColour(uint frame) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[8]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetTransparentColour);

    if (!sipMeth)
        return ::wxGIFDecoder::GetTransparentColour(frame);

    extern ::wxColour sipVH__adv_46(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, uint);

    return sipVH__adv_46(sipGILState, 0, sipPySelf, sipMeth, frame);
}

bool sipwxGIFDecoder::DoCanRead(::wxInputStream& stream) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[9]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_DoCanRead);

    if (!sipMeth)
        return ::wxGIFDecoder::DoCanRead(stream);

    extern bool sipVH__adv_38(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxInputStream&);

    return sipVH__adv_38(sipGILState, 0, sipPySelf, sipMeth, stream);
}

bool sipwxGIFDecoder::sipProtectVirt_DoCanRead(bool sipSelfWasArg, ::wxInputStream& stream) const
{
    return (sipSelfWasArg ? ::wxGIFDecoder::DoCanRead(stream) : DoCanRead(stream));
}


PyDoc_STRVAR(doc_wxGIFDecoder_Load, "Load(stream) -> bool\n"
"\n"
"Load the animation image frames from the given stream.");

extern "C" {static PyObject *meth_wxGIFDecoder_Load(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_Load(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        ::wxInputStream* stream;
        int streamState = 0;
        ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGIFDecoder, &sipCpp, sipType_wxInputStream, &stream, &streamState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGIFDecoder::Load(*stream) : sipCpp->Load(*stream));
            Py_END_ALLOW_THREADS
            sipReleaseType(stream, sipType_wxInputStream, streamState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_Load, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_Clone, "Clone() -> AnimationDecoder\n"
"\n"
"Create a copy of this decoder.");

extern "C" {static PyObject *meth_wxGIFDecoder_Clone(PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_Clone(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxGIFDecoder *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGIFDecoder::Clone() : sipCpp->Clone());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_Clone, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_GetType, "GetType() -> AnimationType\n"
"\n"
"Return the animation type this decoder implements.");

extern "C" {static PyObject *meth_wxGIFDecoder_GetType(PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_GetType(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxGIFDecoder *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGIFDecoder, &sipCpp))
        {
            ::wxAnimationType sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGIFDecoder::GetType() : sipCpp->GetType());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxAnimationType);
        }
    }

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_GetType, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_ConvertToImage, "ConvertToImage(frame, image) -> bool\n"
"\n"
"Convert given frame to wxImage.");

extern "C" {static PyObject *meth_wxGIFDecoder_ConvertToImage(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_ConvertToImage(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        uint frame;
        ::wxImage* image;
        const ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BuJ8", &sipSelf, sipType_wxGIFDecoder, &sipCpp, &frame, sipType_wxImage, &image))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGIFDecoder::ConvertToImage(frame, image) : sipCpp->ConvertToImage(frame, image));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_ConvertToImage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_GetFrameSize, "GetFrameSize(frame) -> wx.Size");

extern "C" {static PyObject *meth_wxGIFDecoder_GetFrameSize(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_GetFrameSize(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        uint frame;
        const ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bu", &sipSelf, sipType_wxGIFDecoder, &sipCpp, &frame))
        {
            ::wxSize*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxSize((sipSelfWasArg ? sipCpp->::wxGIFDecoder::GetFrameSize(frame) : sipCpp->GetFrameSize(frame)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_GetFrameSize, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_GetFramePosition, "GetFramePosition(frame) -> wx.Point");

extern "C" {static PyObject *meth_wxGIFDecoder_GetFramePosition(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_GetFramePosition(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        uint frame;
        const ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bu", &sipSelf, sipType_wxGIFDecoder, &sipCpp, &frame))
        {
            ::wxPoint*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxPoint((sipSelfWasArg ? sipCpp->::wxGIFDecoder::GetFramePosition(frame) : sipCpp->GetFramePosition(frame)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_GetFramePosition, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_GetDisposalMethod, "GetDisposalMethod(frame) -> AnimationDisposal\n"
"\n"
"What should be done after displaying this frame.");

extern "C" {static PyObject *meth_wxGIFDecoder_GetDisposalMethod(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_GetDisposalMethod(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        uint frame;
        const ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bu", &sipSelf, sipType_wxGIFDecoder, &sipCpp, &frame))
        {
            ::wxAnimationDisposal sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGIFDecoder::GetDisposalMethod(frame) : sipCpp->GetDisposalMethod(frame));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxAnimationDisposal);
        }
    }

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_GetDisposalMethod, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_GetDelay, "GetDelay(frame) -> int\n"
"\n"
"Return the number of milliseconds this frame should be displayed.");

extern "C" {static PyObject *meth_wxGIFDecoder_GetDelay(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_GetDelay(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        uint frame;
        const ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bu", &sipSelf, sipType_wxGIFDecoder, &sipCpp, &frame))
        {
            long sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGIFDecoder::GetDelay(frame) : sipCpp->GetDelay(frame));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_GetDelay, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_GetTransparentColour, "GetTransparentColour(frame) -> wx.Colour\n"
"\n"
"The transparent colour for this frame, if any, or wxNullColour.");

extern "C" {static PyObject *meth_wxGIFDecoder_GetTransparentColour(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_GetTransparentColour(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        uint frame;
        const ::wxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bu", &sipSelf, sipType_wxGIFDecoder, &sipCpp, &frame))
        {
            ::wxColour*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxColour((sipSelfWasArg ? sipCpp->::wxGIFDecoder::GetTransparentColour(frame) : sipCpp->GetTransparentColour(frame)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_GetTransparentColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGIFDecoder_DoCanRead, "DoCanRead(stream) -> bool\n"
"\n"
"Checks the signature of the data in the given stream and returns true\n"
"if it appears to be a valid animation format recognized by the\n"
"animation decoder; this function should modify the stream current\n"
"position without taking care of restoring it since CanRead() will do\n"
"it.");

extern "C" {static PyObject *meth_wxGIFDecoder_DoCanRead(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGIFDecoder_DoCanRead(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        ::wxInputStream* stream;
        int streamState = 0;
        const sipwxGIFDecoder *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGIFDecoder, &sipCpp, sipType_wxInputStream, &stream, &streamState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->sipProtectVirt_DoCanRead(sipSelfWasArg, *stream);
            Py_END_ALLOW_THREADS
            sipReleaseType(stream, sipType_wxInputStream, streamState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GIFDecoder, sipName_DoCanRead, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGIFDecoder)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGIFDecoder *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGIFDecoder *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGIFDecoder();
            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_wxGIFDecoder[] = {{4, 255, 1}};


static PyMethodDef methods_wxGIFDecoder[] = {
    {sipName_Clone, meth_wxGIFDecoder_Clone, METH_VARARGS, doc_wxGIFDecoder_Clone},
    {sipName_ConvertToImage, SIP_MLMETH_CAST(meth_wxGIFDecoder_ConvertToImage), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_ConvertToImage},
    {sipName_DoCanRead, SIP_MLMETH_CAST(meth_wxGIFDecoder_DoCanRead), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_DoCanRead},
    {sipName_GetDelay, SIP_MLMETH_CAST(meth_wxGIFDecoder_GetDelay), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_GetDelay},
    {sipName_GetDisposalMethod, SIP_MLMETH_CAST(meth_wxGIFDecoder_GetDisposalMethod), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_GetDisposalMethod},
    {sipName_GetFramePosition, SIP_MLMETH_CAST(meth_wxGIFDecoder_GetFramePosition), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_GetFramePosition},
    {sipName_GetFrameSize, SIP_MLMETH_CAST(meth_wxGIFDecoder_GetFrameSize), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_GetFrameSize},
    {sipName_GetTransparentColour, SIP_MLMETH_CAST(meth_wxGIFDecoder_GetTransparentColour), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_GetTransparentColour},
    {sipName_GetType, meth_wxGIFDecoder_GetType, METH_VARARGS, doc_wxGIFDecoder_GetType},
    {sipName_Load, SIP_MLMETH_CAST(meth_wxGIFDecoder_Load), METH_VARARGS|METH_KEYWORDS, doc_wxGIFDecoder_Load}
};

sipVariableDef variables_wxGIFDecoder[] = {
    {PropertyVariable, sipName_Type, &methods_wxGIFDecoder[8], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGIFDecoder, "GIFDecoder() -> None\n"
"\n"
"An animation decoder supporting animated GIF files.");


sipClassTypeDef sipTypeDef__adv_wxGIFDecoder = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxGIFDecoder,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GIFDecoder,
        {0, 0, 1},
        10, methods_wxGIFDecoder,
        0, SIP_NULLPTR,
        1, variables_wxGIFDecoder,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGIFDecoder,
    -1,
    -1,
    supers_wxGIFDecoder,
    SIP_NULLPTR,
    init_type_wxGIFDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGIFDecoder,
    SIP_NULLPTR,
    array_wxGIFDecoder,
    SIP_NULLPTR,
    release_wxGIFDecoder,
    cast_wxGIFDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxGIFDecoder,
    sizeof (::wxGIFDecoder),
};
