/*
 * 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/preferences.h>

        #include <wx/window.h>
        #include <wx/bitmap.h>


class sipwxPreferencesPage : public  ::wxPreferencesPage
{
public:
    sipwxPreferencesPage();
    virtual ~sipwxPreferencesPage();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxWindow* CreateWindow( ::wxWindow*) SIP_OVERRIDE;
     ::wxBitmap GetLargeIcon() const SIP_OVERRIDE;
     ::wxString GetName() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxPreferencesPage(const sipwxPreferencesPage &);
    sipwxPreferencesPage &operator = (const sipwxPreferencesPage &);

    char sipPyMethods[3];
};

sipwxPreferencesPage::sipwxPreferencesPage():  ::wxPreferencesPage(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

 ::wxWindow* sipwxPreferencesPage::CreateWindow( ::wxWindow*parent)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,sipName_PreferencesPage,sipName_CreateWindow);

    if (!sipMeth)
        return 0;

    extern  ::wxWindow* sipVH__core_227(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxWindow*);

    return sipVH__core_227(sipGILState, 0, sipPySelf, sipMeth, parent);
}

 ::wxBitmap sipwxPreferencesPage::GetLargeIcon() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[1]),sipPySelf,sipName_PreferencesPage,sipName_GetLargeIcon);

    if (!sipMeth)
        return  ::wxBitmap();

    extern  ::wxBitmap sipVH__core_69(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__core_69(sipGILState, 0, sipPySelf, sipMeth);
}

 ::wxString sipwxPreferencesPage::GetName() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[2]),sipPySelf,sipName_PreferencesPage,sipName_GetName);

    if (!sipMeth)
        return  ::wxString();

    extern  ::wxString sipVH__core_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__core_11(sipGILState, 0, sipPySelf, sipMeth);
}


PyDoc_STRVAR(doc_wxPreferencesPage_GetName, "GetName() -> String\n"
"\n"
"Return name of the page.");

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

    {
        const  ::wxPreferencesPage *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_PreferencesPage, sipName_GetName);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxString(sipCpp->GetName());
            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_PreferencesPage, sipName_GetName, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPreferencesPage_GetLargeIcon, "GetLargeIcon() -> Bitmap\n"
"\n"
"Return 32x32 icon used for the page on some platforms.");

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

    {
        const  ::wxPreferencesPage *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_PreferencesPage, sipName_GetLargeIcon);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxBitmap(sipCpp->GetLargeIcon());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPreferencesPage_CreateWindow, "CreateWindow(parent) -> Window\n"
"\n"
"Create a window for this page.");

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

    {
         ::wxWindow* parent;
         ::wxPreferencesPage *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxPreferencesPage, &sipCpp, sipType_wxWindow, &parent))
        {
             ::wxWindow*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_PreferencesPage, sipName_CreateWindow);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->CreateWindow(parent);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxPreferencesPage *>(sipCppV);
    else
        delete reinterpret_cast< ::wxPreferencesPage *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPreferencesPage();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxPreferencesPage[] = {
    {SIP_MLNAME_CAST(sipName_CreateWindow), SIP_MLMETH_CAST(meth_wxPreferencesPage_CreateWindow), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPreferencesPage_CreateWindow)},
    {SIP_MLNAME_CAST(sipName_GetLargeIcon), meth_wxPreferencesPage_GetLargeIcon, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPreferencesPage_GetLargeIcon)},
    {SIP_MLNAME_CAST(sipName_GetName), meth_wxPreferencesPage_GetName, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPreferencesPage_GetName)}
};

sipVariableDef variables_wxPreferencesPage[] = {
    {PropertyVariable, sipName_Name, &methods_wxPreferencesPage[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_LargeIcon, &methods_wxPreferencesPage[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxPreferencesPage, "PreferencesPage()\n"
"\n"
"One page of preferences dialog.");


sipClassTypeDef sipTypeDef__core_wxPreferencesPage = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxPreferencesPage,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_PreferencesPage,
        {0, 0, 1},
        3, methods_wxPreferencesPage,
        0, SIP_NULLPTR,
        2, variables_wxPreferencesPage,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPreferencesPage,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxPreferencesPage,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxPreferencesPage,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxPreferencesPage,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
