/*
 * 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/printdlg.h>
        #include <wx/window.h>
        #include <wx/cmndata.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxPageSetupDialog : public ::wxPageSetupDialog
{
public:
    sipwxPageSetupDialog(::wxWindow*, ::wxPageSetupDialogData*);
    ~sipwxPageSetupDialog();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxPageSetupDialog(const sipwxPageSetupDialog &);
    sipwxPageSetupDialog &operator = (const sipwxPageSetupDialog &);
};

sipwxPageSetupDialog::sipwxPageSetupDialog(::wxWindow*parent, ::wxPageSetupDialogData*data): ::wxPageSetupDialog(parent, data), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxPageSetupDialog_GetPageSetupData, "GetPageSetupData() -> PageSetupDialogData\n"
"\n"
"Returns the wxPageSetupDialogData object associated with the dialog.");

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

    {
        ::wxPageSetupDialog *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = &sipCpp->GetPageSetupData();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_PageSetupDialog, sipName_GetPageSetupData, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPageSetupDialog_ShowModal, "ShowModal() -> int\n"
"\n"
"Shows the dialog, returning wxID_OK if the user pressed OK, and\n"
"wxID_CANCEL otherwise.");

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

    {
        ::wxPageSetupDialog *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->ShowModal();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_PageSetupDialog, sipName_ShowModal, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxPageSetupDialog)
        return sipCppV;

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxPageSetupDialog *>(sipCppV);
    else
        delete reinterpret_cast< ::wxPageSetupDialog *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxWindow* parent;
        ::wxPageSetupDialogData* data = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|J8", sipType_wxWindow, &parent, sipType_wxPageSetupDialogData, &data))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPageSetupDialog(parent, data);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxPageSetupDialog[] = {
    {sipName_GetPageSetupData, meth_wxPageSetupDialog_GetPageSetupData, METH_VARARGS, doc_wxPageSetupDialog_GetPageSetupData},
    {sipName_ShowModal, meth_wxPageSetupDialog_ShowModal, METH_VARARGS, doc_wxPageSetupDialog_ShowModal}
};

sipVariableDef variables_wxPageSetupDialog[] = {
    {PropertyVariable, sipName_PageSetupData, &methods_wxPageSetupDialog[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxPageSetupDialog, "PageSetupDialog(parent, data=None) -> None\n"
"\n"
"This class represents the page setup common dialog.");


sipClassTypeDef sipTypeDef__core_wxPageSetupDialog = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxPageSetupDialog,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_PageSetupDialog,
        {0, 0, 1},
        2, methods_wxPageSetupDialog,
        0, SIP_NULLPTR,
        1, variables_wxPageSetupDialog,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPageSetupDialog,
    -1,
    -1,
    supers_wxPageSetupDialog,
    SIP_NULLPTR,
    init_type_wxPageSetupDialog,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxPageSetupDialog,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxPageSetupDialog,
    cast_wxPageSetupDialog,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxPageSetupDialog),
};
