/*
 * 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/dcprint.h>
        #include <wx/cmndata.h>
        #include <wx/gdicmn.h>
    #include <wx/setup.h>
    #include <wxPython/wxpy_api.h>
        #include <wx/gdicmn.h>
        #include <wx/graphics.h>
        #include <wx/bitmap.h>
        #include <wx/palette.h>
        #include <wx/gdicmn.h>
        #include <wx/colour.h>
        #include <wx/dc.h>
        #include <wx/affinematrix2d.h>
        #include <wx/pen.h>
        #include "arrayholder.h"
        #include <wx/brush.h>
        #include <wx/font.h>
        #include <wx/dc.h>
        #include <wx/region.h>
        #include <wx/icon.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxPrinterDC : public ::wxPrinterDC
{
public:
    sipwxPrinterDC(const ::wxPrintData&);
    ~sipwxPrinterDC();

public:
    sipSimpleWrapper *sipPySelf;

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

sipwxPrinterDC::sipwxPrinterDC(const ::wxPrintData& printData): ::wxPrinterDC(printData), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxPrinterDC_GetPaperRect, "GetPaperRect() -> Rect\n"
"\n"
"Return the rectangle in device coordinates that corresponds to the\n"
"full paper area, including the nonprinting regions of the paper.");

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

    {
        const ::wxPrinterDC *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxRect(sipCpp->GetPaperRect());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_PrinterDC, sipName_GetPaperRect, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxPrinterDC)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxPrinterDC *>(sipCppV);
    else
        delete reinterpret_cast< ::wxPrinterDC *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        const ::wxPrintData* printData;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxPrintData, &printData))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPrinterDC(*printData);
            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_wxPrinterDC[] = {{101, 255, 1}};


static PyMethodDef methods_wxPrinterDC[] = {
    {sipName_GetPaperRect, meth_wxPrinterDC_GetPaperRect, METH_VARARGS, doc_wxPrinterDC_GetPaperRect}
};

sipVariableDef variables_wxPrinterDC[] = {
    {PropertyVariable, sipName_PaperRect, &methods_wxPrinterDC[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxPrinterDC, "PrinterDC(printData) -> None\n"
"\n"
"A printer device context is specific to MSW and Mac, and allows access\n"
"to any printer with a Windows or Macintosh driver.");


sipClassTypeDef sipTypeDef__core_wxPrinterDC = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxPrinterDC,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_PrinterDC,
        {0, 0, 1},
        1, methods_wxPrinterDC,
        0, SIP_NULLPTR,
        1, variables_wxPrinterDC,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPrinterDC,
    -1,
    -1,
    supers_wxPrinterDC,
    SIP_NULLPTR,
    init_type_wxPrinterDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxPrinterDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxPrinterDC,
    cast_wxPrinterDC,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxPrinterDC),
};
