/*
 * 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/pen.h>
        #include "arrayholder.h"
        #include <wx/pen.h>
        #include <wx/colour.h>
        #include <wx/bitmap.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>
    wxArrayInt* _wxPen_GetDashes(const wxPen* self)
    {
        wxArrayInt* arr = new wxArrayInt;
        wxDash* dashes;
        int num = self->GetDashes(&dashes);
        for (int i=0; i<num; i++)
            arr->Add(dashes[i]);
        return arr;
    }
    void _wxPen__copyFrom(wxPen* self, const wxPen* other)
    {
        *self = *other;
    }


PyDoc_STRVAR(doc_wxPen_SetColour, "SetColour(colour) -> None\n"
"SetColour(red, green, blue) -> None\n"
"\n"
"The pen's colour is changed to the given colour.\n"
"");

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

    {
        ::wxColour* colour;
        int colourState = 0;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxColour, &colour, &colourState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetColour(*colour);
            Py_END_ALLOW_THREADS
            sipReleaseType(colour, sipType_wxColour, colourState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        unsigned char red;
        unsigned char green;
        unsigned char blue;
        ::wxPen *sipCpp;

        static const char *sipKwdList[] = {
            sipName_red,
            sipName_green,
            sipName_blue,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bccc", &sipSelf, sipType_wxPen, &sipCpp, &red, &green, &blue))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetColour(red, green, blue);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetCap, "GetCap() -> PenCap\n"
"\n"
"Returns the pen cap style, which may be one of wxCAP_ROUND,\n"
"wxCAP_PROJECTING and wxCAP_BUTT.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetCap();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetCap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetQuality, "GetQuality() -> PenQuality\n"
"\n"
"Returns the pen quality.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetQuality();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetQuality, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetColour, "GetColour() -> Colour\n"
"\n"
"Returns a reference to the pen colour.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxColour(sipCpp->GetColour());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetDashes, "GetDashes() -> List[int]\n"
"\n"
"Gets an array of dashes (defined as char in X, DWORD under Windows).");

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

    {
        const ::wxPen *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
        {
            ::wxArrayInt*sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxPen_GetDashes(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetDashes, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetJoin, "GetJoin() -> PenJoin\n"
"\n"
"Returns the pen join style, which may be one of wxJOIN_BEVEL,\n"
"wxJOIN_ROUND and wxJOIN_MITER.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetJoin();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetJoin, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetStipple, "GetStipple() -> Bitmap\n"
"\n"
"Gets a pointer to the stipple bitmap.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetStipple();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetStipple, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetStyle, "GetStyle() -> PenStyle\n"
"\n"
"Returns the pen style.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetStyle();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetStyle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_GetWidth, "GetWidth() -> int\n"
"\n"
"Returns the pen width.");

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

    {
        const ::wxPen *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetWidth();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_GetWidth, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_IsOk, "IsOk() -> bool\n"
"\n"
"Returns true if the pen is initialised.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsOk();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_IsOk, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_IsNonTransparent, "IsNonTransparent() -> bool\n"
"\n"
"Returns true if the pen is a valid non-transparent pen.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsNonTransparent();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_IsNonTransparent, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_IsTransparent, "IsTransparent() -> bool\n"
"\n"
"Returns true if the pen is transparent.");

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

    {
        const ::wxPen *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsTransparent();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_IsTransparent, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetCap, "SetCap(capStyle) -> None\n"
"\n"
"Sets the pen cap style, which may be one of wxCAP_ROUND,\n"
"wxCAP_PROJECTING and wxCAP_BUTT.");

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

    {
        ::wxPenCap capStyle;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenCap, &capStyle))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetCap(capStyle);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetCap, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetQuality, "SetQuality(quality) -> None\n"
"\n"
"Sets the pen quality.");

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

    {
        ::wxPenQuality quality;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenQuality, &quality))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetQuality(quality);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetQuality, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetDashes, "SetDashes(dashes) -> None\n"
"\n"
"Associates an array of dash values (defined as char in X, DWORD under\n"
"Windows) with the pen.");

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

    {
        const ::wxArrayInt* dashes;
        int dashesState = 0;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxArrayInt, &dashes, &dashesState))
        {
        size_t len = dashes->GetCount();
        wxDashCArrayHolder* holder = new wxDashCArrayHolder;
        holder->m_array = new wxDash[len];
        for (int idx=0; idx<len; idx+=1) {
            holder->m_array[idx] = (*dashes)[idx];
        }
        // Make a PyObject for the holder, and transfer its ownership to self.
        PyObject* pyHolder = sipConvertFromNewType(
                (void*)holder, sipType_wxDashCArrayHolder, (PyObject*)sipSelf);
        Py_DECREF(pyHolder);
        sipCpp->SetDashes(len, holder->m_array);
            sipReleaseType(const_cast< ::wxArrayInt *>(dashes), sipType_wxArrayInt, dashesState);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetDashes, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetJoin, "SetJoin(join_style) -> None\n"
"\n"
"Sets the pen join style, which may be one of wxJOIN_BEVEL,\n"
"wxJOIN_ROUND and wxJOIN_MITER.");

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

    {
        ::wxPenJoin join_style;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenJoin, &join_style))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetJoin(join_style);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetJoin, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetStipple, "SetStipple(stipple) -> None\n"
"\n"
"Sets the bitmap for stippling.");

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

    {
        const ::wxBitmap* stipple;
        ::wxPen *sipCpp;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetStipple(*stipple);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetStipple, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetStyle, "SetStyle(style) -> None\n"
"\n"
"Set the pen style.");

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

    {
        ::wxPenStyle style;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenStyle, &style))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetStyle(style);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetStyle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen_SetWidth, "SetWidth(width) -> None\n"
"\n"
"Sets the pen width.");

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

    {
        int width;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxPen, &sipCpp, &width))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetWidth(width);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName_SetWidth, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPen__copyFrom, "_copyFrom(other) -> None\n"
"\n"
"For internal use only.");

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

    {
        const ::wxPen* other;
        ::wxPen *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPen, &other))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxPen__copyFrom(sipCpp, other);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_Pen, sipName__copyFrom, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_wxPen___eq__(PyObject *, PyObject *);}
static PyObject *slot_wxPen___eq__(PyObject *sipSelf, PyObject *sipArg)
{
    ::wxPen *sipCpp = reinterpret_cast< ::wxPen *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxPen));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxPen* pen;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_wxPen, &pen))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->::wxPen::operator==(*pen);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    return sipPySlotExtend(&sipModuleAPI__core, eq_slot, sipType_wxPen, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_wxPen___ne__(PyObject *, PyObject *);}
static PyObject *slot_wxPen___ne__(PyObject *sipSelf, PyObject *sipArg)
{
    ::wxPen *sipCpp = reinterpret_cast< ::wxPen *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxPen));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxPen* pen;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_wxPen, &pen))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->::wxPen::operator!=(*pen);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    return sipPySlotExtend(&sipModuleAPI__core, ne_slot, sipType_wxPen, sipSelf, sipArg);
}


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

    if (targetType == sipType_wxPen)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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


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


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


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


extern "C" {static void *init_type_wxPen(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxPen(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    ::wxPen *sipCpp = SIP_NULLPTR;

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxPen();
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const ::wxPenInfo* info;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxPenInfo, &info))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxPen(*info);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const ::wxColour* colour;
        int colourState = 0;
        int width = 1;
        ::wxPenStyle style = wxPENSTYLE_SOLID;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|iE", sipType_wxColour, &colour, &colourState, &width, sipType_wxPenStyle, &style))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxPen(*colour, width, style);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(colour), sipType_wxColour, colourState);

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

            return sipCpp;
        }
    }

    {
        const ::wxPen* pen;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxPen, &pen))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxPen(*pen);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


/* Define this type's Python slots. */
static sipPySlotDef slots_wxPen[] = {
    {(void *)slot_wxPen___eq__, eq_slot},
    {(void *)slot_wxPen___ne__, ne_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_wxPen[] = {
    {sipName_GetCap, meth_wxPen_GetCap, METH_VARARGS, doc_wxPen_GetCap},
    {sipName_GetColour, meth_wxPen_GetColour, METH_VARARGS, doc_wxPen_GetColour},
    {sipName_GetDashes, meth_wxPen_GetDashes, METH_VARARGS, doc_wxPen_GetDashes},
    {sipName_GetJoin, meth_wxPen_GetJoin, METH_VARARGS, doc_wxPen_GetJoin},
    {sipName_GetQuality, meth_wxPen_GetQuality, METH_VARARGS, doc_wxPen_GetQuality},
    {sipName_GetStipple, meth_wxPen_GetStipple, METH_VARARGS, doc_wxPen_GetStipple},
    {sipName_GetStyle, meth_wxPen_GetStyle, METH_VARARGS, doc_wxPen_GetStyle},
    {sipName_GetWidth, meth_wxPen_GetWidth, METH_VARARGS, doc_wxPen_GetWidth},
    {sipName_IsNonTransparent, meth_wxPen_IsNonTransparent, METH_VARARGS, doc_wxPen_IsNonTransparent},
    {sipName_IsOk, meth_wxPen_IsOk, METH_VARARGS, doc_wxPen_IsOk},
    {sipName_IsTransparent, meth_wxPen_IsTransparent, METH_VARARGS, doc_wxPen_IsTransparent},
    {sipName_SetCap, SIP_MLMETH_CAST(meth_wxPen_SetCap), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetCap},
    {sipName_SetColour, SIP_MLMETH_CAST(meth_wxPen_SetColour), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetColour},
    {sipName_SetDashes, SIP_MLMETH_CAST(meth_wxPen_SetDashes), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetDashes},
    {sipName_SetJoin, SIP_MLMETH_CAST(meth_wxPen_SetJoin), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetJoin},
    {sipName_SetQuality, SIP_MLMETH_CAST(meth_wxPen_SetQuality), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetQuality},
    {sipName_SetStipple, SIP_MLMETH_CAST(meth_wxPen_SetStipple), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetStipple},
    {sipName_SetStyle, SIP_MLMETH_CAST(meth_wxPen_SetStyle), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetStyle},
    {sipName_SetWidth, SIP_MLMETH_CAST(meth_wxPen_SetWidth), METH_VARARGS|METH_KEYWORDS, doc_wxPen_SetWidth},
    {sipName__copyFrom, SIP_MLMETH_CAST(meth_wxPen__copyFrom), METH_VARARGS|METH_KEYWORDS, doc_wxPen__copyFrom}
};

sipVariableDef variables_wxPen[] = {
    {PropertyVariable, sipName_Width, &methods_wxPen[7], &methods_wxPen[18], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Style, &methods_wxPen[6], &methods_wxPen[17], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Stipple, &methods_wxPen[5], &methods_wxPen[16], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Quality, &methods_wxPen[4], &methods_wxPen[15], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Join, &methods_wxPen[3], &methods_wxPen[14], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Dashes, &methods_wxPen[2], &methods_wxPen[13], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Colour, &methods_wxPen[1], &methods_wxPen[12], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Cap, &methods_wxPen[0], &methods_wxPen[11], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxPen, "Pen() -> None\n"
"Pen(info) -> None\n"
"Pen(colour, width=1, style=PENSTYLE_SOLID) -> None\n"
"Pen(pen) -> None\n"
"\n"
"A pen is a drawing tool for drawing outlines.");


sipClassTypeDef sipTypeDef__core_wxPen = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxPen,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_Pen,
        {0, 0, 1},
        20, methods_wxPen,
        0, SIP_NULLPTR,
        8, variables_wxPen,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPen,
    -1,
    -1,
    supers_wxPen,
    slots_wxPen,
    init_type_wxPen,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxPen,
    assign_wxPen,
    array_wxPen,
    copy_wxPen,
    release_wxPen,
    cast_wxPen,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxPen,
    sizeof (::wxPen),
};
