/*
 * 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/graphics.h>
        #include <wx/gdicmn.h>
        #include <wx/gdicmn.h>
        #include <wx/window.h>
        #include <wx/graphics.h>
        #include <wx/image.h>
        #include <wx/bitmap.h>
        #include <wx/font.h>
        #include <wx/colour.h>
        #include <wx/graphics.h>
        #include <wx/graphics.h>
        #include <wx/graphics.h>
        #include <wx/icon.h>
        #include <wx/pen.h>
        #include "arrayholder.h"
        #include <wx/graphics.h>
        #include <wx/graphics.h>
        #include <wx/brush.h>
        #include <wx/graphics.h>
        #include <wx/graphics.h>
        #include <wx/affinematrix2dbase.h>
        #include <wx/region.h>
        #include <wx/dc.h>
        #include <wx/dcclient.h>
        #include <wx/dcmemory.h>
        #include <wx/dcprint.h>
        #include <wx/metafile.h>
        #include <wx/dcbuffer.h>
        #include <wx/graphics.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>
        // Convert a Python sequence of wxPoint2D objects, or items that can be converted
        // to wxPoint2D into a C array of wxPoint2D instances.
        static
        wxPoint2D* wxPoint2D_array_helper(PyObject* source, size_t *count)
        {
            wxPoint2D* array;
            Py_ssize_t idx, len;
            wxPyThreadBlocker blocker;
        
            // ensure that it is a sequence
            if (! PySequence_Check(source))
                goto error0;
            // ensure it is not a string or unicode object (they are sequences too)
            else if (PyBytes_Check(source) || PyUnicode_Check(source))
                goto error0;
            // ensure each item can be converted to wxPoint2D
            else {
                len = PySequence_Length(source);
                for (idx=0; idx<len; idx++) {
                    PyObject* item = PySequence_ITEM(source, idx);
                    if (!sipCanConvertToType(item, sipType_wxPoint2DDouble, SIP_NOT_NONE)) {
                        Py_DECREF(item);
                        goto error0;
                    }
                    Py_DECREF(item);
                }
            }
        
            // The length of the sequence is returned in count.
            *count = len;
            array = new wxPoint2D[*count];
            if (!array) {
                PyErr_SetString(PyExc_MemoryError, "Unable to allocate temporary array");
                return NULL;
            }
            for (idx=0; idx<len; idx++) {
                PyObject* obj = PySequence_ITEM(source, idx);
                int state = 0;
                int err = 0;
                wxPoint2D* item = reinterpret_cast<wxPoint2D*>(
                                sipConvertToType(obj, sipType_wxPoint2DDouble, NULL, 0, &state, &err));
                array[idx] = *item;
                sipReleaseType((void*)item, sipType_wxPoint2DDouble, state); // delete temporary instances
                Py_DECREF(obj);
            }
            return array;
        
        error0:
            PyErr_SetString(PyExc_TypeError, "Expected a sequence of length-2 sequences or wx.Point2D objects.");
            return NULL;
        }
    wxGraphicsContext * _wxGraphicsContext_Create(const wxMetafileDC* metaFileDC)
    {
        #ifdef __WXMSW__
        #if wxUSE_ENH_METAFILE
            return wxGraphicsContext::Create(*metaFileDC);
        #endif
        #endif
            wxPyRaiseNotImplemented();
            return NULL;
    }
    wxGraphicsContext* _wxGraphicsContext_Create(wxAutoBufferedPaintDC* autoPaintDC )
    {
        return wxGraphicsContext::Create(*autoPaintDC);
    }
    void _wxGraphicsContext_DrawLines(wxGraphicsContext* self, PyObject* points, wxPolygonFillMode fillStyle)
    {
        size_t count;
        wxPoint2D* ptsArray = wxPoint2D_array_helper(points, &count);
        
        if ( ptsArray != NULL ) {
            self->DrawLines(count, ptsArray, fillStyle);
            delete [] ptsArray;
        }
    }
    void _wxGraphicsContext_StrokeLines(wxGraphicsContext* self, PyObject* points)
    {
        size_t count;
        wxPoint2D* ptsArray = wxPoint2D_array_helper(points, &count);
        
        if ( ptsArray != NULL ) {
            self->StrokeLines(count, ptsArray);
            delete [] ptsArray;
        }
    }
    wxArrayDouble* _wxGraphicsContext_GetPartialTextExtents(const wxGraphicsContext* self, const wxString *text)
    {
        wxArrayDouble rval;
        self->GetPartialTextExtents(*text, rval);
        return new wxArrayDouble(rval);
    }
    PyObject* _wxGraphicsContext_GetTextExtent(wxGraphicsContext* self, const wxString* text)
    {
        wxDouble width = 0.0, height = 0.0;
        self->GetTextExtent(*text, &width, &height, NULL, NULL);
        wxPyThreadBlocker blocker;
        return sipBuildResult(0, "(dd)", width, height);
    }
    void _wxGraphicsContext_StrokeLineSegments(wxGraphicsContext* self, PyObject* beginPoints, PyObject* endPoints)
    {
        size_t c1, c2, count;
        wxPoint2D* beginP = wxPoint2D_array_helper(beginPoints, &c1);
        wxPoint2D* endP =   wxPoint2D_array_helper(endPoints, &c2);
        
        if ( beginP != NULL && endP != NULL ) {
            count = wxMin(c1, c2);
            self->StrokeLines(count, beginP, endP);
        }
        delete [] beginP;
        delete [] endP;
    }


PyDoc_STRVAR(doc_wxGraphicsContext_Create, "Create(window) -> GraphicsContext\n"
"Create(windowDC) -> GraphicsContext\n"
"Create(memoryDC) -> GraphicsContext\n"
"Create(printerDC) -> GraphicsContext\n"
"Create(metaFileDC) -> GraphicsContext\n"
"Create(image) -> GraphicsContext\n"
"Create() -> GraphicsContext\n"
"Create(autoPaintDC) -> GraphicsContext\n"
"\n"
"Creates a wxGraphicsContext from a wxWindow.\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"");

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

    {
        ::wxWindow* window;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J8", sipType_wxWindow, &window))
        {
            ::wxGraphicsContext*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::Create(window);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "@J9", &windowDCKeep, sipType_wxWindowDC, &windowDC))
        {
            ::wxGraphicsContext*sipRes;
            PyObject *sipResObj;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::Create(*windowDC);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            sipResObj = sipConvertFromNewType(sipRes, sipType_wxGraphicsContext, SIP_NULLPTR);

            sipKeepReference(sipResObj, -12, windowDCKeep);

            return sipResObj;
        }
    }

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

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "@J9", &memoryDCKeep, sipType_wxMemoryDC, &memoryDC))
        {
            ::wxGraphicsContext*sipRes;
            PyObject *sipResObj;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::Create(*memoryDC);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            sipResObj = sipConvertFromNewType(sipRes, sipType_wxGraphicsContext, SIP_NULLPTR);

            sipKeepReference(sipResObj, -13, memoryDCKeep);

            return sipResObj;
        }
    }

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

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "@J9", &printerDCKeep, sipType_wxPrinterDC, &printerDC))
        {
            ::wxGraphicsContext*sipRes;
            PyObject *sipResObj;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::Create(*printerDC);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            sipResObj = sipConvertFromNewType(sipRes, sipType_wxGraphicsContext, SIP_NULLPTR);

            sipKeepReference(sipResObj, -14, printerDCKeep);

            return sipResObj;
        }
    }

    {
        const ::wxMetafileDC* metaFileDC;
        PyObject *metaFileDCKeep;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "@J9", &metaFileDCKeep, sipType_wxMetafileDC, &metaFileDC))
        {
            ::wxGraphicsContext*sipRes = 0;
            PyObject *sipResObj;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGraphicsContext_Create(metaFileDC);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            sipResObj = sipConvertFromNewType(sipRes, sipType_wxGraphicsContext, SIP_NULLPTR);

            sipKeepReference(sipResObj, -15, metaFileDCKeep);

            return sipResObj;
        }
    }

    {
        ::wxImage* image;
        PyObject *imageKeep;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "@J9", &imageKeep, sipType_wxImage, &image))
        {
            ::wxGraphicsContext*sipRes;
            PyObject *sipResObj;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::Create(*image);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            sipResObj = sipConvertFromNewType(sipRes, sipType_wxGraphicsContext, SIP_NULLPTR);

            sipKeepReference(sipResObj, -16, imageKeep);

            return sipResObj;
        }
    }

    {
        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, ""))
        {
            ::wxGraphicsContext*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::Create();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    {
        ::wxAutoBufferedPaintDC* autoPaintDC;
        PyObject *autoPaintDCKeep;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "@J8", &autoPaintDCKeep, sipType_wxAutoBufferedPaintDC, &autoPaintDC))
        {
            ::wxGraphicsContext*sipRes = 0;
            PyObject *sipResObj;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGraphicsContext_Create(autoPaintDC);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            sipResObj = sipConvertFromNewType(sipRes, sipType_wxGraphicsContext, SIP_NULLPTR);

            sipKeepReference(sipResObj, -17, autoPaintDCKeep);

            return sipResObj;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_Create, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateFromUnknownDC, "CreateFromUnknownDC(dc) -> GraphicsContext\n"
"\n"
"Creates a wxGraphicsContext from a DC of unknown specific type.");

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

    {
        ::wxDC* dc;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J9", sipType_wxDC, &dc))
        {
            ::wxGraphicsContext*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::CreateFromUnknownDC(*dc);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateFromUnknownDC, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateFromNative, "CreateFromNative(context) -> GraphicsContext\n"
"\n"
"Creates a wxGraphicsContext from a native context.");

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

    {
        void* context;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "v", &context))
        {
            ::wxGraphicsContext*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::CreateFromNative(context);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateFromNative, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateFromNativeWindow, "CreateFromNativeWindow(window) -> GraphicsContext\n"
"\n"
"Creates a wxGraphicsContext from a native window.");

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

    {
        void* window;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "v", &window))
        {
            ::wxGraphicsContext*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxGraphicsContext::CreateFromNativeWindow(window);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateFromNativeWindow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_ResetClip, "ResetClip() -> None\n"
"\n"
"Resets the clipping to original shape.");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->ResetClip();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_ResetClip, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_Clip, "Clip(region) -> None\n"
"Clip(x, y, w, h) -> None\n"
"\n"
"Sets the clipping region to the intersection of the given region and\n"
"the previously set clipping region.\n"
"");

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

    {
        const ::wxRegion* region;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxRegion, &region))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Clip(*region);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bdddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x, &y, &w, &h))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Clip(x, y, w, h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_Clip, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetClipBox, "GetClipBox(x, y, w, h) -> None\n"
"\n"
"Returns bounding box of the current clipping region.");

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

    {
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->GetClipBox(&x, &y, &w, &h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipBuildResult(0, "(dddd)", x, y, w, h);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetClipBox, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateMatrix, "CreateMatrix(a=1.0, b=0.0, c=0.0, d=1.0, tx=0.0, ty=0.0) -> GraphicsMatrix\n"
"CreateMatrix(mat) -> GraphicsMatrix\n"
"\n"
"Creates a native affine transformation matrix from the passed in\n"
"values.\n"
"");

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

    {
        ::wxDouble a = 1;
        ::wxDouble b = 0;
        ::wxDouble c = 0;
        ::wxDouble d = 1;
        ::wxDouble tx = 0;
        ::wxDouble ty = 0;
        const ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_a,
            sipName_b,
            sipName_c,
            sipName_d,
            sipName_tx,
            sipName_ty,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|dddddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &a, &b, &c, &d, &tx, &ty))
        {
            ::wxGraphicsMatrix*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsMatrix(sipCpp->CreateMatrix(a, b, c, d, tx, ty));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    {
        const ::wxAffineMatrix2DBase* mat;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxAffineMatrix2DBase, &mat))
        {
            ::wxGraphicsMatrix*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsMatrix(sipCpp->CreateMatrix(*mat));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateMatrix, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_ConcatTransform, "ConcatTransform(matrix) -> None\n"
"\n"
"Concatenates the passed in transform with the current transform of\n"
"this context.");

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

    {
        const ::wxGraphicsMatrix* matrix;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsMatrix, &matrix))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->ConcatTransform(*matrix);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_ConcatTransform, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetTransform, "GetTransform() -> GraphicsMatrix\n"
"\n"
"Gets the current transformation matrix of this context.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            ::wxGraphicsMatrix*sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsMatrix(sipCpp->GetTransform());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetTransform, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_Rotate, "Rotate(angle) -> None\n"
"\n"
"Rotates the current transformation matrix (in radians).");

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

    {
        ::wxDouble angle;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &angle))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Rotate(angle);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_Rotate, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_Scale, "Scale(xScale, yScale) -> None\n"
"\n"
"Scales the current transformation matrix.");

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

    {
        ::wxDouble xScale;
        ::wxDouble yScale;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bdd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &xScale, &yScale))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Scale(xScale, yScale);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_Scale, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetTransform, "SetTransform(matrix) -> None\n"
"\n"
"Sets the current transformation matrix of this context.");

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

    {
        const ::wxGraphicsMatrix* matrix;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsMatrix, &matrix))
        {
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetTransform(*matrix);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetTransform, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_Translate, "Translate(dx, dy) -> None\n"
"\n"
"Translates the current transformation matrix.");

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

    {
        ::wxDouble dx;
        ::wxDouble dy;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bdd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &dx, &dy))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Translate(dx, dy);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_Translate, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateBrush, "CreateBrush(brush) -> GraphicsBrush\n"
"\n"
"Creates a native brush from a wxBrush.");

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

    {
        const ::wxBrush* brush;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxBrush, &brush))
        {
            ::wxGraphicsBrush*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBrush(sipCpp->CreateBrush(*brush));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateBrush, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateLinearGradientBrush, "CreateLinearGradientBrush(x1, y1, x2, y2, c1, c2, matrix=NullGraphicsMatrix) -> GraphicsBrush\n"
"CreateLinearGradientBrush(x1, y1, x2, y2, stops, matrix=NullGraphicsMatrix) -> GraphicsBrush\n"
"\n"
"Creates a native brush with a linear gradient.\n"
"");

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

    {
        ::wxDouble x1;
        ::wxDouble y1;
        ::wxDouble x2;
        ::wxDouble y2;
        const ::wxColour* c1;
        int c1State = 0;
        const ::wxColour* c2;
        int c2State = 0;
        const ::wxGraphicsMatrix& matrixdef = wxNullGraphicsMatrix;
        const ::wxGraphicsMatrix* matrix = &matrixdef;
        const ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x1,
            sipName_y1,
            sipName_x2,
            sipName_y2,
            sipName_c1,
            sipName_c2,
            sipName_matrix,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BddddJ1J1|J9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x1, &y1, &x2, &y2, sipType_wxColour, &c1, &c1State, sipType_wxColour, &c2, &c2State, sipType_wxGraphicsMatrix, &matrix))
        {
            ::wxGraphicsBrush*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBrush(sipCpp->CreateLinearGradientBrush(x1, y1, x2, y2, *c1, *c2, *matrix));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(c1), sipType_wxColour, c1State);
            sipReleaseType(const_cast< ::wxColour *>(c2), sipType_wxColour, c2State);

            if (PyErr_Occurred())
                return 0;

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

    {
        ::wxDouble x1;
        ::wxDouble y1;
        ::wxDouble x2;
        ::wxDouble y2;
        const ::wxGraphicsGradientStops* stops;
        const ::wxGraphicsMatrix& matrixdef = wxNullGraphicsMatrix;
        const ::wxGraphicsMatrix* matrix = &matrixdef;
        const ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x1,
            sipName_y1,
            sipName_x2,
            sipName_y2,
            sipName_stops,
            sipName_matrix,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BddddJ9|J9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x1, &y1, &x2, &y2, sipType_wxGraphicsGradientStops, &stops, sipType_wxGraphicsMatrix, &matrix))
        {
            ::wxGraphicsBrush*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBrush(sipCpp->CreateLinearGradientBrush(x1, y1, x2, y2, *stops, *matrix));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateLinearGradientBrush, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateRadialGradientBrush, "CreateRadialGradientBrush(startX, startY, endX, endY, radius, oColor, cColor, matrix=NullGraphicsMatrix) -> GraphicsBrush\n"
"CreateRadialGradientBrush(startX, startY, endX, endY, radius, stops, matrix=NullGraphicsMatrix) -> GraphicsBrush\n"
"\n"
"Creates a native brush with a radial gradient.\n"
"");

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

    {
        ::wxDouble startX;
        ::wxDouble startY;
        ::wxDouble endX;
        ::wxDouble endY;
        ::wxDouble radius;
        const ::wxColour* oColor;
        int oColorState = 0;
        const ::wxColour* cColor;
        int cColorState = 0;
        const ::wxGraphicsMatrix& matrixdef = wxNullGraphicsMatrix;
        const ::wxGraphicsMatrix* matrix = &matrixdef;
        const ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_startX,
            sipName_startY,
            sipName_endX,
            sipName_endY,
            sipName_radius,
            sipName_oColor,
            sipName_cColor,
            sipName_matrix,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BdddddJ1J1|J9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &startX, &startY, &endX, &endY, &radius, sipType_wxColour, &oColor, &oColorState, sipType_wxColour, &cColor, &cColorState, sipType_wxGraphicsMatrix, &matrix))
        {
            ::wxGraphicsBrush*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBrush(sipCpp->CreateRadialGradientBrush(startX, startY, endX, endY, radius, *oColor, *cColor, *matrix));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(oColor), sipType_wxColour, oColorState);
            sipReleaseType(const_cast< ::wxColour *>(cColor), sipType_wxColour, cColorState);

            if (PyErr_Occurred())
                return 0;

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

    {
        ::wxDouble startX;
        ::wxDouble startY;
        ::wxDouble endX;
        ::wxDouble endY;
        ::wxDouble radius;
        const ::wxGraphicsGradientStops* stops;
        const ::wxGraphicsMatrix& matrixdef = wxNullGraphicsMatrix;
        const ::wxGraphicsMatrix* matrix = &matrixdef;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_startX,
            sipName_startY,
            sipName_endX,
            sipName_endY,
            sipName_radius,
            sipName_stops,
            sipName_matrix,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BdddddJ9|J9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &startX, &startY, &endX, &endY, &radius, sipType_wxGraphicsGradientStops, &stops, sipType_wxGraphicsMatrix, &matrix))
        {
            ::wxGraphicsBrush*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBrush(sipCpp->CreateRadialGradientBrush(startX, startY, endX, endY, radius, *stops, *matrix));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateRadialGradientBrush, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetBrush, "SetBrush(brush) -> None\n"
"SetBrush(brush) -> None\n"
"\n"
"Sets the brush for filling paths.\n"
"");

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

    {
        const ::wxBrush* brush;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxBrush, &brush))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetBrush(*brush);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxGraphicsBrush* brush;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsBrush, &brush))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetBrush(*brush);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetBrush, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreatePen, "CreatePen(pen) -> GraphicsPen\n"
"CreatePen(info) -> GraphicsPen\n"
"\n"
"Creates a native pen from a wxPen.\n"
"");

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

    {
        const ::wxPen* pen;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxPen, &pen))
        {
            ::wxGraphicsPen*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsPen(sipCpp->CreatePen(*pen));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    {
        const ::wxGraphicsPenInfo* info;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsPenInfo, &info))
        {
            ::wxGraphicsPen*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsPen(sipCpp->CreatePen(*info));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreatePen, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetPen, "SetPen(pen) -> None\n"
"SetPen(pen) -> None\n"
"\n"
"Sets the pen used for stroking.\n"
"");

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

    {
        const ::wxPen* pen;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxPen, &pen))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPen(*pen);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxGraphicsPen* pen;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsPen, &pen))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPen(*pen);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetPen, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawBitmap, "DrawBitmap(bmp, x, y, w, h) -> None\n"
"DrawBitmap(bmp, x, y, w, h) -> None\n"
"\n"
"Draws the bitmap.\n"
"");

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

    {
        const ::wxGraphicsBitmap* bmp;
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_bmp,
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9dddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsBitmap, &bmp, &x, &y, &w, &h))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawBitmap(*bmp, x, y, w, h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxBitmap* bmp;
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_bmp,
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9dddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxBitmap, &bmp, &x, &y, &w, &h))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawBitmap(*bmp, x, y, w, h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawBitmap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawEllipse, "DrawEllipse(x, y, w, h) -> None\n"
"\n"
"Draws an ellipse.");

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

    {
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bdddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x, &y, &w, &h))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawEllipse(x, y, w, h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawEllipse, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawIcon, "DrawIcon(icon, x, y, w, h) -> None\n"
"\n"
"Draws the icon.");

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

    {
        const ::wxIcon* icon;
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_icon,
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9dddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxIcon, &icon, &x, &y, &w, &h))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawIcon(*icon, x, y, w, h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawIcon, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawLines, "DrawLines(point2Ds, fillStyle=ODDEVEN_RULE)\n"
"\n"
"Draws a polygon.");

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

    {
        PyObject * points;
        ::wxPolygonFillMode fillStyle = wxODDEVEN_RULE;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BP0|E", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &points, sipType_wxPolygonFillMode, &fillStyle))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxGraphicsContext_DrawLines(sipCpp, points, fillStyle);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawLines, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawPath, "DrawPath(path, fillStyle=ODDEVEN_RULE) -> None\n"
"\n"
"Draws the path by first filling and then stroking.");

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

    {
        const ::wxGraphicsPath* path;
        ::wxPolygonFillMode fillStyle = wxODDEVEN_RULE;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|E", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsPath, &path, sipType_wxPolygonFillMode, &fillStyle))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawPath(*path, fillStyle);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawPath, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawRectangle, "DrawRectangle(x, y, w, h) -> None\n"
"\n"
"Draws a rectangle.");

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

    {
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bdddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x, &y, &w, &h))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawRectangle(x, y, w, h);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawRectangle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawRoundedRectangle, "DrawRoundedRectangle(x, y, w, h, radius) -> None\n"
"\n"
"Draws a rounded rectangle.");

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

    {
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxDouble radius;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
            sipName_radius,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bddddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x, &y, &w, &h, &radius))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawRoundedRectangle(x, y, w, h, radius);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawRoundedRectangle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DrawText, "DrawText(str, x, y) -> None\n"
"DrawText(str, x, y, angle) -> None\n"
"DrawText(str, x, y, backgroundBrush) -> None\n"
"DrawText(str, x, y, angle, backgroundBrush) -> None\n"
"\n"
"Draws text at the defined position.\n"
"\n"
"\n"
"");

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

    {
        const ::wxString* str;
        int strState = 0;
        ::wxDouble x;
        ::wxDouble y;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_str,
            sipName_x,
            sipName_y,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1dd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &str, &strState, &x, &y))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawText(*str, x, y);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(str), sipType_wxString, strState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxString* str;
        int strState = 0;
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble angle;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_str,
            sipName_x,
            sipName_y,
            sipName_angle,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1ddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &str, &strState, &x, &y, &angle))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawText(*str, x, y, angle);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(str), sipType_wxString, strState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxString* str;
        int strState = 0;
        ::wxDouble x;
        ::wxDouble y;
        const ::wxGraphicsBrush* backgroundBrush;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_str,
            sipName_x,
            sipName_y,
            sipName_backgroundBrush,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1ddJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &str, &strState, &x, &y, sipType_wxGraphicsBrush, &backgroundBrush))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawText(*str, x, y, *backgroundBrush);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(str), sipType_wxString, strState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxString* str;
        int strState = 0;
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble angle;
        const ::wxGraphicsBrush* backgroundBrush;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_str,
            sipName_x,
            sipName_y,
            sipName_angle,
            sipName_backgroundBrush,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1dddJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &str, &strState, &x, &y, &angle, sipType_wxGraphicsBrush, &backgroundBrush))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawText(*str, x, y, angle, *backgroundBrush);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(str), sipType_wxString, strState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DrawText, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreatePath, "CreatePath() -> GraphicsPath\n"
"\n"
"Creates a native graphics path which is initially empty.");

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

    {
        const ::wxGraphicsContext *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsPath(sipCpp->CreatePath());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreatePath, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_FillPath, "FillPath(path, fillStyle=ODDEVEN_RULE) -> None\n"
"\n"
"Fills the path with the current brush.");

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

    {
        const ::wxGraphicsPath* path;
        ::wxPolygonFillMode fillStyle = wxODDEVEN_RULE;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|E", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsPath, &path, sipType_wxPolygonFillMode, &fillStyle))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->FillPath(*path, fillStyle);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_FillPath, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_StrokeLine, "StrokeLine(x1, y1, x2, y2) -> None\n"
"\n"
"Strokes a single line.");

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

    {
        ::wxDouble x1;
        ::wxDouble y1;
        ::wxDouble x2;
        ::wxDouble y2;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_x1,
            sipName_y1,
            sipName_x2,
            sipName_y2,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bdddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &x1, &y1, &x2, &y2))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->StrokeLine(x1, y1, x2, y2);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_StrokeLine, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_StrokeLines, "StrokeLines(point2Ds)\n"
"\n"
"Stroke lines connecting all the points.");

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

    {
        PyObject * points;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BP0", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &points))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxGraphicsContext_StrokeLines(sipCpp, points);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_StrokeLines, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_StrokePath, "StrokePath(path) -> None\n"
"\n"
"Strokes along a path with the current pen.");

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

    {
        const ::wxGraphicsPath* path;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsPath, &path))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->StrokePath(*path);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_StrokePath, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateFont, "CreateFont(font, col=BLACK) -> GraphicsFont\n"
"CreateFont(sizeInPixels, facename, flags=FONTFLAG_DEFAULT, col=BLACK) -> GraphicsFont\n"
"\n"
"Creates a native graphics font from a wxFont and a text colour.\n"
"");

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

    {
        const ::wxFont* font;
        const ::wxColour& coldef = *wxBLACK;
        const ::wxColour* col = &coldef;
        int colState = 0;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|J1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxFont, &font, sipType_wxColour, &col, &colState))
        {
            ::wxGraphicsFont*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsFont(sipCpp->CreateFont(*font, *col));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(col), sipType_wxColour, colState);

            if (PyErr_Occurred())
                return 0;

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

    {
        double sizeInPixels;
        const ::wxString* facename;
        int facenameState = 0;
        int flags = wxFONTFLAG_DEFAULT;
        const ::wxColour& coldef = *wxBLACK;
        const ::wxColour* col = &coldef;
        int colState = 0;
        const ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_sizeInPixels,
            sipName_facename,
            sipName_flags,
            sipName_col,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BdJ1|iJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &sizeInPixels, sipType_wxString, &facename, &facenameState, &flags, sipType_wxColour, &col, &colState))
        {
            ::wxGraphicsFont*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsFont(sipCpp->CreateFont(sizeInPixels, *facename, flags, *col));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(facename), sipType_wxString, facenameState);
            sipReleaseType(const_cast< ::wxColour *>(col), sipType_wxColour, colState);

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateFont, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetFont, "SetFont(font, colour) -> None\n"
"SetFont(font) -> None\n"
"\n"
"Sets the font for drawing text.\n"
"");

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

    {
        const ::wxFont* font;
        const ::wxColour* colour;
        int colourState = 0;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxFont, &font, sipType_wxColour, &colour, &colourState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetFont(*font, *colour);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(colour), sipType_wxColour, colourState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxGraphicsFont* font;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsFont, &font))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetFont(*font);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetFont, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetPartialTextExtents, "GetPartialTextExtents(text) -> List[float]\n"
"\n"
"Fills the widths array with the widths from the beginning of text to\n"
"the corresponding character of text.");

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

    {
        const ::wxString* text;
        int textState = 0;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &text, &textState))
        {
            ::wxArrayDouble*sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGraphicsContext_GetPartialTextExtents(sipCpp, text);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(const_cast< ::wxString *>(text), sipType_wxString, textState);

            if (sipIsErr)
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetPartialTextExtents, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetFullTextExtent, "GetFullTextExtent(text) -> Tuple[float, float, float, float]\n"
"GetTextExtent(text) -> (width, height)\n"
"\n"
"Gets the dimensions of the string using the currently selected font.");

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

    {
        const ::wxString* text;
        int textState = 0;
        ::wxDouble width;
        ::wxDouble height;
        ::wxDouble descent;
        ::wxDouble externalLeading;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &text, &textState))
        {
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->GetTextExtent(*text, &width, &height, &descent, &externalLeading);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(text), sipType_wxString, textState);

            if (PyErr_Occurred())
                return 0;

            return sipBuildResult(0, "(dddd)", width, height, descent, externalLeading);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetFullTextExtent, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetTextExtent, "GetTextExtent(self, text: Any) -> Any");

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

    {
        const ::wxString* text;
        int textState = 0;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &text, &textState))
        {
            PyObject * sipRes = SIP_NULLPTR;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxGraphicsContext_GetTextExtent(sipCpp, text);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(const_cast< ::wxString *>(text), sipType_wxString, textState);

            if (sipIsErr)
                return 0;

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetTextExtent, doc_wxGraphicsContext_GetTextExtent);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_StartDoc, "StartDoc(message) -> bool\n"
"\n"
"Begin a new document (relevant only for printing / pdf etc.) If there\n"
"is a progress dialog, message will be shown.");

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

    {
        const ::wxString* message;
        int messageState = 0;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxString, &message, &messageState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->StartDoc(*message);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(message), sipType_wxString, messageState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_StartDoc, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_EndDoc, "EndDoc() -> None\n"
"\n"
"Done with that document (relevant only for printing / pdf etc.)");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->EndDoc();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_EndDoc, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_StartPage, "StartPage(width=0, height=0) -> None\n"
"\n"
"Opens a new page (relevant only for printing / pdf etc.) with the\n"
"given size in points.");

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

    {
        ::wxDouble width = 0;
        ::wxDouble height = 0;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|dd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &width, &height))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->StartPage(width, height);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_StartPage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_EndPage, "EndPage() -> None\n"
"\n"
"Ends the current page (relevant only for printing / pdf etc.)");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->EndPage();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_EndPage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateBitmap, "CreateBitmap(bitmap) -> GraphicsBitmap\n"
"\n"
"Creates wxGraphicsBitmap from an existing wxBitmap.");

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

    {
        const ::wxBitmap* bitmap;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxBitmap, &bitmap))
        {
            ::wxGraphicsBitmap*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBitmap(sipCpp->CreateBitmap(*bitmap));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateBitmap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateBitmapFromImage, "CreateBitmapFromImage(image) -> GraphicsBitmap\n"
"\n"
"Creates wxGraphicsBitmap from an existing wxImage.");

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

    {
        const ::wxImage* image;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxImage, &image))
        {
            ::wxGraphicsBitmap*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBitmap(sipCpp->CreateBitmapFromImage(*image));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateBitmapFromImage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_CreateSubBitmap, "CreateSubBitmap(bitmap, x, y, w, h) -> GraphicsBitmap\n"
"\n"
"Extracts a sub-bitmap from an existing bitmap.");

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

    {
        const ::wxGraphicsBitmap* bitmap;
        ::wxDouble x;
        ::wxDouble y;
        ::wxDouble w;
        ::wxDouble h;
        ::wxGraphicsContext *sipCpp;

        static const char *sipKwdList[] = {
            sipName_bitmap,
            sipName_x,
            sipName_y,
            sipName_w,
            sipName_h,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9dddd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxGraphicsBitmap, &bitmap, &x, &y, &w, &h))
        {
            ::wxGraphicsBitmap*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGraphicsBitmap(sipCpp->CreateSubBitmap(*bitmap, x, y, w, h));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_CreateSubBitmap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_BeginLayer, "BeginLayer(opacity) -> None\n"
"\n"
"All rendering will be done into a fully transparent temporary context.");

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

    {
        ::wxDouble opacity;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bd", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &opacity))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->BeginLayer(opacity);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_BeginLayer, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_EndLayer, "EndLayer() -> None\n"
"\n"
"Composites back the drawings into the context with the opacity given\n"
"at the BeginLayer() call.");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->EndLayer();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_EndLayer, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_PushState, "PushState() -> None\n"
"\n"
"Push the current state (like transformations, clipping region and\n"
"quality settings) of the context on a stack.");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->PushState();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_PushState, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_PopState, "PopState() -> None\n"
"\n"
"Sets current state of the context to the state saved by a preceding\n"
"call to PushState() and removes that state from the stack of saved\n"
"states.");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->PopState();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_PopState, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_Flush, "Flush() -> None\n"
"\n"
"Make sure that the current content of this context is immediately\n"
"visible.");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Flush();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_Flush, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetNativeContext, "GetNativeContext() -> Any\n"
"\n"
"Returns the native context (CGContextRef for Core Graphics, Graphics\n"
"pointer for GDIPlus and cairo_t pointer for cairo).");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            void*sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetNativeContext();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromVoidPtr(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetNativeContext, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetAntialiasMode, "SetAntialiasMode(antialias) -> bool\n"
"\n"
"Sets the antialiasing mode, returns true if it supported.");

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

    {
        ::wxAntialiasMode antialias;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxAntialiasMode, &antialias))
        {
            bool sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->SetAntialiasMode(antialias);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetAntialiasMode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetAntialiasMode, "GetAntialiasMode() -> AntialiasMode\n"
"\n"
"Returns the current shape antialiasing mode.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            ::wxAntialiasMode sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetAntialiasMode();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetAntialiasMode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetInterpolationQuality, "SetInterpolationQuality(interpolation) -> bool\n"
"\n"
"Sets the interpolation quality, returns true if it is supported.");

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

    {
        ::wxInterpolationQuality interpolation;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxInterpolationQuality, &interpolation))
        {
            bool sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->SetInterpolationQuality(interpolation);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetInterpolationQuality, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetInterpolationQuality, "GetInterpolationQuality() -> InterpolationQuality\n"
"\n"
"Returns the current interpolation quality.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            ::wxInterpolationQuality sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetInterpolationQuality();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetInterpolationQuality, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_SetCompositionMode, "SetCompositionMode(op) -> bool\n"
"\n"
"Sets the compositing operator, returns true if it supported.");

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

    {
        ::wxCompositionMode op;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxCompositionMode, &op))
        {
            bool sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->SetCompositionMode(op);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_SetCompositionMode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetCompositionMode, "GetCompositionMode() -> CompositionMode\n"
"\n"
"Returns the current compositing operator.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            ::wxCompositionMode sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetCompositionMode();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetCompositionMode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetSize, "GetSize() -> Tuple[float, float]\n"
"\n"
"Returns the size of the graphics context in device coordinates.");

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

    {
        ::wxDouble width;
        ::wxDouble height;
        const ::wxGraphicsContext *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->GetSize(&width, &height);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipBuildResult(0, "(dd)", width, height);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetSize, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetDPI, "GetDPI() -> Tuple[float, float]\n"
"\n"
"Returns the resolution of the graphics context in device points per\n"
"inch.");

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

    {
        ::wxDouble dpiX;
        ::wxDouble dpiY;
        const ::wxGraphicsContext *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->GetDPI(&dpiX, &dpiY);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipBuildResult(0, "(dd)", dpiX, dpiY);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetDPI, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_GetWindow, "GetWindow() -> Window\n"
"\n"
"Returns the associated window if any.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            ::wxWindow*sipRes;
        if (sipCpp->IsNull()) {
            wxPyErr_SetString(PyExc_ValueError, "The GraphicsContext is not valid (likely an uninitialized or null instance)");
            return NULL;
        }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetWindow();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_GetWindow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_ShouldOffset, "ShouldOffset() -> bool\n"
"\n"
"Helper to determine if a 0.5 offset should be applied for the drawing\n"
"operation.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->ShouldOffset();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_ShouldOffset, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_EnableOffset, "EnableOffset(enable=True) -> None\n"
"\n"
"Indicates whether the context should try to offset for pixel\n"
"boundaries.");

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

    {
        bool enable = 1;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|b", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &enable))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->EnableOffset(enable);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_EnableOffset, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_DisableOffset, "DisableOffset() -> None\n"
"\n"
"Helper to determine if a 0.5 offset should be applied for the drawing\n"
"operation.");

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

    {
        ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DisableOffset();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_DisableOffset, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_OffsetEnabled, "OffsetEnabled() -> bool\n"
"\n"
"Helper to determine if a 0.5 offset should be applied for the drawing\n"
"operation.");

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

    {
        const ::wxGraphicsContext *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGraphicsContext, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->OffsetEnabled();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_OffsetEnabled, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_FromDIP, "FromDIP(sz) -> Size\n"
"FromDIP(pt) -> Point\n"
"FromDIP(d) -> int\n"
"\n"
"Convert DPI-independent pixel values to the value in pixels\n"
"appropriate for the graphics context.\n"
"\n"
"");

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

    {
        const ::wxSize* sz;
        int szState = 0;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxSize, &sz, &szState))
        {
            ::wxSize*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxSize(sipCpp->FromDIP(*sz));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxSize *>(sz), sipType_wxSize, szState);

            if (PyErr_Occurred())
                return 0;

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

    {
        const ::wxPoint* pt;
        int ptState = 0;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxPoint, &pt, &ptState))
        {
            ::wxPoint*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxPoint(sipCpp->FromDIP(*pt));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxPoint *>(pt), sipType_wxPoint, ptState);

            if (PyErr_Occurred())
                return 0;

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

    {
        int d;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &d))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->FromDIP(d);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_FromDIP, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_ToDIP, "ToDIP(sz) -> Size\n"
"ToDIP(pt) -> Point\n"
"ToDIP(d) -> int\n"
"\n"
"Convert pixel values of the current graphics context to DPI-\n"
"independent pixel values.\n"
"\n"
"");

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

    {
        const ::wxSize* sz;
        int szState = 0;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxSize, &sz, &szState))
        {
            ::wxSize*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxSize(sipCpp->ToDIP(*sz));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxSize *>(sz), sipType_wxSize, szState);

            if (PyErr_Occurred())
                return 0;

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

    {
        const ::wxPoint* pt;
        int ptState = 0;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxGraphicsContext, &sipCpp, sipType_wxPoint, &pt, &ptState))
        {
            ::wxPoint*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxPoint(sipCpp->ToDIP(*pt));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxPoint *>(pt), sipType_wxPoint, ptState);

            if (PyErr_Occurred())
                return 0;

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

    {
        int d;
        const ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &d))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->ToDIP(d);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_ToDIP, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGraphicsContext_StrokeLineSegments, "StrokeLineSegments(beginPoint2Ds, endPoint2Ds)\n"
"\n"
"Stroke disconnected lines from begin to end points.");

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

    {
        PyObject * beginPoints;
        PyObject * endPoints;
        ::wxGraphicsContext *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BP0P0", &sipSelf, sipType_wxGraphicsContext, &sipCpp, &beginPoints, &endPoints))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxGraphicsContext_StrokeLineSegments(sipCpp, beginPoints, endPoints);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GraphicsContext, sipName_StrokeLineSegments, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGraphicsContext)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    delete reinterpret_cast< ::wxGraphicsContext *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_wxGraphicsContext(sipSimpleWrapper *);}
static void dealloc_wxGraphicsContext(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxGraphicsContext(sipGetAddress(sipSelf), 0);
    }
}


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


static PyMethodDef methods_wxGraphicsContext[] = {
    {sipName_BeginLayer, SIP_MLMETH_CAST(meth_wxGraphicsContext_BeginLayer), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_BeginLayer},
    {sipName_Clip, SIP_MLMETH_CAST(meth_wxGraphicsContext_Clip), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_Clip},
    {sipName_ConcatTransform, SIP_MLMETH_CAST(meth_wxGraphicsContext_ConcatTransform), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_ConcatTransform},
    {sipName_Create, SIP_MLMETH_CAST(meth_wxGraphicsContext_Create), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_Create},
    {sipName_CreateBitmap, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateBitmap), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateBitmap},
    {sipName_CreateBitmapFromImage, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateBitmapFromImage), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateBitmapFromImage},
    {sipName_CreateBrush, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateBrush), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateBrush},
    {sipName_CreateFont, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateFont), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateFont},
    {sipName_CreateFromNative, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateFromNative), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateFromNative},
    {sipName_CreateFromNativeWindow, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateFromNativeWindow), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateFromNativeWindow},
    {sipName_CreateFromUnknownDC, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateFromUnknownDC), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateFromUnknownDC},
    {sipName_CreateLinearGradientBrush, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateLinearGradientBrush), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateLinearGradientBrush},
    {sipName_CreateMatrix, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateMatrix), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateMatrix},
    {sipName_CreatePath, meth_wxGraphicsContext_CreatePath, METH_VARARGS, doc_wxGraphicsContext_CreatePath},
    {sipName_CreatePen, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreatePen), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreatePen},
    {sipName_CreateRadialGradientBrush, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateRadialGradientBrush), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateRadialGradientBrush},
    {sipName_CreateSubBitmap, SIP_MLMETH_CAST(meth_wxGraphicsContext_CreateSubBitmap), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_CreateSubBitmap},
    {sipName_DisableOffset, meth_wxGraphicsContext_DisableOffset, METH_VARARGS, doc_wxGraphicsContext_DisableOffset},
    {sipName_DrawBitmap, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawBitmap), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawBitmap},
    {sipName_DrawEllipse, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawEllipse), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawEllipse},
    {sipName_DrawIcon, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawIcon), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawIcon},
    {sipName_DrawLines, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawLines), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawLines},
    {sipName_DrawPath, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawPath), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawPath},
    {sipName_DrawRectangle, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawRectangle), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawRectangle},
    {sipName_DrawRoundedRectangle, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawRoundedRectangle), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawRoundedRectangle},
    {sipName_DrawText, SIP_MLMETH_CAST(meth_wxGraphicsContext_DrawText), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_DrawText},
    {sipName_EnableOffset, SIP_MLMETH_CAST(meth_wxGraphicsContext_EnableOffset), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_EnableOffset},
    {sipName_EndDoc, meth_wxGraphicsContext_EndDoc, METH_VARARGS, doc_wxGraphicsContext_EndDoc},
    {sipName_EndLayer, meth_wxGraphicsContext_EndLayer, METH_VARARGS, doc_wxGraphicsContext_EndLayer},
    {sipName_EndPage, meth_wxGraphicsContext_EndPage, METH_VARARGS, doc_wxGraphicsContext_EndPage},
    {sipName_FillPath, SIP_MLMETH_CAST(meth_wxGraphicsContext_FillPath), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_FillPath},
    {sipName_Flush, meth_wxGraphicsContext_Flush, METH_VARARGS, doc_wxGraphicsContext_Flush},
    {sipName_FromDIP, SIP_MLMETH_CAST(meth_wxGraphicsContext_FromDIP), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_FromDIP},
    {sipName_GetAntialiasMode, meth_wxGraphicsContext_GetAntialiasMode, METH_VARARGS, doc_wxGraphicsContext_GetAntialiasMode},
    {sipName_GetClipBox, SIP_MLMETH_CAST(meth_wxGraphicsContext_GetClipBox), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_GetClipBox},
    {sipName_GetCompositionMode, meth_wxGraphicsContext_GetCompositionMode, METH_VARARGS, doc_wxGraphicsContext_GetCompositionMode},
    {sipName_GetDPI, SIP_MLMETH_CAST(meth_wxGraphicsContext_GetDPI), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_GetDPI},
    {sipName_GetFullTextExtent, SIP_MLMETH_CAST(meth_wxGraphicsContext_GetFullTextExtent), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_GetFullTextExtent},
    {sipName_GetInterpolationQuality, meth_wxGraphicsContext_GetInterpolationQuality, METH_VARARGS, doc_wxGraphicsContext_GetInterpolationQuality},
    {sipName_GetNativeContext, meth_wxGraphicsContext_GetNativeContext, METH_VARARGS, doc_wxGraphicsContext_GetNativeContext},
    {sipName_GetPartialTextExtents, SIP_MLMETH_CAST(meth_wxGraphicsContext_GetPartialTextExtents), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_GetPartialTextExtents},
    {sipName_GetSize, SIP_MLMETH_CAST(meth_wxGraphicsContext_GetSize), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_GetSize},
    {sipName_GetTextExtent, SIP_MLMETH_CAST(meth_wxGraphicsContext_GetTextExtent), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_GetTextExtent},
    {sipName_GetTransform, meth_wxGraphicsContext_GetTransform, METH_VARARGS, doc_wxGraphicsContext_GetTransform},
    {sipName_GetWindow, meth_wxGraphicsContext_GetWindow, METH_VARARGS, doc_wxGraphicsContext_GetWindow},
    {sipName_OffsetEnabled, meth_wxGraphicsContext_OffsetEnabled, METH_VARARGS, doc_wxGraphicsContext_OffsetEnabled},
    {sipName_PopState, meth_wxGraphicsContext_PopState, METH_VARARGS, doc_wxGraphicsContext_PopState},
    {sipName_PushState, meth_wxGraphicsContext_PushState, METH_VARARGS, doc_wxGraphicsContext_PushState},
    {sipName_ResetClip, meth_wxGraphicsContext_ResetClip, METH_VARARGS, doc_wxGraphicsContext_ResetClip},
    {sipName_Rotate, SIP_MLMETH_CAST(meth_wxGraphicsContext_Rotate), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_Rotate},
    {sipName_Scale, SIP_MLMETH_CAST(meth_wxGraphicsContext_Scale), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_Scale},
    {sipName_SetAntialiasMode, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetAntialiasMode), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetAntialiasMode},
    {sipName_SetBrush, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetBrush), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetBrush},
    {sipName_SetCompositionMode, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetCompositionMode), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetCompositionMode},
    {sipName_SetFont, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetFont), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetFont},
    {sipName_SetInterpolationQuality, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetInterpolationQuality), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetInterpolationQuality},
    {sipName_SetPen, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetPen), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetPen},
    {sipName_SetTransform, SIP_MLMETH_CAST(meth_wxGraphicsContext_SetTransform), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_SetTransform},
    {sipName_ShouldOffset, meth_wxGraphicsContext_ShouldOffset, METH_VARARGS, doc_wxGraphicsContext_ShouldOffset},
    {sipName_StartDoc, SIP_MLMETH_CAST(meth_wxGraphicsContext_StartDoc), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_StartDoc},
    {sipName_StartPage, SIP_MLMETH_CAST(meth_wxGraphicsContext_StartPage), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_StartPage},
    {sipName_StrokeLine, SIP_MLMETH_CAST(meth_wxGraphicsContext_StrokeLine), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_StrokeLine},
    {sipName_StrokeLineSegments, SIP_MLMETH_CAST(meth_wxGraphicsContext_StrokeLineSegments), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_StrokeLineSegments},
    {sipName_StrokeLines, SIP_MLMETH_CAST(meth_wxGraphicsContext_StrokeLines), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_StrokeLines},
    {sipName_StrokePath, SIP_MLMETH_CAST(meth_wxGraphicsContext_StrokePath), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_StrokePath},
    {sipName_ToDIP, SIP_MLMETH_CAST(meth_wxGraphicsContext_ToDIP), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_ToDIP},
    {sipName_Translate, SIP_MLMETH_CAST(meth_wxGraphicsContext_Translate), METH_VARARGS|METH_KEYWORDS, doc_wxGraphicsContext_Translate}
};

sipVariableDef variables_wxGraphicsContext[] = {
    {PropertyVariable, sipName_Window, &methods_wxGraphicsContext[44], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Transform, &methods_wxGraphicsContext[43], &methods_wxGraphicsContext[57], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_TextExtent, &methods_wxGraphicsContext[42], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_NativeContext, &methods_wxGraphicsContext[39], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_InterpolationQuality, &methods_wxGraphicsContext[38], &methods_wxGraphicsContext[55], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_CompositionMode, &methods_wxGraphicsContext[35], &methods_wxGraphicsContext[53], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_AntialiasMode, &methods_wxGraphicsContext[33], &methods_wxGraphicsContext[51], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGraphicsContext, "A wxGraphicsContext instance is the object that is drawn upon.");


sipClassTypeDef sipTypeDef__core_wxGraphicsContext = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxGraphicsContext,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GraphicsContext,
        {0, 0, 1},
        67, methods_wxGraphicsContext,
        0, SIP_NULLPTR,
        7, variables_wxGraphicsContext,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGraphicsContext,
    -1,
    -1,
    supers_wxGraphicsContext,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGraphicsContext,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGraphicsContext,
    cast_wxGraphicsContext,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    0,
};
