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

#include "sipAPI_core.h"

        #include <wx/dc.h>

        #include <wx/dc.h>
        #include <wx/colour.h>


PyDoc_STRVAR(doc_wxDCTextColourChanger_Set, "Set(col)\n"
"\n"
"Set the colour to use.");

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

    {
        const  ::wxColour* col;
        int colState = 0;
         ::wxDCTextColourChanger *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxDCTextColourChanger, &sipCpp, sipType_wxColour, &col, &colState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Set(*col);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(col),sipType_wxColour,colState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_DCTextColourChanger, sipName_Set, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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

    {
         ::wxDC* dc;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxDC, &dc))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxDCTextColourChanger(*dc);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
         ::wxDC* dc;
        const  ::wxColour* col;
        int colState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9J1", sipType_wxDC, &dc, sipType_wxColour, &col, &colState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxDCTextColourChanger(*dc,*col);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxColour *>(col),sipType_wxColour,colState);

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxDCTextColourChanger[] = {
    {SIP_MLNAME_CAST(sipName_Set), SIP_MLMETH_CAST(meth_wxDCTextColourChanger_Set), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDCTextColourChanger_Set)}
};

PyDoc_STRVAR(doc_wxDCTextColourChanger, "DCTextColourChanger(dc)\n"
"DCTextColourChanger(dc, col)\n"
"\n"
"wxDCTextColourChanger is a small helper class for setting a foreground\n"
"text colour on a wxDC and unsetting it automatically in the\n"
"destructor, restoring the previous one.");


sipClassTypeDef sipTypeDef__core_wxDCTextColourChanger = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxDCTextColourChanger,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_DCTextColourChanger,
        {0, 0, 1},
        1, methods_wxDCTextColourChanger,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxDCTextColourChanger,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxDCTextColourChanger,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxDCTextColourChanger,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxDCTextColourChanger,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
