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

#include "sipAPI_core.h"

        #include <wx/dcgraph.h>

        #include <wx/dcclient.h>
        #include <wx/dcmemory.h>
        #include <wx/dcprint.h>
        #include <wx/graphics.h>
    #include <wx/setup.h>
    #include <wxPython/wxpy_api.h>
        #include <wx/gdicmn.h>
        #include <wx/bitmap.h>
        #include <wx/gdicmn.h>
        #include <wx/palette.h>
        #include <wx/colour.h>
        #include <wx/gdicmn.h>
        #include <wx/dc.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 sipwxGCDC : public  ::wxGCDC
{
public:
    sipwxGCDC(const  ::wxWindowDC&);
    sipwxGCDC(const  ::wxMemoryDC&);
    sipwxGCDC(const  ::wxPrinterDC&);
    sipwxGCDC( ::wxGraphicsContext*);
    sipwxGCDC();
    ~sipwxGCDC();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxGCDC::sipwxGCDC(const  ::wxWindowDC& windowDC):  ::wxGCDC(windowDC), sipPySelf(SIP_NULLPTR)
{
}

sipwxGCDC::sipwxGCDC(const  ::wxMemoryDC& memoryDC):  ::wxGCDC(memoryDC), sipPySelf(SIP_NULLPTR)
{
}

sipwxGCDC::sipwxGCDC(const  ::wxPrinterDC& printerDC):  ::wxGCDC(printerDC), sipPySelf(SIP_NULLPTR)
{
}

sipwxGCDC::sipwxGCDC( ::wxGraphicsContext*context):  ::wxGCDC(context), sipPySelf(SIP_NULLPTR)
{
}

sipwxGCDC::sipwxGCDC():  ::wxGCDC(), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxGCDC_GetGraphicsContext, "GetGraphicsContext() -> GraphicsContext\n"
"\n"
"Retrieves associated wxGraphicsContext.");

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

    {
        const  ::wxGCDC *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetGraphicsContext();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_GCDC, sipName_GetGraphicsContext, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGCDC_SetGraphicsContext, "SetGraphicsContext(ctx)\n"
"\n"
"Set the graphics context to be used for this wxGCDC.");

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

    {
         ::wxGraphicsContext* ctx;
         ::wxGCDC *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ:", &sipSelf, sipType_wxGCDC, &sipCpp, sipType_wxGraphicsContext, &ctx))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetGraphicsContext(ctx);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_GCDC, sipName_SetGraphicsContext, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxGCDC(void *, const sipTypeDef *);}
static void *cast_wxGCDC(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxGCDC *sipCpp = reinterpret_cast< ::wxGCDC *>(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_wxGCDC(void *, int);}
static void release_wxGCDC(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGCDC *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGCDC *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        const  ::wxWindowDC* windowDC;
        PyObject *windowDCKeep;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "@J9", &windowDCKeep, sipType_wxWindowDC, &windowDC))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGCDC(*windowDC);
            Py_END_ALLOW_THREADS

            sipKeepReference((PyObject *)sipSelf, -9, windowDCKeep);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxMemoryDC* memoryDC;
        PyObject *memoryDCKeep;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "@J9", &memoryDCKeep, sipType_wxMemoryDC, &memoryDC))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGCDC(*memoryDC);
            Py_END_ALLOW_THREADS

            sipKeepReference((PyObject *)sipSelf, -10, memoryDCKeep);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxPrinterDC* printerDC;
        PyObject *printerDCKeep;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "@J9", &printerDCKeep, sipType_wxPrinterDC, &printerDC))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGCDC(*printerDC);
            Py_END_ALLOW_THREADS

            sipKeepReference((PyObject *)sipSelf, -11, printerDCKeep);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
         ::wxGraphicsContext* context;
        PyObject *contextWrapper;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "@J8", &contextWrapper, sipType_wxGraphicsContext, &context))
        {

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGCDC(context);
            Py_END_ALLOW_THREADS

            sipTransferTo(contextWrapper, (PyObject *)sipSelf);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

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

        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGCDC();
            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_wxGCDC[] = {{93, 255, 1}};


static PyMethodDef methods_wxGCDC[] = {
    {SIP_MLNAME_CAST(sipName_GetGraphicsContext), meth_wxGCDC_GetGraphicsContext, METH_VARARGS, SIP_MLDOC_CAST(doc_wxGCDC_GetGraphicsContext)},
    {SIP_MLNAME_CAST(sipName_SetGraphicsContext), SIP_MLMETH_CAST(meth_wxGCDC_SetGraphicsContext), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGCDC_SetGraphicsContext)}
};

sipVariableDef variables_wxGCDC[] = {
    {PropertyVariable, sipName_GraphicsContext, &methods_wxGCDC[0], &methods_wxGCDC[1], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGCDC, "GCDC(windowDC)\n"
"GCDC(memoryDC)\n"
"GCDC(printerDC)\n"
"GCDC(context)\n"
"GCDC()\n"
"\n"
"wxGCDC is a device context that draws on a wxGraphicsContext.");


sipClassTypeDef sipTypeDef__core_wxGCDC = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxGCDC,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_GCDC,
        {0, 0, 1},
        2, methods_wxGCDC,
        0, SIP_NULLPTR,
        1, variables_wxGCDC,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGCDC,
    -1,
    -1,
    supers_wxGCDC,
    SIP_NULLPTR,
    init_type_wxGCDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxGCDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGCDC,
    cast_wxGCDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
