/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtGui.h"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qabstracttextdocumentlayout.sip"
#include <qabstracttextdocumentlayout.h>
#line 46 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qabstracttextdocumentlayout.sip"
#include <qabstracttextdocumentlayout.h>
#line 31 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQAbstractTextDocumentLayoutPaintContext.cpp"

#line 164 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qrect.sip"
#include <qrect.h>
#line 35 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQAbstractTextDocumentLayoutPaintContext.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qpalette.sip"
#include <qpalette.h>
#line 38 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQAbstractTextDocumentLayoutPaintContext.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qvector.sip"
#include <qvector.h>
#line 41 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQAbstractTextDocumentLayoutPaintContext.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qabstracttextdocumentlayout.sip"
#include <qabstracttextdocumentlayout.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qabstracttextdocumentlayout.sip"
#include <qabstracttextdocumentlayout.h>
#line 46 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQAbstractTextDocumentLayoutPaintContext.cpp"


/* Call the instance's destructor. */
extern "C" {static void release_QAbstractTextDocumentLayout_PaintContext(void *, int);}
static void release_QAbstractTextDocumentLayout_PaintContext(void *sipCppV, int)
{
    delete reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipCppV);
}


extern "C" {static void *array_QAbstractTextDocumentLayout_PaintContext(Py_ssize_t);}
static void *array_QAbstractTextDocumentLayout_PaintContext(Py_ssize_t sipNrElem)
{
    return new  ::QAbstractTextDocumentLayout::PaintContext[sipNrElem];
}


extern "C" {static void array_delete_QAbstractTextDocumentLayout_PaintContext(void *);}
static void array_delete_QAbstractTextDocumentLayout_PaintContext(void *sipCpp)
{
    delete[] reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipCpp);
}


extern "C" {static void assign_QAbstractTextDocumentLayout_PaintContext(void *, Py_ssize_t, void *);}
static void assign_QAbstractTextDocumentLayout_PaintContext(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSrc);
}


extern "C" {static void *copy_QAbstractTextDocumentLayout_PaintContext(const void *, Py_ssize_t);}
static void *copy_QAbstractTextDocumentLayout_PaintContext(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new  ::QAbstractTextDocumentLayout::PaintContext(reinterpret_cast<const  ::QAbstractTextDocumentLayout::PaintContext *>(sipSrc)[sipSrcIdx]);
}


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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new  ::QAbstractTextDocumentLayout::PaintContext();

            return sipCpp;
        }
    }

    {
        const  ::QAbstractTextDocumentLayout::PaintContext* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QAbstractTextDocumentLayout_PaintContext, &a0))
        {
            sipCpp = new  ::QAbstractTextDocumentLayout::PaintContext(*a0);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


extern "C" {static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_clip(void *, PyObject *, PyObject *);}
static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_clip(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QRectF*sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -11);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->clip;

    sipPy = sipConvertFromType(sipVal, sipType_QRectF, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -16, sipPySelf);
        sipKeepReference(sipPySelf, -11, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QAbstractTextDocumentLayout_PaintContext_clip(void *, PyObject *, PyObject *);}
static int varset_QAbstractTextDocumentLayout_PaintContext_clip(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QRectF*sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    int sipIsErr = 0;
    sipVal = reinterpret_cast< ::QRectF *>(sipForceConvertToType(sipPy, sipType_QRectF, SIP_NULLPTR, SIP_NOT_NONE, SIP_NULLPTR, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->clip = *sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_cursorPosition(void *, PyObject *, PyObject *);}
static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_cursorPosition(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    sipVal = sipCpp->cursorPosition;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QAbstractTextDocumentLayout_PaintContext_cursorPosition(void *, PyObject *, PyObject *);}
static int varset_QAbstractTextDocumentLayout_PaintContext_cursorPosition(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->cursorPosition = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_palette(void *, PyObject *, PyObject *);}
static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_palette(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QPalette*sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -13);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->palette;

    sipPy = sipConvertFromType(sipVal, sipType_QPalette, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -12, sipPySelf);
        sipKeepReference(sipPySelf, -13, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QAbstractTextDocumentLayout_PaintContext_palette(void *, PyObject *, PyObject *);}
static int varset_QAbstractTextDocumentLayout_PaintContext_palette(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QPalette*sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    int sipIsErr = 0;
    sipVal = reinterpret_cast< ::QPalette *>(sipForceConvertToType(sipPy, sipType_QPalette, SIP_NULLPTR, SIP_NOT_NONE, SIP_NULLPTR, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->palette = *sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_selections(void *, PyObject *, PyObject *);}
static PyObject *varget_QAbstractTextDocumentLayout_PaintContext_selections(void *sipSelf, PyObject *, PyObject *)
{
    QVector< ::QAbstractTextDocumentLayout::Selection>*sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    sipVal = &sipCpp->selections;

    return sipConvertFromType(sipVal, sipType_QVector_0100QAbstractTextDocumentLayout_Selection, SIP_NULLPTR);
}


extern "C" {static int varset_QAbstractTextDocumentLayout_PaintContext_selections(void *, PyObject *, PyObject *);}
static int varset_QAbstractTextDocumentLayout_PaintContext_selections(void *sipSelf, PyObject *sipPy, PyObject *)
{
    QVector< ::QAbstractTextDocumentLayout::Selection>*sipVal;
     ::QAbstractTextDocumentLayout::PaintContext *sipCpp = reinterpret_cast< ::QAbstractTextDocumentLayout::PaintContext *>(sipSelf);

    int sipIsErr = 0;
    int sipValState;
    sipVal = reinterpret_cast<QVector< ::QAbstractTextDocumentLayout::Selection> *>(sipForceConvertToType(sipPy, sipType_QVector_0100QAbstractTextDocumentLayout_Selection, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->selections = *sipVal;

    sipReleaseType(sipVal, sipType_QVector_0100QAbstractTextDocumentLayout_Selection, sipValState);

    return 0;
}

sipVariableDef variables_QAbstractTextDocumentLayout_PaintContext[] = {
    {InstanceVariable, sipName_clip, (PyMethodDef *)varget_QAbstractTextDocumentLayout_PaintContext_clip, (PyMethodDef *)varset_QAbstractTextDocumentLayout_PaintContext_clip, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_cursorPosition, (PyMethodDef *)varget_QAbstractTextDocumentLayout_PaintContext_cursorPosition, (PyMethodDef *)varset_QAbstractTextDocumentLayout_PaintContext_cursorPosition, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_palette, (PyMethodDef *)varget_QAbstractTextDocumentLayout_PaintContext_palette, (PyMethodDef *)varset_QAbstractTextDocumentLayout_PaintContext_palette, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_selections, (PyMethodDef *)varget_QAbstractTextDocumentLayout_PaintContext_selections, (PyMethodDef *)varset_QAbstractTextDocumentLayout_PaintContext_selections, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QAbstractTextDocumentLayout_PaintContext, "\1QAbstractTextDocumentLayout.PaintContext()\n"
"QAbstractTextDocumentLayout.PaintContext(QAbstractTextDocumentLayout.PaintContext)");


static pyqt5ClassPluginDef plugin_QAbstractTextDocumentLayout_PaintContext = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtGui_QAbstractTextDocumentLayout_PaintContext = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QAbstractTextDocumentLayout__PaintContext,
        SIP_NULLPTR,
        &plugin_QAbstractTextDocumentLayout_PaintContext
    },
    {
        sipNameNr_PaintContext,
        {1, 255, 0},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        4, variables_QAbstractTextDocumentLayout_PaintContext,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QAbstractTextDocumentLayout_PaintContext,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QAbstractTextDocumentLayout_PaintContext,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QAbstractTextDocumentLayout_PaintContext,
    assign_QAbstractTextDocumentLayout_PaintContext,
    array_QAbstractTextDocumentLayout_PaintContext,
    copy_QAbstractTextDocumentLayout_PaintContext,
    release_QAbstractTextDocumentLayout_PaintContext,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QAbstractTextDocumentLayout_PaintContext,
    sizeof ( ::QAbstractTextDocumentLayout::PaintContext),
};
