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

#include "sipAPI_core.h"

        #include <wx/config.h>

        #include <wx/config.h>


PyDoc_STRVAR(doc_wxConfigPathChanger_Name, "Name() -> String\n"
"\n"
"Returns the name of the key which was passed to the ctor.");

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

    {
        const  ::wxConfigPathChanger *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxString(sipCpp->Name());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxConfigPathChanger_UpdateIfDeleted, "UpdateIfDeleted()\n"
"\n"
"This method must be called if the original path inside the wxConfig\n"
"object (i.e.");

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

    {
         ::wxConfigPathChanger *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp->UpdateIfDeleted();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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

    {
        const  ::wxConfigBase* pContainer;
        const  ::wxString* strEntry;
        int strEntryState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8J1", sipType_wxConfigBase, &pContainer, sipType_wxString,&strEntry, &strEntryState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxConfigPathChanger(pContainer,*strEntry);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(strEntry),sipType_wxString,strEntryState);

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxConfigPathChanger[] = {
    {SIP_MLNAME_CAST(sipName_Name), meth_wxConfigPathChanger_Name, METH_VARARGS, SIP_MLDOC_CAST(doc_wxConfigPathChanger_Name)},
    {SIP_MLNAME_CAST(sipName_UpdateIfDeleted), meth_wxConfigPathChanger_UpdateIfDeleted, METH_VARARGS, SIP_MLDOC_CAST(doc_wxConfigPathChanger_UpdateIfDeleted)}
};

PyDoc_STRVAR(doc_wxConfigPathChanger, "ConfigPathChanger(pContainer, strEntry)\n"
"\n"
"A handy little class which changes the current path in a wxConfig\n"
"object and restores it in dtor.");


sipClassTypeDef sipTypeDef__core_wxConfigPathChanger = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxConfigPathChanger,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_ConfigPathChanger,
        {0, 0, 1},
        2, methods_wxConfigPathChanger,
        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_wxConfigPathChanger,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxConfigPathChanger,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxConfigPathChanger,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxConfigPathChanger,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
