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

#include "sipAPI_core.h"
        #include <wx/filedlgcustomize.h>
        #include <wx/event.h>
        #include <wx/eventfilter.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


PyDoc_STRVAR(doc_wxFileDialogChoice_GetSelection, "GetSelection() -> int\n"
"\n"
"Return the index of the selected item, possibly wxNOT_FOUND.");

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

    {
        const  ::wxFileDialogChoice *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetSelection();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_FileDialogChoice, sipName_GetSelection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileDialogChoice_SetSelection, "SetSelection(n)\n"
"\n"
"Set the selection to the item with the given index.");

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

    {
        int n;
         ::wxFileDialogChoice *sipCpp;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetSelection(n);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_FileDialogChoice, sipName_SetSelection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxFileDialogChoice)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


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


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


static PyMethodDef methods_wxFileDialogChoice[] = {
    {sipName_GetSelection, meth_wxFileDialogChoice_GetSelection, METH_VARARGS, doc_wxFileDialogChoice_GetSelection},
    {sipName_SetSelection, SIP_MLMETH_CAST(meth_wxFileDialogChoice_SetSelection), METH_VARARGS|METH_KEYWORDS, doc_wxFileDialogChoice_SetSelection}
};

sipVariableDef variables_wxFileDialogChoice[] = {
    {PropertyVariable, sipName_Selection, &methods_wxFileDialogChoice[0], &methods_wxFileDialogChoice[1], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxFileDialogChoice, "Represents a custom read-only combobox inside wxFileDialog.");


sipClassTypeDef sipTypeDef__core_wxFileDialogChoice = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxFileDialogChoice,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_FileDialogChoice,
        {0, 0, 1},
        2, methods_wxFileDialogChoice,
        0, SIP_NULLPTR,
        1, variables_wxFileDialogChoice,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxFileDialogChoice,
    -1,
    -1,
    supers_wxFileDialogChoice,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxFileDialogChoice,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxFileDialogChoice,
    cast_wxFileDialogChoice,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
