/*
 * 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 48 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qtextlayout.sip"
#include <qtextlayout.h>
#line 70 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qtextlayout.sip"
#include <qtextlayout.h>
#line 31 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextLayoutFormatRange.cpp"

#line 318 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qtextformat.sip"
#include <qtextformat.h>
#line 35 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextLayoutFormatRange.cpp"


extern "C" {static PyObject *slot_QTextLayout_FormatRange___eq__(PyObject *,PyObject *);}
static PyObject *slot_QTextLayout_FormatRange___eq__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextLayout_FormatRange));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextLayout::FormatRange* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextLayout_FormatRange, &a0))
        {
            bool sipRes;

            sipRes = operator==((*sipCpp), *a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, eq_slot, sipType_QTextLayout_FormatRange, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QTextLayout_FormatRange___ne__(PyObject *,PyObject *);}
static PyObject *slot_QTextLayout_FormatRange___ne__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextLayout_FormatRange));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextLayout::FormatRange* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextLayout_FormatRange, &a0))
        {
            bool sipRes;

            sipRes = operator!=((*sipCpp), *a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, ne_slot, sipType_QTextLayout_FormatRange, sipSelf, sipArg);
}


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


extern "C" {static void *array_QTextLayout_FormatRange(Py_ssize_t);}
static void *array_QTextLayout_FormatRange(Py_ssize_t sipNrElem)
{
    return new  ::QTextLayout::FormatRange[sipNrElem];
}


extern "C" {static void array_delete_QTextLayout_FormatRange(void *);}
static void array_delete_QTextLayout_FormatRange(void *sipCpp)
{
    delete[] reinterpret_cast< ::QTextLayout::FormatRange *>(sipCpp);
}


extern "C" {static void assign_QTextLayout_FormatRange(void *, Py_ssize_t, void *);}
static void assign_QTextLayout_FormatRange(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QTextLayout::FormatRange *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QTextLayout::FormatRange *>(sipSrc);
}


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


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


extern "C" {static void *init_type_QTextLayout_FormatRange(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QTextLayout_FormatRange(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QTextLayout::FormatRange *sipCpp = SIP_NULLPTR;

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

            return sipCpp;
        }
    }

    {
        const  ::QTextLayout::FormatRange* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QTextLayout_FormatRange, &a0))
        {
            sipCpp = new  ::QTextLayout::FormatRange(*a0);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QTextLayout_FormatRange[] = {
    {(void *)slot_QTextLayout_FormatRange___eq__, eq_slot},
    {(void *)slot_QTextLayout_FormatRange___ne__, ne_slot},
    {0, (sipPySlotType)0}
};


extern "C" {static PyObject *varget_QTextLayout_FormatRange_format(void *, PyObject *, PyObject *);}
static PyObject *varget_QTextLayout_FormatRange_format(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QTextCharFormat*sipVal;
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -6);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->format;

    sipPy = sipConvertFromType(sipVal, sipType_QTextCharFormat, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -5, sipPySelf);
        sipKeepReference(sipPySelf, -6, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QTextLayout_FormatRange_format(void *, PyObject *, PyObject *);}
static int varset_QTextLayout_FormatRange_format(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QTextCharFormat*sipVal;
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipSelf);

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

    if (sipIsErr)
        return -1;

    sipCpp->format = *sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QTextLayout_FormatRange_length(void *, PyObject *, PyObject *);}
static PyObject *varget_QTextLayout_FormatRange_length(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipSelf);

    sipVal = sipCpp->length;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QTextLayout_FormatRange_length(void *, PyObject *, PyObject *);}
static int varset_QTextLayout_FormatRange_length(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

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

    sipCpp->length = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QTextLayout_FormatRange_start(void *, PyObject *, PyObject *);}
static PyObject *varget_QTextLayout_FormatRange_start(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipSelf);

    sipVal = sipCpp->start;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QTextLayout_FormatRange_start(void *, PyObject *, PyObject *);}
static int varset_QTextLayout_FormatRange_start(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QTextLayout::FormatRange *sipCpp = reinterpret_cast< ::QTextLayout::FormatRange *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

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

    sipCpp->start = sipVal;

    return 0;
}

sipVariableDef variables_QTextLayout_FormatRange[] = {
    {InstanceVariable, sipName_format, (PyMethodDef *)varget_QTextLayout_FormatRange_format, (PyMethodDef *)varset_QTextLayout_FormatRange_format, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_length, (PyMethodDef *)varget_QTextLayout_FormatRange_length, (PyMethodDef *)varset_QTextLayout_FormatRange_length, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_start, (PyMethodDef *)varget_QTextLayout_FormatRange_start, (PyMethodDef *)varset_QTextLayout_FormatRange_start, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QTextLayout_FormatRange, "\1QTextLayout.FormatRange()\n"
"QTextLayout.FormatRange(QTextLayout.FormatRange)");


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


sipClassTypeDef sipTypeDef_QtGui_QTextLayout_FormatRange = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QTextLayout__FormatRange,
        SIP_NULLPTR,
        &plugin_QTextLayout_FormatRange
    },
    {
        sipNameNr_FormatRange,
        {333, 255, 0},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        3, variables_QTextLayout_FormatRange,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QTextLayout_FormatRange,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QTextLayout_FormatRange,
    init_type_QTextLayout_FormatRange,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QTextLayout_FormatRange,
    assign_QTextLayout_FormatRange,
    array_QTextLayout_FormatRange,
    copy_QTextLayout_FormatRange,
    release_QTextLayout_FormatRange,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QTextLayout_FormatRange,
    sizeof ( ::QTextLayout::FormatRange),
};
